답변완료
문의 드립니다.
input : StartTime(70000),EndTime(50000);
input : 익절틱수(50),손절틱수(0);
var : Tcond(False),entry(0);
Variables: Mom(0);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] or (sDate != Date) Then
SetStopEndofday(Endtime);
}
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
{
Tcond = False;
}
if Tcond == true Then
{
if L ==lowest(L,1) and highest(H,2) >= lowest(L,2)+PriceScale*1 Then
{
Buy("b",AtStop,(highest(H,2)+lowest(L,1))/2);
}
if MarketPosition == 1 and BarsSinceEntry == 2 Then
ExitShort();
}
if H == highest(H,1) and lowest(L,2) <= highest(H,2)+PriceScale*1 Then
{
Sell("s",AtStop,(lowest(L,2)+highest(H,1))/2);
}
if MarketPosition == -1 and BarsSinceEntry == 2 Then
ExitLong();
if L ==lowest(L,1) and highest(H,2) >= lowest(L,2)+PriceScale*10 Then
{
Buy("b1",AtStop,(highest(H,2)+lowest(L,1))/2);
}
if MarketPosition == 1 and BarsSinceEntry == 2 Then
ExitShort();
if H == highest(H,1) and lowest(L,2) <= highest(H,2)+PriceScale*10 Then
{
Sell("s1",AtStop,(lowest(L,2)+highest(H,1))/2);
}
if MarketPosition == -1 and BarsSinceEntry == 2 Then
ExitLong();
if L ==lowest(L,1) and highest(H,2) >= lowest(L,2)+PriceScale*10 Then
{
Buy("b2",AtStop,(highest(H,2)+lowest(L,1))/2);
}
if MarketPosition == 1 and BarsSinceEntry == 2 Then
ExitShort();
if H == highest(H,1) and lowest(L,2) <= highest(H,2)+PriceScale*10 Then
{
Sell("s2",AtStop,(lowest(L,2)+highest(H,1))/2);
}
if MarketPosition == -1 and BarsSinceEntry == 2 Then
ExitLong();
if L ==lowest(L,1) and highest(H,2) >= lowest(L,2)+PriceScale*1 Then
{
Buy("b3",AtStop,(highest(H,2)+lowest(L,1))/2);
}
if MarketPosition == 1 and BarsSinceEntry == 2 Then
ExitShort();
if H == highest(H,1) and lowest(L,2) <= highest(H,2)+PriceScale*1 Then
{
Sell("s3",AtStop,(lowest(L,2)+highest(H,1))/2);
}
if MarketPosition == -1 and BarsSinceEntry == 2 Then
ExitLong();
if L ==lowest(L,1) and highest(H,2) >= lowest(L,2)+PriceScale*10 Then
{
Buy("b4",AtStop,(highest(H,2)+lowest(L,1))/2);
}
if MarketPosition == 1 and BarsSinceEntry == 2 Then
ExitShort();
if H == highest(H,1) and lowest(L,2) <= highest(H,2)+PriceScale*10 Then
{
Sell("s4",AtStop,(lowest(L,2)+highest(H,1))/2);
}
if MarketPosition == -1 and BarsSinceEntry == 2 Then
ExitLong();
if L ==lowest(L,1) and highest(H,2) >= lowest(L,2)+PriceScale*10 Then
{
Buy("b5",AtStop,(highest(H,2)+lowest(L,1))/2);
}
if MarketPosition == 1 and BarsSinceEntry == 2 Then
ExitShort();
if H == highest(H,1) and lowest(L,2) <= highest(H,2)+PriceScale*10 Then
{
Sell("s5",AtStop,(lowest(L,2)+highest(H,1))/2);
}
if MarketPosition == -1 and BarsSinceEntry == 2 Then
ExitLong();
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
-------
위 수식어에 아래 3가지가 포함된 각각 별도의 수식어를 부탁드립니다.
1. 익,손절후 당일 매매정지
2. 익절후 5시간 진입금지
3. 익절후 3번째 캔들까지 진입신호금지
2024-03-19
581
글번호 177612
시스템