커뮤니티
시스템수정
2011-08-07 11:42:31
730
글번호 41698
Inputs: StartTme(1200), R66(False), R50(True), R33(True);
Variables: NewHigh(0), NewLow(0), NewHighTime(0), NewLowTime(0), Price66(0), Price50(0), Price33(0), NoTradesToday(True), MP(0), LExitPrice(0), SExitPrice(0);
{New Session Reset}
If Date <> Date[1] Then Begin
NewHigh=High;
NewLow = Low;
NewHighTime = TimeToMinutes(Time);
NewLowTime = TimeToMinutes(Time);
NoTradesToday = True;
End;
MP = MarketPosition;
Condition1 = TimeToMinutes(Time) > TimeToMinutes(StartTme);
If MP = 1 OR MP =-1 Then
NoTradesToday = False;
If Condition1 = False Then Begin
{Highest High time and price}
If High > NewHigh Then Begin
NewHigh = High;
NewHighTime = TimeToMinutes(Time);
End;
{Lowest Low time and price}
If Low < NewLow Then Begin
NewLow = Low;
NewLowTime = TimeToMinutes(Time);
End;
{EntryPrice Setup}
Price66 = NewLow + (NewHigh - NewLow) * .66;
Price50 = (NewLow + NewHigh) / 2;
Price33 = NewLow + (NewHigh - NewLow) * .33;
End;
If Condition1 AND NoTradesToday Then Begin
{Long Entry}
If NewHighTime > NewLowTime Then Begin
If r66 Then
Buy ("L66") Next Bar at Price66 Limit;
If r50 Then
Buy ("L50") Next Bar at Price50 Limit;
If r33 Then
Buy ("L33") Next Bar at Price33 Limit;
End
Else Begin
{Short Entry}
If r66 Then
Sell ("S66") Next Bar at Price66 Limit;
If r50 Then
Sell ("S50") Next Bar at Price50 Limit;
If r33 Then
Sell ("S33") Next Bar at Price33 Limit;
End;
End;
{Long Exit}
If MP = 1 Then Begin
If MP[1] <> 1 Then
LExitPrice = EntryPrice - Average(Range, 4) * 2
Else
LExitPrice = LExitPrice + (Low - LExitPrice) / 2;
ExitLong Next Bar at LExitPrice Stop;
End;
{Short Exit}
If MP = -1 Then Begin
If MP[1] <> -1 Then
SExitPrice = EntryPrice + Average(Range, 4) * 2
Else
SExitPrice = SExitPrice - (SExitPrice - High) / 2;
ExitShort Next Bar at SExitPrice Stop;
End;
답변 1
예스스탁 예스스탁 답변
2011-08-08 14:22:05
안녕하세요
예스스탁입니다.
Inputs: StartTme(120000), R66(False), R50(True), R33(True);
Variables: NewHigh(0), NewLow(0), NewHighTime(0), NewLowTime(0), Price66(0), Price50(0), Price33(0), NoTradesToday(True), MP(0), LExitPrice(0), SExitPrice(0);
#{New Session Reset}
If Date <> Date[1] Then Begin
NewHigh= High;
NewLow = Low;
NewHighTime = TimeToMinutes(sTime);
NewLowTime = TimeToMinutes(sTime);
NoTradesToday = True;
End;
MP = MarketPosition;
Condition1 = TimeToMinutes(sTime) > TimeToMinutes(StartTme);
If MP == 1 OR MP ==-1 Then
NoTradesToday = False;
If Condition1 == False Then Begin
#{Highest High time and price}
If High > NewHigh Then Begin
NewHigh = High;
NewHighTime = TimeToMinutes(Time);
End;
#{Lowest Low time and price}
If Low < NewLow Then Begin
NewLow = Low;
NewLowTime = TimeToMinutes(Time);
End;
#{EntryPrice Setup}
Price66 = NewLow + (NewHigh - NewLow) * .66;
Price50 = (NewLow + NewHigh) / 2;
Price33 = NewLow + (NewHigh - NewLow) * .33;
End;
If Condition1 AND NoTradesToday Then Begin
#{Long Entry}
If NewHighTime > NewLowTime Then Begin
If r66 Then
Buy ("L66", AtLimit, Price66);
If r50 Then
Buy ("L50", AtLimit, Price50);
If r33 Then
Buy ("L33", atlimit, Price33);
End
Else Begin
#{Short Entry}
If r66 Then
Sell ("S66", AtLimit, Price66);
If r50 Then
Sell ("S50", atlimit, Price50);
If r33 Then
Sell ("S33", AtLimit, Price33);
End;
End;
#{Long Exit}
If MP == 1 Then Begin
If MP[1] <> 1 Then
LExitPrice = EntryPrice - Average(Range, 4) * 2;
Else
LExitPrice = LExitPrice + (Low - LExitPrice) / 2;
ExitLong("bx",AtStop,LExitPrice);
End;
#{Short Exit}
If MP == -1 Then Begin
If MP[1] <> -1 Then
SExitPrice = EntryPrice + Average(Range, 4) * 2;
Else
SExitPrice = SExitPrice - (SExitPrice - High) / 2;
ExitShort("sx",AtStop, SExitPrice);
End;
즐거운 하루되세요
> 대두 님이 쓴 글입니다.
> 제목 : 시스템수정
> Inputs: StartTme(1200), R66(False), R50(True), R33(True);
Variables: NewHigh(0), NewLow(0), NewHighTime(0), NewLowTime(0), Price66(0), Price50(0), Price33(0), NoTradesToday(True), MP(0), LExitPrice(0), SExitPrice(0);
{New Session Reset}
If Date <> Date[1] Then Begin
NewHigh=High;
NewLow = Low;
NewHighTime = TimeToMinutes(Time);
NewLowTime = TimeToMinutes(Time);
NoTradesToday = True;
End;
MP = MarketPosition;
Condition1 = TimeToMinutes(Time) > TimeToMinutes(StartTme);
If MP = 1 OR MP =-1 Then
NoTradesToday = False;
If Condition1 = False Then Begin
{Highest High time and price}
If High > NewHigh Then Begin
NewHigh = High;
NewHighTime = TimeToMinutes(Time);
End;
{Lowest Low time and price}
If Low < NewLow Then Begin
NewLow = Low;
NewLowTime = TimeToMinutes(Time);
End;
{EntryPrice Setup}
Price66 = NewLow + (NewHigh - NewLow) * .66;
Price50 = (NewLow + NewHigh) / 2;
Price33 = NewLow + (NewHigh - NewLow) * .33;
End;
If Condition1 AND NoTradesToday Then Begin
{Long Entry}
If NewHighTime > NewLowTime Then Begin
If r66 Then
Buy ("L66") Next Bar at Price66 Limit;
If r50 Then
Buy ("L50") Next Bar at Price50 Limit;
If r33 Then
Buy ("L33") Next Bar at Price33 Limit;
End
Else Begin
{Short Entry}
If r66 Then
Sell ("S66") Next Bar at Price66 Limit;
If r50 Then
Sell ("S50") Next Bar at Price50 Limit;
If r33 Then
Sell ("S33") Next Bar at Price33 Limit;
End;
End;
{Long Exit}
If MP = 1 Then Begin
If MP[1] <> 1 Then
LExitPrice = EntryPrice - Average(Range, 4) * 2
Else
LExitPrice = LExitPrice + (Low - LExitPrice) / 2;
ExitLong Next Bar at LExitPrice Stop;
End;
{Short Exit}
If MP = -1 Then Begin
If MP[1] <> -1 Then
SExitPrice = EntryPrice + Average(Range, 4) * 2
Else
SExitPrice = SExitPrice - (SExitPrice - High) / 2;
ExitShort Next Bar at SExitPrice Stop;
End;
다음글
이전글