커뮤니티

수정 부탁드립니다.

프로필 이미지
산수유
2024-04-25 16:20:54
1043
글번호 178916
답변완료
{ var2 = Sarv+(AF_value)*(EP-SAR_Value); if MarketPosition == 0 and MarketPosition(1) == 1 and #IsEntryName("b1",1) == true and IsExitName("bx",1) == true and Direction == -1 and CountIf(MC <= 0,BarsSinceExit(1)) < 1 and mc > 0 Then Buy("b2",AtStop,Var2); if MarketPosition == 0 and MarketPosition(1) == -1 and #IsEntryName("s1",1) == true and IsExitName("sx",1) == true and Direction == 1 and CountIf(MC >= 0,BarsSinceExit(1)) < 1 and mc < 0 Then Sell("s2",AtStop,Var2); if MarketPosition == 1 and Direction == 1 Then ExitLong("bx",AtStop,var2); if MarketPosition == -1 and Direction == -1 Then ExitShort("sx",AtStop,var2); } input : 최소수익포인트(20),하락률(10); if MarketPosition == 1 Then { if highest(H,BarsSinceEntry) >= EntryPrice+최소수익포인트 Then ExitLong("bx",AtStop,highest(H,BarsSinceEntry)-(highest(H,BarsSinceEntry)-EntryPrice)*(하락률/100)); } if MarketPosition == -1 Then { if lowest(L,BarsSinceEntry) <= EntryPrice-최소수익포인트 Then ExitShort("sx",AtStop,lowest(L,BarsSinceEntry)+(EntryPrice-lowest(L,BarsSinceEntry))*(하락률/100)); } 위에 처럼 최대수익대비 하락 청산 수식을 만들어 주셔서 기존 수식에 붙여넣어서 검증하니 "bx"와 "SX" 가 이미 선언되어 있습니다. 라고 검증오류가 나오네요... 수정 좀 부탁드립니다.
시스템
답변 2
프로필 이미지

예스스탁 예스스탁 답변

2024-04-26 10:59:34

안녕하세요 예스스탁입니다. 각 청산의 이름은 다른이름을 지정하셔야 합니다. 추가하는 청산식만 이름이 겹치지 않게 다른이름으로 지정해 주시면 됩니다. bx1,sx1로 변경해 드립니다. input : 최소수익포인트(20),하락률(10); if MarketPosition == 1 Then { if highest(H,BarsSinceEntry) >= EntryPrice+최소수익포인트 Then ExitLong("bx1",AtStop,highest(H,BarsSinceEntry)-(highest(H,BarsSinceEntry)-EntryPrice)*(하락률/100)); } if MarketPosition == -1 Then { if lowest(L,BarsSinceEntry) <= EntryPrice-최소수익포인트 Then ExitShort("sx1",AtStop,lowest(L,BarsSinceEntry)+(EntryPrice-lowest(L,BarsSinceEntry))*(하락률/100)); } 즐거운 하루되세요 > 산수유 님이 쓴 글입니다. > 제목 : 수정 부탁드립니다. > { var2 = Sarv+(AF_value)*(EP-SAR_Value); if MarketPosition == 0 and MarketPosition(1) == 1 and #IsEntryName("b1",1) == true and IsExitName("bx",1) == true and Direction == -1 and CountIf(MC <= 0,BarsSinceExit(1)) < 1 and mc > 0 Then Buy("b2",AtStop,Var2); if MarketPosition == 0 and MarketPosition(1) == -1 and #IsEntryName("s1",1) == true and IsExitName("sx",1) == true and Direction == 1 and CountIf(MC >= 0,BarsSinceExit(1)) < 1 and mc < 0 Then Sell("s2",AtStop,Var2); if MarketPosition == 1 and Direction == 1 Then ExitLong("bx",AtStop,var2); if MarketPosition == -1 and Direction == -1 Then ExitShort("sx",AtStop,var2); } input : 최소수익포인트(20),하락률(10); if MarketPosition == 1 Then { if highest(H,BarsSinceEntry) >= EntryPrice+최소수익포인트 Then ExitLong("bx",AtStop,highest(H,BarsSinceEntry)-(highest(H,BarsSinceEntry)-EntryPrice)*(하락률/100)); } if MarketPosition == -1 Then { if lowest(L,BarsSinceEntry) <= EntryPrice-최소수익포인트 Then ExitShort("sx",AtStop,lowest(L,BarsSinceEntry)+(EntryPrice-lowest(L,BarsSinceEntry))*(하락률/100)); } 위에 처럼 최대수익대비 하락 청산 수식을 만들어 주셔서 기존 수식에 붙여넣어서 검증하니 "bx"와 "SX" 가 이미 선언되어 있습니다. 라고 검증오류가 나오네요... 수정 좀 부탁드립니다.
프로필 이미지

산수유

2024-04-26 11:16:14

감사드립니다. > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 수정 부탁드립니다. > 안녕하세요 예스스탁입니다. 각 청산의 이름은 다른이름을 지정하셔야 합니다. 추가하는 청산식만 이름이 겹치지 않게 다른이름으로 지정해 주시면 됩니다. bx1,sx1로 변경해 드립니다. input : 최소수익포인트(20),하락률(10); if MarketPosition == 1 Then { if highest(H,BarsSinceEntry) >= EntryPrice+최소수익포인트 Then ExitLong("bx1",AtStop,highest(H,BarsSinceEntry)-(highest(H,BarsSinceEntry)-EntryPrice)*(하락률/100)); } if MarketPosition == -1 Then { if lowest(L,BarsSinceEntry) <= EntryPrice-최소수익포인트 Then ExitShort("sx1",AtStop,lowest(L,BarsSinceEntry)+(EntryPrice-lowest(L,BarsSinceEntry))*(하락률/100)); } 즐거운 하루되세요 > 산수유 님이 쓴 글입니다. > 제목 : 수정 부탁드립니다. > { var2 = Sarv+(AF_value)*(EP-SAR_Value); if MarketPosition == 0 and MarketPosition(1) == 1 and #IsEntryName("b1",1) == true and IsExitName("bx",1) == true and Direction == -1 and CountIf(MC <= 0,BarsSinceExit(1)) < 1 and mc > 0 Then Buy("b2",AtStop,Var2); if MarketPosition == 0 and MarketPosition(1) == -1 and #IsEntryName("s1",1) == true and IsExitName("sx",1) == true and Direction == 1 and CountIf(MC >= 0,BarsSinceExit(1)) < 1 and mc < 0 Then Sell("s2",AtStop,Var2); if MarketPosition == 1 and Direction == 1 Then ExitLong("bx",AtStop,var2); if MarketPosition == -1 and Direction == -1 Then ExitShort("sx",AtStop,var2); } input : 최소수익포인트(20),하락률(10); if MarketPosition == 1 Then { if highest(H,BarsSinceEntry) >= EntryPrice+최소수익포인트 Then ExitLong("bx",AtStop,highest(H,BarsSinceEntry)-(highest(H,BarsSinceEntry)-EntryPrice)*(하락률/100)); } if MarketPosition == -1 Then { if lowest(L,BarsSinceEntry) <= EntryPrice-최소수익포인트 Then ExitShort("sx",AtStop,lowest(L,BarsSinceEntry)+(EntryPrice-lowest(L,BarsSinceEntry))*(하락률/100)); } 위에 처럼 최대수익대비 하락 청산 수식을 만들어 주셔서 기존 수식에 붙여넣어서 검증하니 "bx"와 "SX" 가 이미 선언되어 있습니다. 라고 검증오류가 나오네요... 수정 좀 부탁드립니다.