예스스탁
예스스탁 답변
2021-06-03 11:37:49
안녕하세요
예스스탁입니다.
각 진입별로 1회만 진입하게 수정해 드립니다.
input : StartTime(70000),EndTime(55000),Xtime(55500);
var : Tcond(false);
var : B1(0),B2(0),BX1(0),BX2(0);
var : S1(0),S2(0),SX1(0),SX2(0);
var : B1cnt(0),B2cnt(0),S1cnt(0),S2cnt(0);
if sdate != sDate[1] Then
SetStopEndofday(Xtime);
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
Tcond = False;
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
SetStopEndofday(0);
B1cnt = 0;
B2cnt = 0;
S1cnt = 0;
S2cnt = 0;
}
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
( CurrentContracts > CurrentContracts[1]) Then
{
if LatestEntryName(0) == "B1" Then
B1cnt = B1cnt+1;
if LatestEntryName(0) == "B2" Then
B2cnt = B2cnt+1;
if LatestEntryName(0) == "S1" Then
S1cnt = S1cnt+1;
if LatestEntryName(0) == "S2" Then
S2cnt = S2cnt+1;
}
B1 = DayLow(1)+(DayHigh(1)-DayLow(1))*0.236;
B2 = DayLow(1)+(DayHigh(1)-DayLow(1))*0.226;
BX1 = DayLow(1)+(DayHigh(1)-DayLow(1))*0.900;
BX2 = DayHigh(1);
S1 = DayHigh(1)+(DayHigh(1)-DayLow(1))*1.746;
S2 = DayHigh(1)+(DayHigh(1)-DayLow(1))*1.682;
SX1 = DayLow(1)+(DayHigh(1)-DayLow(1))*1.000;
SX2 = DayHigh(1);
if Tcond == true Then
{
if (MarketPosition == 0 or (MarketPosition == 1 and MaxEntries == 1)) Then
{
if B1cnt < 1 and L > B1 Then
Buy("B1",AtLimit,B1);
if B2cnt < 1 and L > B2 Then
Buy("B2",AtLimit,B2);
}
if MarketPosition == 1 Then
{
ExitLong("bx1",AtLimit,BX1);
ExitLong("bx2",AtLimit,BX2);
}
if (MarketPosition == 0 or (MarketPosition == -1 and MaxEntries == 1)) Then
{
if S1cnt < 1 and H < S1 Then
Sell("S1",AtLimit,S1);
if S2cnt < 1 and H < S2 Then
Sell("S2",AtLimit,S2);
}
if MarketPosition == -1 Then
{
ExitShort("sx1",AtLimit,SX1);
ExitShort("sx2",AtStop,SX2);
}
}
SetStopProfittarget(PriceScale*150,PointStop);
SetStopLoss(PriceScale*0,PointStop);
즐거운 하루되세요
> 푸른 님이 쓴 글입니다.
> 제목 : 수식작성
>
input : StartTime(70000),EndTime(55000),Xtime(55500);
var : Tcond(false),entry(0);
var : B1(0),B2(0),BX1(0),BX2(0);
var : S1(0),S2(0),SX1(0),SX2(0);
if sdate != sDate[1] Then
SetStopEndofday(Xtime);
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
Tcond = False;
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
SetStopEndofday(0);
entry = 0;
}
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
B1 = DayLow(1)+(DayHigh(1)-DayLow(1))*0.236;
B2 = DayLow(1)+(DayHigh(1)-DayLow(1))*0.226;
BX1 = DayLow(1)+(DayHigh(1)-DayLow(1))*0.900;
BX2 = DayHigh(1);
S1 = DayHigh(1)+(DayHigh(1)-DayLow(1))*1.746;
S2 = DayHigh(1)+(DayHigh(1)-DayLow(1))*1.682;
SX1 = DayLow(1)+(DayHigh(1)-DayLow(1))*1.000;
SX2 = DayHigh(1);
if Tcond == true Then
{
if (MarketPosition == 0 or (MarketPosition == 1 and MaxEntries == 1)) Then
{
if entry < 5 and L > B1 Then
Buy("b1",AtLimit,B1);
if entry < 5 and L > B2 Then
Buy("b2",AtLimit,B2);
}
if MarketPosition == 1 Then
{
ExitLong("bx1",AtLimit,BX1);
ExitLong("bx2",AtLimit,BX2);
}
if (MarketPosition == 0 or (MarketPosition == -1 and MaxEntries == 1)) Then
{
if entry < 5 and H < S1 Then
Sell("S1",AtLimit,S1);
if entry < 5 and H < S2 Then
Sell("S2",AtLimit,S2);
}
if MarketPosition == -1 Then
{
ExitShort("sx1",AtLimit,SX1);
ExitShort("sx2",AtStop,SX2);
}
}
SetStopProfittarget(PriceScale*150,PointStop);
SetStopLoss(PriceScale*0,PointStop);
-----------------
그래프의 b1 진입 2회를 1회로 수정하고싶습니다.
b2 , s1 , s2 도 같이 부탁드립니다.
늘 감사합니다.