커뮤니티
수식
2017-11-01 10:37:41
173
글번호 113816
아래 수식을 매수진입과 매도진입으로 나누어 두 개창을 뛰어놓고 분활해서 거래하고자 하는데 수식을 두가지수식으로 나누어서 만들어 주시며는 감사하겠습니다, 감사합니다.
Var : vA_value(0), vB_value(0),vStartMin(0);
input : BarsEntryInterval(20), pMaxContracts(4),pTimeInterval(11);
var : PreTT(0), TT(0),cond99(false);
If date <> date[1] Then Begin
vA_value = H;
vB_value = L;
Cond99 = False;
vStartMin = TimeToMinutes(stime);
PreTT = TotalTrades[1];
End;
If Cond99 == False Then Begin
if vA_value < H Then vA_value = H;
if vB_value > L Then vB_value = L;
End;
If (TimeToMinutes(stime) - vStartMin) == pTimeInterval And Cond99 == False Then Begin
Cond99 = True;
End;
if Cond99 Then Begin
If CrossUp(C, vA_value) Then ExitShort("BX");
If CrossDown(C, vB_value) Then ExitLong("SX");
If time <= 115900 And TT - PreTT <= 2 Then Begin
If CrossUp(C, vA_value) Then Buy("B");
If CrossDown(C, vB_value) Then Sell("S");
End;
if MarketPosition == 1 And C > vA_value And CurrentContracts < pMaxContracts Then Begin
if BarsSinceEntry == ( 1 * BarsEntryInterval) Then
Buy("reBuy1");
if BarsSinceEntry == ( 2 * BarsEntryInterval)
Then
Buy("reBuy2");
if BarsSinceEntry == ( 3 * BarsEntryInterval)
Then
Buy("reBuy3");
End
Else if MarketPosition == -1 And C < vB_value And CurrentContracts < pMaxContracts Then Begin
if BarsSinceEntry == ( 1 * BarsEntryInterval) Then
Sell("reSell1");
if BarsSinceEntry == ( 2 * BarsEntryInterval)
Then
Sell("reSell2");
if BarsSinceEntry == ( 3 * BarsEntryInterval)
Then
Sell("reSell3");
End;
End;
SetStopEndofday(151500);
답변 1
예스스탁 예스스탁 답변
2017-11-01 15:33:00
안녕하세요
예스스탁입니다.
1.
Var : vA_value(0), vB_value(0),vStartMin(0);
input : BarsEntryInterval(20), pMaxContracts(4),pTimeInterval(11);
var : PreTT(0), TT(0),cond99(false);
If date <> date[1] Then Begin
vA_value = H;
vB_value = L;
Cond99 = False;
vStartMin = TimeToMinutes(stime);
PreTT = TotalTrades[1];
End;
If Cond99 == False Then Begin
if vA_value < H Then vA_value = H;
if vB_value > L Then vB_value = L;
End;
If (TimeToMinutes(stime) - vStartMin) == pTimeInterval And Cond99 == False Then Begin
Cond99 = True;
End;
if Cond99 Then Begin
If CrossDown(C, vB_value) Then ExitLong("BX");
If time <= 115900 And TT - PreTT <= 2 Then Begin
If CrossUp(C, vA_value) Then Buy("B");
If CrossDown(C, vB_value) Then ExitLong("bx1");
End;
if MarketPosition == 1 And C > vA_value And CurrentContracts < pMaxContracts Then Begin
if BarsSinceEntry == ( 1 * BarsEntryInterval) Then
Buy("reBuy1");
if BarsSinceEntry == ( 2 * BarsEntryInterval) Then
Buy("reBuy2");
if BarsSinceEntry == ( 3 * BarsEntryInterval) Then
Buy("reBuy3");
End
End;
SetStopEndofday(151500);
2
Var : vA_value(0), vB_value(0),vStartMin(0);
input : BarsEntryInterval(20), pMaxContracts(4),pTimeInterval(11);
var : PreTT(0), TT(0),cond99(false);
If date <> date[1] Then Begin
vA_value = H;
vB_value = L;
Cond99 = False;
vStartMin = TimeToMinutes(stime);
PreTT = TotalTrades[1];
End;
If Cond99 == False Then Begin
if vA_value < H Then vA_value = H;
if vB_value > L Then vB_value = L;
End;
If (TimeToMinutes(stime) - vStartMin) == pTimeInterval And Cond99 == False Then Begin
Cond99 = True;
End;
if Cond99 Then Begin
If CrossUp(C, vA_value) Then ExitShort("SX");
If time <= 115900 And TT - PreTT <= 2 Then Begin
If CrossUp(C, vA_value) Then ExitShort("Sx1");
If CrossDown(C, vB_value) Then sell("S");
End;
if MarketPosition == -1 And C < vB_value And CurrentContracts < pMaxContracts Then Begin
if BarsSinceEntry == ( 1 * BarsEntryInterval) Then
Sell("reSell1");
if BarsSinceEntry == ( 2 * BarsEntryInterval) Then
Sell("reSell2");
if BarsSinceEntry == ( 3 * BarsEntryInterval) Then
Sell("reSell3");
End;
End;
SetStopEndofday(151500);
즐거운 하루되세요
> 이주엽 님이 쓴 글입니다.
> 제목 : 수식
> 아래 수식을 매수진입과 매도진입으로 나누어 두 개창을 뛰어놓고 분활해서 거래하고자 하는데 수식을 두가지수식으로 나누어서 만들어 주시며는 감사하겠습니다, 감사합니다.
Var : vA_value(0), vB_value(0),vStartMin(0);
input : BarsEntryInterval(20), pMaxContracts(4),pTimeInterval(11);
var : PreTT(0), TT(0),cond99(false);
If date <> date[1] Then Begin
vA_value = H;
vB_value = L;
Cond99 = False;
vStartMin = TimeToMinutes(stime);
PreTT = TotalTrades[1];
End;
If Cond99 == False Then Begin
if vA_value < H Then vA_value = H;
if vB_value > L Then vB_value = L;
End;
If (TimeToMinutes(stime) - vStartMin) == pTimeInterval And Cond99 == False Then Begin
Cond99 = True;
End;
if Cond99 Then Begin
If CrossUp(C, vA_value) Then ExitShort("BX");
If CrossDown(C, vB_value) Then ExitLong("SX");
If time <= 115900 And TT - PreTT <= 2 Then Begin
If CrossUp(C, vA_value) Then Buy("B");
If CrossDown(C, vB_value) Then Sell("S");
End;
if MarketPosition == 1 And C > vA_value And CurrentContracts < pMaxContracts Then Begin
if BarsSinceEntry == ( 1 * BarsEntryInterval) Then
Buy("reBuy1");
if BarsSinceEntry == ( 2 * BarsEntryInterval)
Then
Buy("reBuy2");
if BarsSinceEntry == ( 3 * BarsEntryInterval)
Then
Buy("reBuy3");
End
Else if MarketPosition == -1 And C < vB_value And CurrentContracts < pMaxContracts Then Begin
if BarsSinceEntry == ( 1 * BarsEntryInterval) Then
Sell("reSell1");
if BarsSinceEntry == ( 2 * BarsEntryInterval)
Then
Sell("reSell2");
if BarsSinceEntry == ( 3 * BarsEntryInterval)
Then
Sell("reSell3");
End;
End;
SetStopEndofday(151500);
다음글
이전글