예스스탁
예스스탁 답변
2021-04-08 14:51:26
안녕하세요
예스스탁입니다.
input : StartTime(070000),EndTime(055500);
input : BuyN(50),SellN(60),당일수익틱수(100);;
var : Tcond(false),N1(0),dayPl(0),당일수익(0),Xcond(false);
당일수익 = PriceScale*당일수익틱수;
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
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
{
var1 = O;
Tcond = true;
Xcond = false;
N1 = NetProfit;
SetStopEndofday(0);
}
daypl = NetProfit-N1;
if TotalTrades > TotalTrades[1] then
{
if daypl >= 당일수익 Then
Xcond = true;
if IsExitName("dbp",1) == true or IsExitName("dsp",1) == true then
Xcond = true;
}
if Tcond == true and Xcond == False Then
{
if MarketPosition <= 0 and L >= DayOpen-80*PriceScale Then
Buy("b",AtLimit,DayOpen-40*PriceScale);
if MarketPosition <= 0 and L >= DayOpen-80*PriceScale Then
Sell("s",AtLimit,DayOpen+5*PriceScale);
}
if MarketPosition == 1 Then
{
ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts));
SetStopProfittarget(PriceScale*BuyN,PointStop);
SetStopLoss(PriceScale*BuyN,PointStop);
}
Else if MarketPosition == -1 Then
{
ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts));
SetStopProfittarget(PriceScale*SellN,PointStop);
SetStopLoss(PriceScale*SellN,PointStop);
}
Else
{
SetStopProfittarget(0);
SetStopLoss(0);
}
즐거운 하루되세요
> 푸른 님이 쓴 글입니다.
> 제목 : 수식어 부탁드립니다
> input : StartTime(070000),EndTime(055500);
input : BuyN(50),SellN(60);
var : Tcond(false);
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
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
{
var1 = O;
Tcond = true;
SetStopEndofday(0);
}
if Tcond == true Then
{
if MarketPosition <= 0 and L >= DayOpen-80*PriceScale Then
Buy("b",AtLimit,DayOpen-40*PriceScale);
if MarketPosition <= 0 and L >= DayOpen-80*PriceScale Then
Sell("s",AtLimit,DayOpen+5*PriceScale);
}
if MarketPosition == 1 Then
{
SetStopProfittarget(PriceScale*BuyN,PointStop);
SetStopLoss(PriceScale*BuyN,PointStop);
}
Else if MarketPosition == -1 Then
{
SetStopProfittarget(PriceScale*SellN,PointStop);
SetStopLoss(PriceScale*SellN,PointStop);
}
Else
{
SetStopProfittarget(0);
SetStopLoss(0);
}
-------------------------
100틱에 목표수익시 매매정지를 포함하고자 합니다.