커뮤니티
문의
2016-07-22 12:14:33
176
글번호 100285
안녕하세요
노고에 항상 감사드립니다
우선 해외선물에서 snp와 골드나 오일이 틱수 계산이 좀 다른가요?
아래 수식으로 s&p 선물은 틱의 계산이 잘못되어 청산자리가 엉망인데 어떻게 적용하면 되는건지 설명 부탁드리겠습니다
중요한건 지금부터 말씀드리는 내용으로 아래 수식을 변경 부탁드립니다
아래 수식은 이평선이 크로스하면 진입하여 장의 시간에 따라 묙표틱 P1이나 혹은 P2에 청산하거나 반대신호에 청산하는 수식이고, 최초 진입하여 손실이 나면 한 계약씩 추가하여 최대 n계약까지 진입하는 수식입니다
여기서 모든 조건은 그대로하고, 첫 진입의 조건만을 바꾸려합니다
우선 이평 크로스 후 목표 틱수 P1, P2가 도달하지 않으면 실패로 간주하고
처음 이평이 크로스 되면 바로 진입하는게 아니라 이전에 두번의 실패가 확인되면 세번째 이평 크로스부터 첫진입을 하는 수식이 가능할까요?
예를들어 직전 신호에서 목표가 청산이 되었다면,
이제 기다리는 신호는 첫 이평크로스가 나오는게 목표가를 도달하지 못하고
두번째로 반대 신호가 나옵니다.
그리고 나서 역시 목표가를 도달하지 못하고
세번째로 반대 신호가 나오는 시점을 첫 진입의 조건이 되는것입니다
이렇게 해서 첫진입이 된 이후는 목표가 청산이 되기 전까지는 N계약의 추가진입이 적용되어야 합니다
그리고 위에서 언급한 시간별로 다른 목표가와 실패시는 그대로 모두 적용되어야 합니다
좀 복잡한것 같은데 잘 부탁드리겠습니다
감사합니다^^
---------------------------------------------------------------------------------------
input : L1(15),P1(15),L2(20),P2(20),N(5);
Var : vol(0);
var1 = ma(c,5);
var2 = ma(c,20);
if MarketPosition != 0 Then{
if PositionProfit < 0 Then
Vol = MaxContracts*2;
Else
vol = 1;
}
if MarketPosition == 0 Then{
if PositionProfit(1) < 0 Then
Vol = MaxContracts(1)*2;
Else
vol = 1;
}
if MarketPosition <= 0 and crossup(var1,var2) Then
buy("b1");
if MarketPosition == 1 Then{
if stime >= 80000 and stime < 153000 Then{
exitlong("BL1",AtStop,EntryPrice-PriceScale*L1);
exitlong("BP1",AtStop,EntryPrice+PriceScale*P1);
}
Else{
exitlong("BL2",AtStop,EntryPrice-PriceScale*L2);
exitlong("BP2",AtStop,EntryPrice+PriceScale*P2);
}
}
if MarketPosition >= 0 and CrossDown(var1,var2) Then
sell("s1");
if MarketPosition == -1 Then{
if stime >= 80000 and stime < 153000 Then{
ExitShort("SL1",AtStop,EntryPrice+PriceScale*L1);
ExitShort("SP1",AtStop,EntryPrice-PriceScale*P1);
}
Else{
ExitShort("SL2",AtStop,EntryPrice+PriceScale*L2);
ExitShort("SP2",AtStop,EntryPrice-PriceScale*P2);
}
}
답변 2
예스스탁 예스스탁 답변
2016-07-22 16:06:44
안녕하세요
예스스탁입니다.
1
차트의 모든 종목에 1틱은 PriceScale로 리턴을 합니다.
1틱의 값은 종목마다 다릅니다.
plot1(PriceScale);
각 종목별로 위 지표 적용하셔서 1틱값 확인하시기 바랍니다.
현재 올려주신 수식의 목표수익 쪽의 신호타입이 잘못되어 있습니다.
수정한 식입니다.
input : L1(15),P1(15),L2(20),P2(20),N(5);
Var : vol(0);
var1 = ma(c,5);
var2 = ma(c,20);
if MarketPosition != 0 Then{
if PositionProfit < 0 Then
Vol = MaxContracts*2;
Else
vol = 1;
}
if MarketPosition == 0 Then{
if PositionProfit(1) < 0 Then
Vol = MaxContracts(1)*2;
Else
vol = 1;
}
if MarketPosition <= 0 and crossup(var1,var2) Then
buy("b1");
if MarketPosition == 1 Then{
if stime >= 80000 and stime < 153000 Then{
exitlong("BL1",AtStop,EntryPrice-PriceScale*L1);
exitlong("BP1",AtLimit,EntryPrice+PriceScale*P1);
}
Else{
exitlong("BL2",AtStop,EntryPrice-PriceScale*L2);
exitlong("BP2",AtLimit,EntryPrice+PriceScale*P2);
}
}
if MarketPosition >= 0 and CrossDown(var1,var2) Then
sell("s1");
if MarketPosition == -1 Then{
if stime >= 80000 and stime < 153000 Then{
ExitShort("SL1",AtStop,EntryPrice+PriceScale*L1);
ExitShort("SP1",AtLimit,EntryPrice-PriceScale*P1);
}
Else{
ExitShort("SL2",AtStop,EntryPrice+PriceScale*L2);
ExitShort("SP2",AtLimit,EntryPrice-PriceScale*P2);
}
}
2
아래 내용 참고하시기 바랍니다.
input : L1(15),P1(15),L2(20),P2(20),N(5);
Var : vol(0),T(0),EE(0),cnt(0);
Array : cond[5](false);
var1 = ma(c,5);
var2 = ma(c,20);
if MarketPosition != 0 Then{
if PositionProfit < 0 Then
Vol = MaxContracts*2;
Else
vol = 1;
}
if MarketPosition == 0 Then{
if PositionProfit(1) < 0 Then
Vol = MaxContracts(1)*2;
Else
vol = 1;
}
#상향돌파
if crossup(var1,var2) Then{
T = 1;
EE = C;
cond[0] = false;
for cnt = 1 to 4{
cond[cnt] = cond[cnt-1][1];
}
}
#하향이탈
if CrossDown(var1,var2) Then{
T = -1;
EE = C;
cond[0] = false;
for cnt = 1 to 4{
cond[cnt] = cond[cnt-1][1];
}
}
#상향돌파후 P1혹은 P2틱이상 상승했으면 cond[0]은 true로 변경
if T == 1 Then{
if stime >= 80000 and stime < 153000 Then{
if H >= EE+PriceScale*P1 Then
cond[0] = true;
}
Else{
if H >= EE+PriceScale*P2 Then
cond[0] = true;
}
}
#하향이탈후 P1혹은 P2틱이상 하락했으면 cond[0]은 true로 변경
if T == -1 Then{
if stime >= 80000 and stime < 153000 Then{
if L <= EE-PriceScale*P1 Then
cond[0] = true;
}
Else{
if L <= EE-PriceScale*P2 Then
cond[0] = true;
}
}
if MarketPosition <= 0 and crossup(var1,var2) and
cond[1] == false and cond[2] == false Then
buy("b1");
if MarketPosition == 1 Then{
if stime >= 80000 and stime < 153000 Then{
exitlong("BL1",AtStop,EntryPrice-PriceScale*L1);
exitlong("BP1",AtStop,EntryPrice+PriceScale*P1);
}
Else{
exitlong("BL2",AtStop,EntryPrice-PriceScale*L2);
exitlong("BP2",AtStop,EntryPrice+PriceScale*P2);
}
}
if MarketPosition >= 0 and CrossDown(var1,var2) and
cond[1] == false and cond[2] == false Then
sell("s1");
if MarketPosition == -1 Then{
if stime >= 80000 and stime < 153000 Then{
ExitShort("SL1",AtStop,EntryPrice+PriceScale*L1);
ExitShort("SP1",AtStop,EntryPrice-PriceScale*P1);
}
Else{
ExitShort("SL2",AtStop,EntryPrice+PriceScale*L2);
ExitShort("SP2",AtStop,EntryPrice-PriceScale*P2);
}
}
즐거운 하루되세요
> 쿠루드 님이 쓴 글입니다.
> 제목 : 문의
> 안녕하세요
노고에 항상 감사드립니다
우선 해외선물에서 snp와 골드나 오일이 틱수 계산이 좀 다른가요?
아래 수식으로 s&p 선물은 틱의 계산이 잘못되어 청산자리가 엉망인데 어떻게 적용하면 되는건지 설명 부탁드리겠습니다
중요한건 지금부터 말씀드리는 내용으로 아래 수식을 변경 부탁드립니다
아래 수식은 이평선이 크로스하면 진입하여 장의 시간에 따라 묙표틱 P1이나 혹은 P2에 청산하거나 반대신호에 청산하는 수식이고, 최초 진입하여 손실이 나면 한 계약씩 추가하여 최대 n계약까지 진입하는 수식입니다
여기서 모든 조건은 그대로하고, 첫 진입의 조건만을 바꾸려합니다
우선 이평 크로스 후 목표 틱수 P1, P2가 도달하지 않으면 실패로 간주하고
처음 이평이 크로스 되면 바로 진입하는게 아니라 이전에 두번의 실패가 확인되면 세번째 이평 크로스부터 첫진입을 하는 수식이 가능할까요?
예를들어 직전 신호에서 목표가 청산이 되었다면,
이제 기다리는 신호는 첫 이평크로스가 나오는게 목표가를 도달하지 못하고
두번째로 반대 신호가 나옵니다.
그리고 나서 역시 목표가를 도달하지 못하고
세번째로 반대 신호가 나오는 시점을 첫 진입의 조건이 되는것입니다
이렇게 해서 첫진입이 된 이후는 목표가 청산이 되기 전까지는 N계약의 추가진입이 적용되어야 합니다
그리고 위에서 언급한 시간별로 다른 목표가와 실패시는 그대로 모두 적용되어야 합니다
좀 복잡한것 같은데 잘 부탁드리겠습니다
감사합니다^^
---------------------------------------------------------------------------------------
input : L1(15),P1(15),L2(20),P2(20),N(5);
Var : vol(0);
var1 = ma(c,5);
var2 = ma(c,20);
if MarketPosition != 0 Then{
if PositionProfit < 0 Then
Vol = MaxContracts*2;
Else
vol = 1;
}
if MarketPosition == 0 Then{
if PositionProfit(1) < 0 Then
Vol = MaxContracts(1)*2;
Else
vol = 1;
}
if MarketPosition <= 0 and crossup(var1,var2) Then
buy("b1");
if MarketPosition == 1 Then{
if stime >= 80000 and stime < 153000 Then{
exitlong("BL1",AtStop,EntryPrice-PriceScale*L1);
exitlong("BP1",AtStop,EntryPrice+PriceScale*P1);
}
Else{
exitlong("BL2",AtStop,EntryPrice-PriceScale*L2);
exitlong("BP2",AtStop,EntryPrice+PriceScale*P2);
}
}
if MarketPosition >= 0 and CrossDown(var1,var2) Then
sell("s1");
if MarketPosition == -1 Then{
if stime >= 80000 and stime < 153000 Then{
ExitShort("SL1",AtStop,EntryPrice+PriceScale*L1);
ExitShort("SP1",AtStop,EntryPrice-PriceScale*P1);
}
Else{
ExitShort("SL2",AtStop,EntryPrice+PriceScale*L2);
ExitShort("SP2",AtStop,EntryPrice-PriceScale*P2);
}
}
쿠루드
2016-07-23 08:38:53
죄송하지만, 첫신호부터 다르게 나오고, 목표틱이나 손절틱이 맞지 않네요
S&P와 골드만 예를 들어 각각 틱가치가 0.01 과 0.25인데
그럼 20틱손절 20틱 익절이면 변수를 어떻게 써주라는 건가요?
어차피 pricescale*변수값이 되어서 그냥 20틱이면 변수를 20 이라고만 정해주면 되는거 아닌가요?
그리고, 최초1계약 진입하고 실패시 +1계약씩 최대 n계약까지 가능하게 다시 부탁드리겠습니다
감사합니다
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 문의
> 안녕하세요
예스스탁입니다.
1
차트의 모든 종목에 1틱은 PriceScale로 리턴을 합니다.
1틱의 값은 종목마다 다릅니다.
plot1(PriceScale);
각 종목별로 위 지표 적용하셔서 1틱값 확인하시기 바랍니다.
현재 올려주신 수식의 목표수익 쪽의 신호타입이 잘못되어 있습니다.
수정한 식입니다.
input : L1(15),P1(15),L2(20),P2(20),N(5);
Var : vol(0);
var1 = ma(c,5);
var2 = ma(c,20);
if MarketPosition != 0 Then{
if PositionProfit < 0 Then
Vol = MaxContracts*2;
Else
vol = 1;
}
if MarketPosition == 0 Then{
if PositionProfit(1) < 0 Then
Vol = MaxContracts(1)*2;
Else
vol = 1;
}
if MarketPosition <= 0 and crossup(var1,var2) Then
buy("b1");
if MarketPosition == 1 Then{
if stime >= 80000 and stime < 153000 Then{
exitlong("BL1",AtStop,EntryPrice-PriceScale*L1);
exitlong("BP1",AtLimit,EntryPrice+PriceScale*P1);
}
Else{
exitlong("BL2",AtStop,EntryPrice-PriceScale*L2);
exitlong("BP2",AtLimit,EntryPrice+PriceScale*P2);
}
}
if MarketPosition >= 0 and CrossDown(var1,var2) Then
sell("s1");
if MarketPosition == -1 Then{
if stime >= 80000 and stime < 153000 Then{
ExitShort("SL1",AtStop,EntryPrice+PriceScale*L1);
ExitShort("SP1",AtLimit,EntryPrice-PriceScale*P1);
}
Else{
ExitShort("SL2",AtStop,EntryPrice+PriceScale*L2);
ExitShort("SP2",AtLimit,EntryPrice-PriceScale*P2);
}
}
2
아래 내용 참고하시기 바랍니다.
input : L1(15),P1(15),L2(20),P2(20),N(5);
Var : vol(0),T(0),EE(0),cnt(0);
Array : cond[5](false);
var1 = ma(c,5);
var2 = ma(c,20);
if MarketPosition != 0 Then{
if PositionProfit < 0 Then
Vol = MaxContracts*2;
Else
vol = 1;
}
if MarketPosition == 0 Then{
if PositionProfit(1) < 0 Then
Vol = MaxContracts(1)*2;
Else
vol = 1;
}
#상향돌파
if crossup(var1,var2) Then{
T = 1;
EE = C;
cond[0] = false;
for cnt = 1 to 4{
cond[cnt] = cond[cnt-1][1];
}
}
#하향이탈
if CrossDown(var1,var2) Then{
T = -1;
EE = C;
cond[0] = false;
for cnt = 1 to 4{
cond[cnt] = cond[cnt-1][1];
}
}
#상향돌파후 P1혹은 P2틱이상 상승했으면 cond[0]은 true로 변경
if T == 1 Then{
if stime >= 80000 and stime < 153000 Then{
if H >= EE+PriceScale*P1 Then
cond[0] = true;
}
Else{
if H >= EE+PriceScale*P2 Then
cond[0] = true;
}
}
#하향이탈후 P1혹은 P2틱이상 하락했으면 cond[0]은 true로 변경
if T == -1 Then{
if stime >= 80000 and stime < 153000 Then{
if L <= EE-PriceScale*P1 Then
cond[0] = true;
}
Else{
if L <= EE-PriceScale*P2 Then
cond[0] = true;
}
}
if MarketPosition <= 0 and crossup(var1,var2) and
cond[1] == false and cond[2] == false Then
buy("b1");
if MarketPosition == 1 Then{
if stime >= 80000 and stime < 153000 Then{
exitlong("BL1",AtStop,EntryPrice-PriceScale*L1);
exitlong("BP1",AtStop,EntryPrice+PriceScale*P1);
}
Else{
exitlong("BL2",AtStop,EntryPrice-PriceScale*L2);
exitlong("BP2",AtStop,EntryPrice+PriceScale*P2);
}
}
if MarketPosition >= 0 and CrossDown(var1,var2) and
cond[1] == false and cond[2] == false Then
sell("s1");
if MarketPosition == -1 Then{
if stime >= 80000 and stime < 153000 Then{
ExitShort("SL1",AtStop,EntryPrice+PriceScale*L1);
ExitShort("SP1",AtStop,EntryPrice-PriceScale*P1);
}
Else{
ExitShort("SL2",AtStop,EntryPrice+PriceScale*L2);
ExitShort("SP2",AtStop,EntryPrice-PriceScale*P2);
}
}
즐거운 하루되세요
> 쿠루드 님이 쓴 글입니다.
> 제목 : 문의
> 안녕하세요
노고에 항상 감사드립니다
우선 해외선물에서 snp와 골드나 오일이 틱수 계산이 좀 다른가요?
아래 수식으로 s&p 선물은 틱의 계산이 잘못되어 청산자리가 엉망인데 어떻게 적용하면 되는건지 설명 부탁드리겠습니다
중요한건 지금부터 말씀드리는 내용으로 아래 수식을 변경 부탁드립니다
아래 수식은 이평선이 크로스하면 진입하여 장의 시간에 따라 묙표틱 P1이나 혹은 P2에 청산하거나 반대신호에 청산하는 수식이고, 최초 진입하여 손실이 나면 한 계약씩 추가하여 최대 n계약까지 진입하는 수식입니다
여기서 모든 조건은 그대로하고, 첫 진입의 조건만을 바꾸려합니다
우선 이평 크로스 후 목표 틱수 P1, P2가 도달하지 않으면 실패로 간주하고
처음 이평이 크로스 되면 바로 진입하는게 아니라 이전에 두번의 실패가 확인되면 세번째 이평 크로스부터 첫진입을 하는 수식이 가능할까요?
예를들어 직전 신호에서 목표가 청산이 되었다면,
이제 기다리는 신호는 첫 이평크로스가 나오는게 목표가를 도달하지 못하고
두번째로 반대 신호가 나옵니다.
그리고 나서 역시 목표가를 도달하지 못하고
세번째로 반대 신호가 나오는 시점을 첫 진입의 조건이 되는것입니다
이렇게 해서 첫진입이 된 이후는 목표가 청산이 되기 전까지는 N계약의 추가진입이 적용되어야 합니다
그리고 위에서 언급한 시간별로 다른 목표가와 실패시는 그대로 모두 적용되어야 합니다
좀 복잡한것 같은데 잘 부탁드리겠습니다
감사합니다^^
---------------------------------------------------------------------------------------
input : L1(15),P1(15),L2(20),P2(20),N(5);
Var : vol(0);
var1 = ma(c,5);
var2 = ma(c,20);
if MarketPosition != 0 Then{
if PositionProfit < 0 Then
Vol = MaxContracts*2;
Else
vol = 1;
}
if MarketPosition == 0 Then{
if PositionProfit(1) < 0 Then
Vol = MaxContracts(1)*2;
Else
vol = 1;
}
if MarketPosition <= 0 and crossup(var1,var2) Then
buy("b1");
if MarketPosition == 1 Then{
if stime >= 80000 and stime < 153000 Then{
exitlong("BL1",AtStop,EntryPrice-PriceScale*L1);
exitlong("BP1",AtStop,EntryPrice+PriceScale*P1);
}
Else{
exitlong("BL2",AtStop,EntryPrice-PriceScale*L2);
exitlong("BP2",AtStop,EntryPrice+PriceScale*P2);
}
}
if MarketPosition >= 0 and CrossDown(var1,var2) Then
sell("s1");
if MarketPosition == -1 Then{
if stime >= 80000 and stime < 153000 Then{
ExitShort("SL1",AtStop,EntryPrice+PriceScale*L1);
ExitShort("SP1",AtStop,EntryPrice-PriceScale*P1);
}
Else{
ExitShort("SL2",AtStop,EntryPrice+PriceScale*L2);
ExitShort("SP2",AtStop,EntryPrice-PriceScale*P2);
}
}
다음글
이전글