커뮤니티

강조 드립니다.

프로필 이미지
요타
2019-06-10 07:31:50
324
글번호 129271
답변완료
* 많은 도움에 고맙습니다. ## 두개를 한개로 묶을수는 없나요? OR을 이용해보지만 잘안되네요... 8틱 이상수익이었다가 하락하면 3틱에서 청산 8틱보다 크고 15틱 이상 수익이었다가 하락하면 9틱에서 청산 if MarketPosition == 1 Then {if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*8 Then ExitLong("bb1",AtStop,EntryPrice+PriceScale*3);} if MarketPosition == 1 Then {if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*15 Then ExitLong("bb2",AtStop,EntryPrice+PriceScale*9);} * 고맙습니다.
강조
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2019-06-10 08:50:43

안녕하세요 예스스탁입니다. 하나의 exitlong함수로 이용하고자 하시면 아래와 같이 수정하셔야 합니다. if MarketPosition == 1 Then { if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*8 Then var1 = EntryPrice+PriceScale*3; else if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*15 Then var1 = EntryPrice+PriceScale*9; Else var1 = 0; if var1 > 0 Then ExitLong("bb1",AtStop,var1); } 즐거운 하루되세요 > 요타 님이 쓴 글입니다. > 제목 : 강조 드립니다. > * 많은 도움에 고맙습니다. ## 두개를 한개로 묶을수는 없나요? OR을 이용해보지만 잘안되네요... 8틱 이상수익이었다가 하락하면 3틱에서 청산 8틱보다 크고 15틱 이상 수익이었다가 하락하면 9틱에서 청산 if MarketPosition == 1 Then {if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*8 Then ExitLong("bb1",AtStop,EntryPrice+PriceScale*3);} if MarketPosition == 1 Then {if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*15 Then ExitLong("bb2",AtStop,EntryPrice+PriceScale*9);} * 고맙습니다.