예스스탁
예스스탁 답변
2023-05-30 14:05:13
안녕하세요
예스스탁입니다.
Input : shortPeriod(5), longPeriod(20);
input : StartTime(230000),EndTime(050000);
input : 익절틱수(50);
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);
}
}
value1 = ma(C, shortPeriod);
value2 = ma(C, longPeriod);
if Tcond == true Then
{
If MarketPosition <= 0 and CrossUP(value1, value2) Then
Buy("b1",OnClose,Def,1);
If CrossDown(value1, value2) Then
Sell("s1",OnClose,Def,1);
if MarketPosition == 1 Then
{
if MaxEntries == 1 Then
Buy("b2",AtLimit,EntryPrice-PriceScale*100,1);
if MaxEntries == 2 Then
Buy("b3",AtLimit,EntryPrice-PriceScale*200,1);
if MaxEntries == 3 Then
exitlong("bx",AtLimit,AvgEntryPrice+PriceScale*익절틱수);
}
if MarketPosition == -1 Then
{
if MaxEntries == 1 Then
Sell("s2",AtLimit,EntryPrice+PriceScale*100,1);
if MaxEntries == 2 Then
Sell("s3",AtLimit,EntryPrice+PriceScale*200,1);
if MaxEntries == 3 Then
ExitShort("sx",AtLimit,AvgEntryPrice-PriceScale*익절틱수);
}
}
즐거운 하루되세요
> 예스요 님이 쓴 글입니다.
> 제목 : 문의 드립니다.~~~~
> 아래 cme해외선물 매매식에서
밤23시에서 새벽5시까지만 진입하고
매수 또는 매도 진입시
진입후 익절없이 진입가 대비
100틱 손실시 물타기진입 1개추가
200틱 손실시 물타기진입 1개추가하고(총진입 3개 까지만)
모든 진입 후에 합하여 익절조건이면 잔고 전부 청산 되고
반대청산 진입시에는
잔고 전부 청산과 동시에 진입 1개되는 식을 부탁드립니다.
Input : shortPeriod(5), longPeriod(20);
input : 익절틱수(50);
value1 = ma(C, shortPeriod);
value2 = ma(C, longPeriod);
# 매수/매도청산
If CrossUP(value1, value2) Then
{
Buy();
}
# 매도/매수청산
If CrossDown(value1, value2) Then
{
Sell();
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);