커뮤니티
수식부탁드립니다.
2014-01-19 16:13:46
185
글번호 71577
안녕하세요.수식 좀부탁드립니다.
공통조건(해외선물매매입니다)
매수,매도는 조건에의해2014년01월06일 17시이후 진입,01월14일 17시까지로 매매종료한다.
1.전략
1.진입가1.3635~1.3605가격대에서 10틱단위로 분할매수하여,손절은1.3580에하며,손절시
재매수는 1.3550~1.3530에 10틱단위로 한다.
진입가1.3685~1.3715가격대에서 10틱단위로 분할매도하여,손절은1.3745에하며
재매도는 1.3760~1.3780에 10틱단위로 한다.
2.전략
1.진입가1.3635매수하여,손절은1.3580에하며,손절시
재매수는 1.3550에 한다.
진입가1.3685매도하여,손절은1.3745에하며
재매도는 1.3760에 한다.
진입날짜,시간,진입가,손절가는 옵션으로 자유롭게 입력가능하도록 부탁드립니다.
수고하세요.
답변 1
예스스탁 예스스탁 답변
2014-01-20 16:51:57
안녕하세요
예스스탁입니다.
1번식은 피라미딩을 모든진입신호 허용으로 설정하고 적용하셔야 합니다.
1.
input : 시작날짜(20140106),시작시간(170000);
input : 끝날짜(20140114),끝시간(170000);
input : 매수시작1(1.3635),매수끝1(1.3605),매수손절1(1.3580);
input : 매수시작2(1.3550),매수끝2(1.3530);
input : 매도시작1(1.3850),매도끝1(1.3715),매도손절1(1.3745);
input : 매도시작2(1.3760),매도끝2(1.3780);
var : Trade(false),B1(false),B2(false),S1(false),S2(false);
if sdate == 시작날짜 and stime == 시작시간 Then{
Trade = True;
B1 = false;
B2 = false;
S1 = false;
S2 = false;
}
if sdate == 끝날짜 and stime == 끝시간 Then
Trade = false;
if Trade == true Then{
if MarketPosition == 1 and IsEntryName("B1") == true Then
B1 = true;
if MarketPosition == 1 and IsEntryName("B2") == true Then
B2 = true;
if MarketPosition == -1 and IsEntryName("S1") == true Then
S1 = true;
if MarketPosition == -1 and IsEntryName("S2") == true Then
S2 = true;
if B1 == false and MarketPosition == 0 and L > 매수시작1 Then
buy("b1",Atlimit,매수시작1);
if MarketPosition == 1 and IsEntryName("b1") == true and L > 매수끝1 Then
buy("bb1",atlimit,EntryPrice-((PriceScale*10)*CurrentEntries));
if MarketPosition == 1 and IsEntryName("B1") == true Then
ExitLong("bx",AtStop,매수손절1);
if B1 == true and B2 == false and MarketPosition == 0 and IsEntryName("B1",1) == true and L > 매수시작2 Then
buy("b2",Atlimit,매수시작2);
if MarketPosition == 1 and IsEntryName("b2") == true and L > 매수끝2 Then
buy("bb2",atlimit,EntryPrice-((PriceScale*10)*CurrentEntries));
if S1 == false and MarketPosition == 0 and H < 매도시작1 Then
sell("S1",Atlimit,매도시작1);
if MarketPosition == -1 and IsEntryName("S1") == true and H < 매도끝1 Then
sell("SS1",atlimit,EntryPrice+((PriceScale*10)*CurrentEntries));
if MarketPosition == 1 and IsEntryName("S1") == true Then
ExitShort("sx",AtStop,매도손절1);
if S1 == true and S2 == false and MarketPosition == 0 and IsEntryName("S1",1) == True and H < 매도시작2 Then
sell("S2",Atlimit,매도시작2);
if MarketPosition == -1 and IsEntryName("S2") == true and H < 매도끝2 Then
sell("SS2",atlimit,EntryPrice+((PriceScale*10)*CurrentEntries));
}
2.
input : 시작날짜(20140106),시작시간(170000);
input : 끝날짜(20140114),끝시간(170000);
input : 매수시작1(1.3635),매수끝1(1.3605),매수손절1(1.3580);
input : 매수시작2(1.3550),매수끝2(1.3530);
input : 매도시작1(1.3850),매도끝1(1.3715),매도손절1(1.3745);
input : 매도시작2(1.3760),매도끝2(1.3780);
var : Trade(false),B1(false),B2(false),S1(false),S2(false);
if sdate == 시작날짜 and stime == 시작시간 Then{
Trade = True;
B1 = false;
B2 = false;
S1 = false;
S2 = false;
}
if sdate == 끝날짜 and stime == 끝시간 Then
Trade = false;
if Trade == true Then{
if MarketPosition == 1 and IsEntryName("B1") == true Then
B1 = true;
if MarketPosition == 1 and IsEntryName("B2") == true Then
B2 = true;
if MarketPosition == -1 and IsEntryName("S1") == true Then
S1 = true;
if MarketPosition == -1 and IsEntryName("S2") == true Then
S2 = true;
if B1 == false and MarketPosition == 0 and L > 매수시작1 Then
buy("b1",Atlimit,매수시작1);
if MarketPosition == 1 and IsEntryName("B1") == true Then
ExitLong("bx",AtStop,매수손절1);
if B1 == true and B2 == false and MarketPosition == 0 and IsEntryName("B1",1) == true and L > 매수시작2 Then
buy("b2",Atlimit,매수시작2);
if S1 == false and MarketPosition == 0 and H < 매도시작1 Then
sell("S1",Atlimit,매도시작1);
if MarketPosition == 1 and IsEntryName("S1") == true Then
ExitShort("sx",AtStop,매도손절1);
if S1 == true and S2 == false and MarketPosition == 0 and IsEntryName("S1",1) == True and H < 매도시작2 Then
sell("S2",Atlimit,매도시작2);
}
즐거운 하루되세요
> 푸른물결 님이 쓴 글입니다.
> 제목 : 수식부탁드립니다.
> 안녕하세요.수식 좀부탁드립니다.
공통조건(해외선물매매입니다)
매수,매도는 조건에의해2014년01월06일 17시이후 진입,01월14일 17시까지로 매매종료한다.
1.전략
1.진입가1.3635~1.3605가격대에서 10틱단위로 분할매수하여,손절은1.3580에하며,손절시
재매수는 1.3550~1.3530에 10틱단위로 한다.
진입가1.3685~1.3715가격대에서 10틱단위로 분할매도하여,손절은1.3745에하며
재매도는 1.3760~1.3780에 10틱단위로 한다.
2.전략
1.진입가1.3635매수하여,손절은1.3580에하며,손절시
재매수는 1.3550에 한다.
진입가1.3685매도하여,손절은1.3745에하며
재매도는 1.3760에 한다.
진입날짜,시간,진입가,손절가는 옵션으로 자유롭게 입력가능하도록 부탁드립니다.
수고하세요.