커뮤니티

오늘의 마지막 수식 부탁해요~~

프로필 이미지
이형지
2019-01-06 16:37:11
157
글번호 125009
답변완료

첨부 이미지

파라볼릭 추세 변환시 진입 후 70틱 수익시 청산하는 식으로 설계를 했는데 그림과 같이 수익 청산후 바로 다음봉에 또 진입하게 되네요... 제가 원하는것은 강세 신호 발생시 진입 후 수익발생 청산후에는 그 신호에는 들어가지 않는 수식이 있나요? 아래 수식으로 진행하는데요... input : af(0.02), maxAF(0.2); input : 익절틱수1(55),익절틱수2(49),손절틱수1(70),손절틱수2(30); var1 = CSar(af,maxAF); #골드가 발생하면 if var1 > C Then { #value1에 봉번호 저장 value1 = index; #value2에 종가 저장 value2 = C; } #데드가 발생하면 If var1 < C Then { #value3에 봉번호 저장 value3 = index; #value4에 종가 저장 value4 = C; } if MarketPosition == 0 and T == 1 and index >= value1 and C > value2 then buy("매수",OnClose,def,1); if MarketPosition == 0 and T == -1 and index >= value3 and C < value4 then Sell("매도",OnClose,def,1); if T == 1 then SetStopProfittarget(PriceScale*익절틱수1, PointStop); SetStopLoss(PriceScale*손절틱수1, PointStop); if T == -1 then SetStopProfittarget(PriceScale*익절틱수2, PointStop); SetStopLoss(PriceScale*손절틱수2, PointStop); if MarketPosition == 1 Then { if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*30 Then ExitLong("본전탈출1",AtStop,EntryPrice+PriceScale*2); Else ExitLong("가슴아픈손절1",AtStop,EntryPrice-PriceScale*100); } if MarketPosition == -1 Then { if Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*30 Then ExitShort("본전탈출2",AtStop,EntryPrice-PriceScale*2); Else ExitShort("가슴찢어지는손절",AtStop,EntryPrice+PriceScale*100); } }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2019-01-07 14:32:07

안녕하세요 예스스탁입니다. 종가와 파라파볼릭과의 골드와 데드로 조건을 주셔야 합니다. 현재 수식은 종가가 파라볼릭보다 크다/작다로 되어 있어 일종의 골드구간/데드구간으로 진입조건이 설정되어 있습니다. input : af(0.02), maxAF(0.2); input : 익절틱수1(55),익절틱수2(49),손절틱수1(70),손절틱수2(30); var1 = CSar(af,maxAF); if MarketPosition == 0 and T == 1 and crossup(c,var1) then buy("매수",OnClose,def,1); if MarketPosition == 0 and T == -1 and CrossDown(c,var1) then Sell("매도",OnClose,def,1); if T == 1 then SetStopProfittarget(PriceScale*익절틱수1, PointStop); SetStopLoss(PriceScale*손절틱수1, PointStop); if T == -1 then SetStopProfittarget(PriceScale*익절틱수2, PointStop); SetStopLoss(PriceScale*손절틱수2, PointStop); if MarketPosition == 1 Then { if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*30 Then ExitLong("본전탈출1",AtStop,EntryPrice+PriceScale*2); Else ExitLong("가슴아픈손절1",AtStop,EntryPrice-PriceScale*100); } if MarketPosition == -1 Then { if Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*30 Then ExitShort("본전탈출2",AtStop,EntryPrice-PriceScale*2); Else ExitShort("가슴찢어지는손절",AtStop,EntryPrice+PriceScale*100); } 즐거운 하루되세요 > 이형지 님이 쓴 글입니다. > 제목 : 오늘의 마지막 수식 부탁해요~~ > 파라볼릭 추세 변환시 진입 후 70틱 수익시 청산하는 식으로 설계를 했는데 그림과 같이 수익 청산후 바로 다음봉에 또 진입하게 되네요... 제가 원하는것은 강세 신호 발생시 진입 후 수익발생 청산후에는 그 신호에는 들어가지 않는 수식이 있나요? 아래 수식으로 진행하는데요... input : af(0.02), maxAF(0.2); input : 익절틱수1(55),익절틱수2(49),손절틱수1(70),손절틱수2(30); var1 = CSar(af,maxAF); #골드가 발생하면 if var1 > C Then { #value1에 봉번호 저장 value1 = index; #value2에 종가 저장 value2 = C; } #데드가 발생하면 If var1 < C Then { #value3에 봉번호 저장 value3 = index; #value4에 종가 저장 value4 = C; } if MarketPosition == 0 and T == 1 and index >= value1 and C > value2 then buy("매수",OnClose,def,1); if MarketPosition == 0 and T == -1 and index >= value3 and C < value4 then Sell("매도",OnClose,def,1); if T == 1 then SetStopProfittarget(PriceScale*익절틱수1, PointStop); SetStopLoss(PriceScale*손절틱수1, PointStop); if T == -1 then SetStopProfittarget(PriceScale*익절틱수2, PointStop); SetStopLoss(PriceScale*손절틱수2, PointStop); if MarketPosition == 1 Then { if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*30 Then ExitLong("본전탈출1",AtStop,EntryPrice+PriceScale*2); Else ExitLong("가슴아픈손절1",AtStop,EntryPrice-PriceScale*100); } if MarketPosition == -1 Then { if Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*30 Then ExitShort("본전탈출2",AtStop,EntryPrice-PriceScale*2); Else ExitShort("가슴찢어지는손절",AtStop,EntryPrice+PriceScale*100); } }