커뮤니티

문의

프로필 이미지
좌오비우오비
2022-02-11 15:24:59
951
글번호 156205
답변완료
기존 s1 청산수식에 s2 청산수식을 아래처럼 추가했습니다. s1과 별개로 청산변수가 작동되는 수식이 맞는지요. ******************************************************************************** if MarketPosition == -1 Then { if IsEntryName("s1",1) == true and EntryTime >= 090000 and EntryTime < 100000 then { SetStopLoss(loss0910,PercentStop); SetStopTrailing(tr0910,0,PercentStop,1); SetStopInactivity(최소가격0910,봉갯수0910,PercentStop); } else if IsEntryName("s1",1) == true and MarketPosition == -1 and EntryTime >= 100000 and EntryTime < 110000 then { SetStopLoss(loss1011,PercentStop); SetStopTrailing(tr1011,0,PercentStop,1); SetStopInactivity(최소가격1011,봉갯수1011,PercentStop); } else if IsEntryName("s1",1) == true and MarketPosition == -1 and EntryTime >= 110000 and EntryTime < 120000 then { SetStopLoss(loss1112,percentStop); SetStopTrailing(tr1112,0,percentStop,1); SetStopInactivity(최소가격1112,봉갯수1112,PercentStop); } else if IsEntryName("s2",1) == true and MarketPosition == -1 and EntryTime >= 100000 and EntryTime < 110000 then { SetStopLoss(s2loss1011,percentStop); SetStopTrailing(s2tr1011,0,percentStop,1); SetStopInactivity(s2최소가격1011,s2봉갯수1011,PercentStop); } else if IsEntryName("s2",1) == true and MarketPosition == -1 and EntryTime >= 110000 and EntryTime < 120000 then { SetStopLoss(s2loss1112,percentStop); SetStopTrailing(s2tr1112,0,percentStop,1); SetStopInactivity(s2최소가격1112,s2봉갯수1112,PercentStop); } Else { SetStopLoss(loss,PercentStop); SetStopTrailing(tr,0,PercentStop,1); SetStopInactivity(최소가격,봉갯수,PercentStop); } }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2022-02-14 11:09:00

안녕하세요 예스스탁입니다. 매도포지션이 아니면 0으로 각 청산함수 초기화되게 하셔야 합니다. if MarketPosition == -1 Then { if IsEntryName("s1",1) == true and EntryTime >= 090000 and EntryTime < 100000 then { SetStopLoss(loss0910,PercentStop); SetStopTrailing(tr0910,0,PercentStop,1); SetStopInactivity(최소가격0910,봉갯수0910,PercentStop); } else if IsEntryName("s1",1) == true and MarketPosition == -1 and EntryTime >= 100000 and EntryTime < 110000 then { SetStopLoss(loss1011,PercentStop); SetStopTrailing(tr1011,0,PercentStop,1); SetStopInactivity(최소가격1011,봉갯수1011,PercentStop); } else if IsEntryName("s1",1) == true and MarketPosition == -1 and EntryTime >= 110000 and EntryTime < 120000 then { SetStopLoss(loss1112,percentStop); SetStopTrailing(tr1112,0,percentStop,1); SetStopInactivity(최소가격1112,봉갯수1112,PercentStop); } else if IsEntryName("s2",1) == true and MarketPosition == -1 and EntryTime >= 100000 and EntryTime < 110000 then { SetStopLoss(s2loss1011,percentStop); SetStopTrailing(s2tr1011,0,percentStop,1); SetStopInactivity(s2최소가격1011,s2봉갯수1011,PercentStop); } else if IsEntryName("s2",1) == true and MarketPosition == -1 and EntryTime >= 110000 and EntryTime < 120000 then { SetStopLoss(s2loss1112,percentStop); SetStopTrailing(s2tr1112,0,percentStop,1); SetStopInactivity(s2최소가격1112,s2봉갯수1112,PercentStop); } Else { SetStopLoss(loss,PercentStop); SetStopTrailing(tr,0,PercentStop,1); SetStopInactivity(최소가격,봉갯수,PercentStop); } } Else { SetStopLoss(0); SetStopTrailing(0,0); SetStopInactivity(0,0); } 즐거운 하루되세요 > 좌오비우오비 님이 쓴 글입니다. > 제목 : 문의 > 기존 s1 청산수식에 s2 청산수식을 아래처럼 추가했습니다. s1과 별개로 청산변수가 작동되는 수식이 맞는지요. ******************************************************************************** if MarketPosition == -1 Then { if IsEntryName("s1",1) == true and EntryTime >= 090000 and EntryTime < 100000 then { SetStopLoss(loss0910,PercentStop); SetStopTrailing(tr0910,0,PercentStop,1); SetStopInactivity(최소가격0910,봉갯수0910,PercentStop); } else if IsEntryName("s1",1) == true and MarketPosition == -1 and EntryTime >= 100000 and EntryTime < 110000 then { SetStopLoss(loss1011,PercentStop); SetStopTrailing(tr1011,0,PercentStop,1); SetStopInactivity(최소가격1011,봉갯수1011,PercentStop); } else if IsEntryName("s1",1) == true and MarketPosition == -1 and EntryTime >= 110000 and EntryTime < 120000 then { SetStopLoss(loss1112,percentStop); SetStopTrailing(tr1112,0,percentStop,1); SetStopInactivity(최소가격1112,봉갯수1112,PercentStop); } else if IsEntryName("s2",1) == true and MarketPosition == -1 and EntryTime >= 100000 and EntryTime < 110000 then { SetStopLoss(s2loss1011,percentStop); SetStopTrailing(s2tr1011,0,percentStop,1); SetStopInactivity(s2최소가격1011,s2봉갯수1011,PercentStop); } else if IsEntryName("s2",1) == true and MarketPosition == -1 and EntryTime >= 110000 and EntryTime < 120000 then { SetStopLoss(s2loss1112,percentStop); SetStopTrailing(s2tr1112,0,percentStop,1); SetStopInactivity(s2최소가격1112,s2봉갯수1112,PercentStop); } Else { SetStopLoss(loss,PercentStop); SetStopTrailing(tr,0,PercentStop,1); SetStopInactivity(최소가격,봉갯수,PercentStop); } }