커뮤니티

3단 지그재그 청산 수식 요청 좀 부탁 드립니다.

프로필 이미지
요타
2019-08-07 10:50:39
307
글번호 130979
답변완료
* 많은 도움에 정말 고맙습니다. * 3단 지그재그 청산 로직 작성 좀 부탁 드립니다. var1 = ma(c,5) ; var2 = ma(c,20) ; if CrossUp(var1,var2) then buy("매수") ; if CrossDown(var1,var2) then sell("매도") ; 일경우 .매수 후 30틱 수익 나면 청산명 "스위칭1" 완전 청산(ExitLong,ExitShort) 청산명이 "스위칭1" 이고 수익이 20틱 이면 "스위칭33" 으로 청산 청산명이 "스위칭1" 이고 손실이 20틱 이면 "스위칭44" 으로 청산 청산명이 "스위칭33" 이고 수익이 20틱 이면 "스위칭55" 으로 청산 청산명이 "스위칭33" 이고 손실이 20틱 이면 "스위칭66" 으로 청산 청산명이 "스위칭55" 이고 수익이 20틱 이면 완전 청산 청산명이 "스위칭66" 이고 손실이 20틱 이면 완전 청산 청산명이 "스위칭44" 이고 수익이 20틱 이면 "스위칭77" 으로 청산 청산명이 "스위칭44" 이고 손실이 20틱 이면 "스위칭88" 으로 청산 청산명이 "스위칭77" 이고 수익이 20틱 이면 완전 청산 청산명이 "스위칭88" 이고 손실이 20틱 이면 완전 청산 ######## 자작 연습용 잘안되네요...... -.- ## 수익경우 if MarketPosition== 1 and IsEntryName("매수") == true then{ ExitLong("aaa",AtLimit,EntryPrice+PriceScale*32); } ## 30틱 수익 실현 if MarketPosition==-1 and IsEntryName("매도") == true then{ ExitShort("bbb",AtLimit,EntryPrice-PriceScale*32); } ## 30틱 수익 실현 ## 수익 스위칭 if MarketPosition== 1 and IsEntryName("aaa") == true then{ sell("스위칭1",AtLimit,EntryPrice+PriceScale*12); } ## 스위칭후 10틱 이익 실현 if MarketPosition==-1 and IsEntryName("bbb") == true then{ Buy("스위칭2",AtLimit,EntryPrice-PriceScale*12); } ## 스위칭후 10틱 이익 실현 ## 손실경우 if MarketPosition== 1 and IsEntryName("매수") == true then{ sell("스위칭33",AtLimit,EntryPrice-PriceScale*20); } ## 매수후 20틱 손실이면 스위칭 if MarketPosition==-1 and IsEntryName("매도") == true then{ Buy("스위칭44",AtLimit,EntryPrice+PriceScale*20); } ## 매도후 20틱 손실이면 스위칭 ## 손실 스위칭 if MarketPosition== 1 and IsEntryName("스위칭33") == true then{ ExitLong("스위칭33청산",AtLimit,EntryPrice+PriceScale*20); } ## 스위칭후 20틱 이익이면 청산 if MarketPosition==-1 and IsEntryName("스위칭44") == true then{ ExitShort("스위칭44청산",AtLimit,EntryPrice-PriceScale*12); } ## 스위칭후 20틱 이익이면 청산 * 잘 안되네요.....항상 고맙습니다.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2019-08-07 11:25:48

안녕하세요 예스스탁입니다. 진입이 하나이면 청산식에 진입명이 필요가 없습니다. 진입명은 동일진입이 여러개 이고 각 진입별로 구분해서 청산할때만 사용하시면 됩니다. var1 = ma(c,5) ; var2 = ma(c,20) ; if CrossUp(var1,var2) then buy("매수") ; if CrossDown(var1,var2) then sell("매도") ; if MarketPosition == 1 then { sell("b스위칭1",AtLimit,EntryPrice+PriceScale*30); if IsExitName("b스위칭1",1) == true Then { ExitLong("b스위칭33",atlimit,EntryPrice+PriceScale*20); ExitLong("b스위칭44",AtStop,EntryPrice-PriceScale*20); } if IsExitName("b스위칭33",1) == true Then { ExitLong("b스위칭55",atlimit,EntryPrice+PriceScale*20); ExitLong("b스위칭66",AtStop,EntryPrice-PriceScale*20); } if IsExitName("b스위칭55",1) == true Then ExitLong("bp1",atlimit,EntryPrice+PriceScale*20); if IsExitName("b스위칭66",1) == true Then ExitLong("bl1",AtStop,EntryPrice-PriceScale*20); if IsExitName("스위칭44",1) == true Then { ExitLong("b스위칭77",atlimit,EntryPrice+PriceScale*20); ExitLong("b스위칭88",AtStop,EntryPrice-PriceScale*20); } if IsExitName("b스위칭77",1) == true Then ExitLong("bp2",atlimit,EntryPrice+PriceScale*20); if IsExitName("b스위칭88",1) == true Then ExitLong("bl2",AtStop,EntryPrice-PriceScale*20); } if MarketPosition == -1 then { Buy("s스위칭1",AtLimit,EntryPrice-PriceScale*30); if IsExitName("s스위칭1",1) == true Then { ExitShort("s스위칭33",atlimit,EntryPrice-PriceScale*20); ExitShort("s스위칭44",AtStop,EntryPrice+PriceScale*20); } if IsExitName("s스위칭33",1) == true Then { ExitShort("s스위칭55",atlimit,EntryPrice-PriceScale*20); ExitShort("s스위칭66",AtStop,EntryPrice+PriceScale*20); } if IsExitName("s스위칭55",1) == true Then ExitShort("sp1",atlimit,EntryPrice-PriceScale*20); if IsExitName("s스위칭66",1) == true Then ExitShort("sl1",AtStop,EntryPrice+PriceScale*20); if IsExitName("스위칭44",1) == true Then { ExitShort("s스위칭77",atlimit,EntryPrice-PriceScale*20); ExitShort("s스위칭88",AtStop,EntryPrice+PriceScale*20); } if IsExitName("s스위칭77",1) == true Then ExitShort("sp2",atlimit,EntryPrice-PriceScale*20); if IsExitName("s스위칭88",1) == true Then ExitShort("sl2",AtStop,EntryPrice+PriceScale*20); } 즐거운 하루되세요 > 요타 님이 쓴 글입니다. > 제목 : 3단 지그재그 청산 수식 요청 좀 부탁 드립니다. > * 많은 도움에 정말 고맙습니다. * 3단 지그재그 청산 로직 작성 좀 부탁 드립니다. var1 = ma(c,5) ; var2 = ma(c,20) ; if CrossUp(var1,var2) then buy("매수") ; if CrossDown(var1,var2) then sell("매도") ; 일경우 .매수 후 30틱 수익 나면 청산명 "스위칭1" 완전 청산(ExitLong,ExitShort) 청산명이 "스위칭1" 이고 수익이 20틱 이면 "스위칭33" 으로 청산 청산명이 "스위칭1" 이고 손실이 20틱 이면 "스위칭44" 으로 청산 청산명이 "스위칭33" 이고 수익이 20틱 이면 "스위칭55" 으로 청산 청산명이 "스위칭33" 이고 손실이 20틱 이면 "스위칭66" 으로 청산 청산명이 "스위칭55" 이고 수익이 20틱 이면 완전 청산 청산명이 "스위칭66" 이고 손실이 20틱 이면 완전 청산 청산명이 "스위칭44" 이고 수익이 20틱 이면 "스위칭77" 으로 청산 청산명이 "스위칭44" 이고 손실이 20틱 이면 "스위칭88" 으로 청산 청산명이 "스위칭77" 이고 수익이 20틱 이면 완전 청산 청산명이 "스위칭88" 이고 손실이 20틱 이면 완전 청산 ######## 자작 연습용 잘안되네요...... -.- ## 수익경우 if MarketPosition== 1 and IsEntryName("매수") == true then{ ExitLong("aaa",AtLimit,EntryPrice+PriceScale*32); } ## 30틱 수익 실현 if MarketPosition==-1 and IsEntryName("매도") == true then{ ExitShort("bbb",AtLimit,EntryPrice-PriceScale*32); } ## 30틱 수익 실현 ## 수익 스위칭 if MarketPosition== 1 and IsEntryName("aaa") == true then{ sell("스위칭1",AtLimit,EntryPrice+PriceScale*12); } ## 스위칭후 10틱 이익 실현 if MarketPosition==-1 and IsEntryName("bbb") == true then{ Buy("스위칭2",AtLimit,EntryPrice-PriceScale*12); } ## 스위칭후 10틱 이익 실현 ## 손실경우 if MarketPosition== 1 and IsEntryName("매수") == true then{ sell("스위칭33",AtLimit,EntryPrice-PriceScale*20); } ## 매수후 20틱 손실이면 스위칭 if MarketPosition==-1 and IsEntryName("매도") == true then{ Buy("스위칭44",AtLimit,EntryPrice+PriceScale*20); } ## 매도후 20틱 손실이면 스위칭 ## 손실 스위칭 if MarketPosition== 1 and IsEntryName("스위칭33") == true then{ ExitLong("스위칭33청산",AtLimit,EntryPrice+PriceScale*20); } ## 스위칭후 20틱 이익이면 청산 if MarketPosition==-1 and IsEntryName("스위칭44") == true then{ ExitShort("스위칭44청산",AtLimit,EntryPrice-PriceScale*12); } ## 스위칭후 20틱 이익이면 청산 * 잘 안되네요.....항상 고맙습니다.