Input : af(0.02), maxAF(0.2);
input : StartTime(180000),EndTime(50000);
var : Tcond(false);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
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
{
Tcond = true;
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
Var : value(0);
value = sar(af,maxAF);
# 매수/매도청산
If C > value Then
{
Buy();
}
# 매도/매수청산
If C < value Then
{
Sell();
}
위 수식어의 200틱 익절후 매매정지의 수식어를 추가로 부탁드립니다.
답변 1
예스스탁
예스스탁 답변
2025-01-22 11:34:34
안녕하세요
예스스탁입니다.
Input : af(0.02), maxAF(0.2);
input : StartTime(180000),EndTime(50000);
Input : 당일수익틱수(200);
var : Tcond(false),당일수익(0),value(0),Xcond(False),N1(0),daypl(0);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
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
{
Tcond = true;
N1 = NetProfit;
Xcond = False;
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
당일수익 = PriceScale*당일수익틱수;
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;
}
value = sar(af,maxAF);
if Tcond == true and Xcond == False Then
{
If CrossUp(C,value) Then
{
Buy();
}
If CrossDown(C,value) Then
{
Sell();
}
}
if MarketPosition == 1 then
{
ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts));
}
if MarketPosition == -1 then{
ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts));
}
즐거운 하루되세요
> 푸른 님이 쓴 글입니다.
> 제목 : 문의 드립니다
> Input : af(0.02), maxAF(0.2);
input : StartTime(180000),EndTime(50000);
var : Tcond(false);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
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
{
Tcond = true;
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
Var : value(0);
value = sar(af,maxAF);
# 매수/매도청산
If C > value Then
{
Buy();
}
# 매도/매수청산
If C < value Then
{
Sell();
}
위 수식어의 200틱 익절후 매매정지의 수식어를 추가로 부탁드립니다.