커뮤니티

수정부탁드립니다

프로필 이미지
코퍼
2021-02-01 00:54:30
623
글번호 145974
답변완료
친절한 설명에 감사드립니다 손익절1과 2가 서로 간섭을 안일으키게 수정 부탁드립니다~~~ input : 손절1(0),익절1(0),손절2(0),익절2(0); var : entry(0); if Bdate != bdate[1] Then entry = 0; if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then entry = entry+1; if MarketPosition == 0 and entry < 1 and H < dayopen+40 Then { buy("b1",Atstop,dayopen+40); SetStopLoss(손절1,PointStop); SetStopProfittarget(익절1,PointStop); } if MarketPosition == 0 and entry < 1 and L > dayopen-50 Then { buy("b",Atlimit,dayopen-50); SetStopLoss(손절2,PointStop); SetStopProfittarget(익절2,PointStop); }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2021-02-01 13:46:39

안녕하세요 예스스탁입니다. set으로 시작되는 강제청삼함수는 한번 셋팅이 되면 다음 다시 셋팅될때가지 그 설정값이 유지가 됩니다. 진입명별로 따로 설정하시려면 아래와 같이 풀어서 손익절을 설정하셔야 합니다. input : 손절1(0),익절1(0),손절2(0),익절2(0); var : entry(0); if Bdate != bdate[1] Then entry = 0; if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then entry = entry+1; if MarketPosition == 0 and entry < 1 and H < dayopen+40 Then { buy("b1",Atstop,dayopen+40); } if MarketPosition == 0 and entry < 1 and L > dayopen-50 Then { buy("b",Atlimit,dayopen-50); } if MarketPosition == 1 Then { exitlong("Bp1",AtLimit,EntryPrice+익절1,"b1"); exitlong("Bl1",AtStop,EntryPrice-손절1,"b1"); exitlong("Bp2",AtLimit,EntryPrice+익절2,"b"); exitlong("Bl2",AtStop,EntryPrice-손절2,"b"); } 즐거운 하루되세요 > 코퍼 님이 쓴 글입니다. > 제목 : 수정부탁드립니다 > 친절한 설명에 감사드립니다 손익절1과 2가 서로 간섭을 안일으키게 수정 부탁드립니다~~~ input : 손절1(0),익절1(0),손절2(0),익절2(0); var : entry(0); if Bdate != bdate[1] Then entry = 0; if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then entry = entry+1; if MarketPosition == 0 and entry < 1 and H < dayopen+40 Then { buy("b1",Atstop,dayopen+40); SetStopLoss(손절1,PointStop); SetStopProfittarget(익절1,PointStop); } if MarketPosition == 0 and entry < 1 and L > dayopen-50 Then { buy("b",Atlimit,dayopen-50); SetStopLoss(손절2,PointStop); SetStopProfittarget(익절2,PointStop); }