커뮤니티

행복; 수식 작성 바랍니다

프로필 이미지
행복한가방
2014-02-18 02:02:00
165
글번호 72653
답변완료
한국의 금융산업 발전을 위해 불철주야 애쓰시는 귀하의 노고를 높이 평가합니다 질문 드립니다 수식작성 Q&A 34977 에 대한 답변 < 아래 > 와 관련된 질문입니다 < 아래 > 중에서 ( 궁금한 부분 1 ) 과 ( 궁금한 부분 2 )에 대한 질문입니다 ----------------- ----------------- < 질문1 > ; ( 궁금한 부분 2 )이 있어야 하는 이유는 무엇인가요? < 질문2 > ; ( 궁금한 부분 1 )에서 and Condition1 == false Then{ Condition1 = true; 은 무슨 뜻인가요? ==================== < 아래 > ============================ If Date == 20140206 Then { IF MarketPosition == 0 and stime < 112000 Then { buy("b1x",AtStop,dayopen*(1+0.25/100),10); } If MarketPosition == 1 and stime < 112000 Then { If MaxContracts == CurrentContracts Then{ if CurrentContracts == 10 Then buy("b2x",AtStop,dayopen*(1+0.50/100),10); If CurrentContracts == 20 Then buy("b3x",AtStop,dayopen*(1+0.75/100),10); If CurrentContracts == 30 Then buy("b4x",AtStop,dayopen*(1+1.00/100),10); If CurrentContracts == 40 Then buy("b5x",AtStop,dayopen*(1+1.25/100),10); } if CurrentContracts == 50 Then ExitLong("el5_1x",AtStop,dayopen*(1+1.00/100),"",10,1); if CurrentContracts == 40 Then ExitLong("el5_2x",AtStop,dayopen*(1+0.75/100),"",10,1); if CurrentContracts == 30 Then ExitLong("el5_3x",AtStop,dayopen*(1+0.50/100),"",10,1); if CurrentContracts == 20 Then ExitLong("el5_4x",AtStop,dayopen*(1+0.25/100),"",10,1); if CurrentContracts == 10 Then ExitLong("el5_5x",AtStop,dayopen,"",10,1); } ( 궁금한 부분 1 ) ----------------- If MarketPosition == 1 and stime >= 112000 Then { if stime > 112000 and Condition1 == false Then{ Condition1 = true; ExitLong("b분할1",OnClose,def,"",Int(CurrentContracts*(1/3)),1); } if stime > 130000 and Condition2 == false Then{ Condition2 = true; ExitLong("b분할2",OnClose,def,"",Int(CurrentContracts*(1/2)),1); } if stime > 145000 and Condition3 == false Then { Condition3 = true; ExitLong("b분할3"); } } } ( 궁금한 부분 2 ) ----------------- if MarketPosition != 1 Then{ Condition1 = false; Condition2 = False; Condition3 = false; } =============================================================== 수고하십시요^^
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2014-02-18 13:35:40

안녕하세요 예스스탁입니다. condition1만 예로 설명드리면 condition1은 매수에 들어가기 전에는 false입니다. 매수에 들어간 이후에 지정한 시간이 되면 false인 상태에서 true로 변경을 하게 되는데 이렇게 작성한 이유는 하나의 청산함수는 진입(CurrentEntries)의 횟수만큼 발동을 합니다. 그러므로 지정된 시간을 청산하는데 진입(CurrentEntries)이 3번이면 3번 발동하므로 한번만 발동하게 하기 위해서 condition1과 같은 조건을 주어 제어를 한것입니다. 즐거운 하루되세요 > 행복한가방 님이 쓴 글입니다. > 제목 : 행복; 수식 작성 바랍니다 > 한국의 금융산업 발전을 위해 불철주야 애쓰시는 귀하의 노고를 높이 평가합니다 질문 드립니다 수식작성 Q&A 34977 에 대한 답변 < 아래 > 와 관련된 질문입니다 < 아래 > 중에서 ( 궁금한 부분 1 ) 과 ( 궁금한 부분 2 )에 대한 질문입니다 ----------------- ----------------- < 질문1 > ; ( 궁금한 부분 2 )이 있어야 하는 이유는 무엇인가요? < 질문2 > ; ( 궁금한 부분 1 )에서 and Condition1 == false Then{ Condition1 = true; 은 무슨 뜻인가요? ==================== < 아래 > ============================ If Date == 20140206 Then { IF MarketPosition == 0 and stime < 112000 Then { buy("b1x",AtStop,dayopen*(1+0.25/100),10); } If MarketPosition == 1 and stime < 112000 Then { If MaxContracts == CurrentContracts Then{ if CurrentContracts == 10 Then buy("b2x",AtStop,dayopen*(1+0.50/100),10); If CurrentContracts == 20 Then buy("b3x",AtStop,dayopen*(1+0.75/100),10); If CurrentContracts == 30 Then buy("b4x",AtStop,dayopen*(1+1.00/100),10); If CurrentContracts == 40 Then buy("b5x",AtStop,dayopen*(1+1.25/100),10); } if CurrentContracts == 50 Then ExitLong("el5_1x",AtStop,dayopen*(1+1.00/100),"",10,1); if CurrentContracts == 40 Then ExitLong("el5_2x",AtStop,dayopen*(1+0.75/100),"",10,1); if CurrentContracts == 30 Then ExitLong("el5_3x",AtStop,dayopen*(1+0.50/100),"",10,1); if CurrentContracts == 20 Then ExitLong("el5_4x",AtStop,dayopen*(1+0.25/100),"",10,1); if CurrentContracts == 10 Then ExitLong("el5_5x",AtStop,dayopen,"",10,1); } ( 궁금한 부분 1 ) ----------------- If MarketPosition == 1 and stime >= 112000 Then { if stime > 112000 and Condition1 == false Then{ Condition1 = true; ExitLong("b분할1",OnClose,def,"",Int(CurrentContracts*(1/3)),1); } if stime > 130000 and Condition2 == false Then{ Condition2 = true; ExitLong("b분할2",OnClose,def,"",Int(CurrentContracts*(1/2)),1); } if stime > 145000 and Condition3 == false Then { Condition3 = true; ExitLong("b분할3"); } } } ( 궁금한 부분 2 ) ----------------- if MarketPosition != 1 Then{ Condition1 = false; Condition2 = False; Condition3 = false; } =============================================================== 수고하십시요^^