커뮤니티

감사합니다....복받으실꺼에요~~~

프로필 이미지
하늘북
2021-02-25 17:12:04
952
글번호 146648
답변완료
안녕하세요? 늘 감사합니다. 문의 드립니다. 1. 아래 수식중 진입신호에 의해 진입된후 청산식에서 다음봉이 진행중일 때 강제 청산처럼 바로 해당비율로 청산되는 식으로 변경 부탁드립니다. 지금상태는 진입후 다음봉이 완성되고, 다음 봉에서 청산됩니다. 해서 수익이 발생해도 봉이 완성되지 않아 손실로 마무리 되는 경우가 있습니다. 고맙습니다. 2. 1일 1회로 진입제한이 되어 있는데, 전략에 보여지는 봉수(300) 안에 24일날 진입청산이 되어 있으면 25일 진입을 하지 않습니다. 그렇다고 전략의 봉의 갯수를 줄이면 전일 종가가 전략에 표시되지않아 다른곳에서 진입을 합니다. 해결 방법이 없을까요? var: T1(0),ENTRY(0); if Bdate != Bdate[1]Then T1 = TotalTrades[1]; if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = TotalTrades-T1+1; //////////////////////////////////////////// Input : shortPeriod(5), longPeriod(20); value1 = ma(C, shortPeriod); value2 = ma(C, longPeriod); if DayOpen >= DayClose(1) and Value1 < c Then { if entry < 1 Then Buy("매수"); Else ExitShort(); } # 매도청산 If CrossDown(c , value1) Then { if entry < 1 Then Sell("매도"); Else ExitLong(); } if MarketPosition == 1 Then { ExitLong("bx1",AtStop,EntryPrice*1.03,"",Floor(MaxContracts*0.25),1); ExitLong("bx2",AtStop,EntryPrice*1.04,"",Floor(MaxContracts*0.25),1); ExitLong("bx3",AtStop,EntryPrice*1.05,"",Floor(MaxContracts*0.25),1); ExitLong("bx4",AtStop,EntryPrice*1.06,"",Floor(MaxContracts*0.25),1); ExitLong("bx5",AtStop,EntryPrice*1.07); if Highest(H,BarsSinceEntry) >= EntryPrice*1.01 Then ExitLong("bx",AtStop,Highest(H,BarsSinceEntry)*0.96); }
시스템
답변 2
프로필 이미지

예스스탁 예스스탁 답변

2021-02-26 10:46:18

안녕하세요 예스스탁입니다. 진입봉 다음봉에서 익절이 발동하기 위해서는 진입봉에서 같이 셋팅이 되어야 하는데 포지션 함수가 진입 후 하나의 봉이 완성되어야 해당 진입의 값으로 변경리턴이 되어 진입수량이 진입봉에서 알수 없습니다. 수식안에서 수량을 직접 지정해 주셔야 수식안에서 분할로 같이 셋팅되게 할수 있습니다. 진입수량을 금액으로 지정하시면 1번식을 수량이면 2번식을 사용하시면 됩니다. 당일진입횟수 체크를 진입신호발동기준으로 변경해 드립니다. 기존식은 이전일에 발생해 당일로 오버된 경우는 진입이 1회로 체크가 됩니다. 1 input : 금액(10000000); var: T1(0),ENTRY(0),vol(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; //////////////////////////////////////////// Input : shortPeriod(5), longPeriod(20); value1 = ma(C, shortPeriod); value2 = ma(C, longPeriod); if DayOpen >= DayClose(1) and Value1 < c Then { if entry < 1 Then { vol = Floor(금액/C); Buy("매수",OnClose,DEF,vol); ExitLong("bx1.",AtLimit,C*1.03,"",Floor(vol*0.25),1); ExitLong("bx2.",AtLimit,C*1.04,"",Floor(vol*0.25),1); ExitLong("bx3.",AtLimit,C*1.05,"",Floor(vol*0.25),1); ExitLong("bx4.",AtLimit,C*1.06,"",Floor(vol*0.25),1); ExitLong("bx5.",AtLimit,C*1.07); } Else ExitShort(); } # 매도청산 If CrossDown(c , value1) Then { if entry < 1 Then Sell("매도"); Else ExitLong(); } if MarketPosition == 1 Then { ExitLong("bx1",AtLimit,EntryPrice*1.03,"",Floor(MaxContracts*0.25),1); ExitLong("bx2",AtLimit,EntryPrice*1.04,"",Floor(MaxContracts*0.25),1); ExitLong("bx3",AtLimit,EntryPrice*1.05,"",Floor(MaxContracts*0.25),1); ExitLong("bx4",AtLimit,EntryPrice*1.06,"",Floor(MaxContracts*0.25),1); ExitLong("bx5",AtLimit,EntryPrice*1.07); if Highest(H,BarsSinceEntry) >= EntryPrice*1.01 Then ExitLong("bx",AtStop,Highest(H,BarsSinceEntry)*0.96); } 2 input : 수량(100); var: T1(0),ENTRY(0),vol(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; //////////////////////////////////////////// Input : shortPeriod(5), longPeriod(20); value1 = ma(C, shortPeriod); value2 = ma(C, longPeriod); if DayOpen >= DayClose(1) and Value1 < c Then { if entry < 1 Then { vol = 수량; Buy("매수",OnClose,DEF,vol); ExitLong("bx1.",AtLimit,C*1.03,"",Floor(vol*0.25),1); ExitLong("bx2.",AtLimit,C*1.04,"",Floor(vol*0.25),1); ExitLong("bx3.",AtLimit,C*1.05,"",Floor(vol*0.25),1); ExitLong("bx4.",AtLimit,C*1.06,"",Floor(vol*0.25),1); ExitLong("bx5.",AtLimit,C*1.07); } Else ExitShort(); } # 매도청산 If CrossDown(c , value1) Then { if entry < 1 Then Sell("매도"); Else ExitLong(); } if MarketPosition == 1 Then { ExitLong("bx1",AtLimit,EntryPrice*1.03,"",Floor(MaxContracts*0.25),1); ExitLong("bx2",AtLimit,EntryPrice*1.04,"",Floor(MaxContracts*0.25),1); ExitLong("bx3",AtLimit,EntryPrice*1.05,"",Floor(MaxContracts*0.25),1); ExitLong("bx4",AtLimit,EntryPrice*1.06,"",Floor(MaxContracts*0.25),1); ExitLong("bx5",AtLimit,EntryPrice*1.07); if Highest(H,BarsSinceEntry) >= EntryPrice*1.01 Then ExitLong("bx",AtStop,Highest(H,BarsSinceEntry)*0.96); } 즐거운 하루되세요 > 하늘북 님이 쓴 글입니다. > 제목 : 감사합니다....복받으실꺼에요~~~ > 안녕하세요? 늘 감사합니다. 문의 드립니다. 1. 아래 수식중 진입신호에 의해 진입된후 청산식에서 다음봉이 진행중일 때 강제 청산처럼 바로 해당비율로 청산되는 식으로 변경 부탁드립니다. 지금상태는 진입후 다음봉이 완성되고, 다음 봉에서 청산됩니다. 해서 수익이 발생해도 봉이 완성되지 않아 손실로 마무리 되는 경우가 있습니다. 고맙습니다. 2. 1일 1회로 진입제한이 되어 있는데, 전략에 보여지는 봉수(300) 안에 24일날 진입청산이 되어 있으면 25일 진입을 하지 않습니다. 그렇다고 전략의 봉의 갯수를 줄이면 전일 종가가 전략에 표시되지않아 다른곳에서 진입을 합니다. 해결 방법이 없을까요? var: T1(0),ENTRY(0); if Bdate != Bdate[1]Then T1 = TotalTrades[1]; if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = TotalTrades-T1+1; //////////////////////////////////////////// Input : shortPeriod(5), longPeriod(20); value1 = ma(C, shortPeriod); value2 = ma(C, longPeriod); if DayOpen >= DayClose(1) and Value1 < c Then { if entry < 1 Then Buy("매수"); Else ExitShort(); } # 매도청산 If CrossDown(c , value1) Then { if entry < 1 Then Sell("매도"); Else ExitLong(); } if MarketPosition == 1 Then { ExitLong("bx1",AtStop,EntryPrice*1.03,"",Floor(MaxContracts*0.25),1); ExitLong("bx2",AtStop,EntryPrice*1.04,"",Floor(MaxContracts*0.25),1); ExitLong("bx3",AtStop,EntryPrice*1.05,"",Floor(MaxContracts*0.25),1); ExitLong("bx4",AtStop,EntryPrice*1.06,"",Floor(MaxContracts*0.25),1); ExitLong("bx5",AtStop,EntryPrice*1.07); if Highest(H,BarsSinceEntry) >= EntryPrice*1.01 Then ExitLong("bx",AtStop,Highest(H,BarsSinceEntry)*0.96); }
프로필 이미지

하늘북

2021-02-26 13:02:44

감사합니다~~~^.^ > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 감사합니다....복받으실꺼에요~~~ > 안녕하세요 예스스탁입니다. 진입봉 다음봉에서 익절이 발동하기 위해서는 진입봉에서 같이 셋팅이 되어야 하는데 포지션 함수가 진입 후 하나의 봉이 완성되어야 해당 진입의 값으로 변경리턴이 되어 진입수량이 진입봉에서 알수 없습니다. 수식안에서 수량을 직접 지정해 주셔야 수식안에서 분할로 같이 셋팅되게 할수 있습니다. 진입수량을 금액으로 지정하시면 1번식을 수량이면 2번식을 사용하시면 됩니다. 당일진입횟수 체크를 진입신호발동기준으로 변경해 드립니다. 기존식은 이전일에 발생해 당일로 오버된 경우는 진입이 1회로 체크가 됩니다. 1 input : 금액(10000000); var: T1(0),ENTRY(0),vol(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; //////////////////////////////////////////// Input : shortPeriod(5), longPeriod(20); value1 = ma(C, shortPeriod); value2 = ma(C, longPeriod); if DayOpen >= DayClose(1) and Value1 < c Then { if entry < 1 Then { vol = Floor(금액/C); Buy("매수",OnClose,DEF,vol); ExitLong("bx1.",AtLimit,C*1.03,"",Floor(vol*0.25),1); ExitLong("bx2.",AtLimit,C*1.04,"",Floor(vol*0.25),1); ExitLong("bx3.",AtLimit,C*1.05,"",Floor(vol*0.25),1); ExitLong("bx4.",AtLimit,C*1.06,"",Floor(vol*0.25),1); ExitLong("bx5.",AtLimit,C*1.07); } Else ExitShort(); } # 매도청산 If CrossDown(c , value1) Then { if entry < 1 Then Sell("매도"); Else ExitLong(); } if MarketPosition == 1 Then { ExitLong("bx1",AtLimit,EntryPrice*1.03,"",Floor(MaxContracts*0.25),1); ExitLong("bx2",AtLimit,EntryPrice*1.04,"",Floor(MaxContracts*0.25),1); ExitLong("bx3",AtLimit,EntryPrice*1.05,"",Floor(MaxContracts*0.25),1); ExitLong("bx4",AtLimit,EntryPrice*1.06,"",Floor(MaxContracts*0.25),1); ExitLong("bx5",AtLimit,EntryPrice*1.07); if Highest(H,BarsSinceEntry) >= EntryPrice*1.01 Then ExitLong("bx",AtStop,Highest(H,BarsSinceEntry)*0.96); } 2 input : 수량(100); var: T1(0),ENTRY(0),vol(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; //////////////////////////////////////////// Input : shortPeriod(5), longPeriod(20); value1 = ma(C, shortPeriod); value2 = ma(C, longPeriod); if DayOpen >= DayClose(1) and Value1 < c Then { if entry < 1 Then { vol = 수량; Buy("매수",OnClose,DEF,vol); ExitLong("bx1.",AtLimit,C*1.03,"",Floor(vol*0.25),1); ExitLong("bx2.",AtLimit,C*1.04,"",Floor(vol*0.25),1); ExitLong("bx3.",AtLimit,C*1.05,"",Floor(vol*0.25),1); ExitLong("bx4.",AtLimit,C*1.06,"",Floor(vol*0.25),1); ExitLong("bx5.",AtLimit,C*1.07); } Else ExitShort(); } # 매도청산 If CrossDown(c , value1) Then { if entry < 1 Then Sell("매도"); Else ExitLong(); } if MarketPosition == 1 Then { ExitLong("bx1",AtLimit,EntryPrice*1.03,"",Floor(MaxContracts*0.25),1); ExitLong("bx2",AtLimit,EntryPrice*1.04,"",Floor(MaxContracts*0.25),1); ExitLong("bx3",AtLimit,EntryPrice*1.05,"",Floor(MaxContracts*0.25),1); ExitLong("bx4",AtLimit,EntryPrice*1.06,"",Floor(MaxContracts*0.25),1); ExitLong("bx5",AtLimit,EntryPrice*1.07); if Highest(H,BarsSinceEntry) >= EntryPrice*1.01 Then ExitLong("bx",AtStop,Highest(H,BarsSinceEntry)*0.96); } 즐거운 하루되세요 > 하늘북 님이 쓴 글입니다. > 제목 : 감사합니다....복받으실꺼에요~~~ > 안녕하세요? 늘 감사합니다. 문의 드립니다. 1. 아래 수식중 진입신호에 의해 진입된후 청산식에서 다음봉이 진행중일 때 강제 청산처럼 바로 해당비율로 청산되는 식으로 변경 부탁드립니다. 지금상태는 진입후 다음봉이 완성되고, 다음 봉에서 청산됩니다. 해서 수익이 발생해도 봉이 완성되지 않아 손실로 마무리 되는 경우가 있습니다. 고맙습니다. 2. 1일 1회로 진입제한이 되어 있는데, 전략에 보여지는 봉수(300) 안에 24일날 진입청산이 되어 있으면 25일 진입을 하지 않습니다. 그렇다고 전략의 봉의 갯수를 줄이면 전일 종가가 전략에 표시되지않아 다른곳에서 진입을 합니다. 해결 방법이 없을까요? var: T1(0),ENTRY(0); if Bdate != Bdate[1]Then T1 = TotalTrades[1]; if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = TotalTrades-T1+1; //////////////////////////////////////////// Input : shortPeriod(5), longPeriod(20); value1 = ma(C, shortPeriod); value2 = ma(C, longPeriod); if DayOpen >= DayClose(1) and Value1 < c Then { if entry < 1 Then Buy("매수"); Else ExitShort(); } # 매도청산 If CrossDown(c , value1) Then { if entry < 1 Then Sell("매도"); Else ExitLong(); } if MarketPosition == 1 Then { ExitLong("bx1",AtStop,EntryPrice*1.03,"",Floor(MaxContracts*0.25),1); ExitLong("bx2",AtStop,EntryPrice*1.04,"",Floor(MaxContracts*0.25),1); ExitLong("bx3",AtStop,EntryPrice*1.05,"",Floor(MaxContracts*0.25),1); ExitLong("bx4",AtStop,EntryPrice*1.06,"",Floor(MaxContracts*0.25),1); ExitLong("bx5",AtStop,EntryPrice*1.07); if Highest(H,BarsSinceEntry) >= EntryPrice*1.01 Then ExitLong("bx",AtStop,Highest(H,BarsSinceEntry)*0.96); }