Input : period11(5), period12(3), period13(3), term1(20); var : idx11(0), idx12(0), idx21(0), idx22(0), idx31(0), idx32(0), idx41(0), idx42(0); var : sVar11("N"), sVar12("N"), sVar21("N"), sVar22("N"), sVar31("N"), sVar32("N"), sVar41("N"), sVar42("N"); var : lSw(0), hSw(0), step1(0), step2(0), step3(0), step4(0), pass1(0), pass2(0), pass3(0), pass4(0); var : lowsAmt1(0), lowsAmt2(0), lowsBar1(0), lowsBar2(0), highAmt1(0), highAmt2(0), highBar1(0), highBar2(0); Condition99 = false; //- 5. 3. 3 ½ºÅäij½ºÆ½ ½Ö¹Ù´Ú°Ë»ö ½ÃÀÛ--------------------------------------------------------------------------------------- pass1 = 0; idx11 = 0; idx12 = term1; sVar11 = "N"; sVar12 = "N"; value11 = StochasticsK(period11, period12); value12 = StochasticsD(period11, period12, period13); lSw = 0; hSw = 0; highAmt1 = 0; highAmt2 = 0; highBar1 = 0; highBar2 = 0; lowsAmt1 = 0; lowsAmt2 = 0; lowsBar1 = 0; lowsBar2 = 0; For idx11 = 0 to idx12 step 1 { If idx11 == 0 Then { If value11[idx11] > value11[idx11+1] Then { lowsAmt1 = value11[idx11+1]; lowsBar1 = idx11+1; lSw = 1; // Messagelog("101:::: :À妽º-> %.f :K°ª0-> %.3f : K°ª1-> %.3f :ÃÖ¼Ò°ª1-> %.3f : ÃÖ¼Ò°ª2-> %.3f :ÃÖ¼ÒºÀ1-> %.f : ÃÖ¼ÒºÀ2-> %.f :ÃÖ´ë°ª1-> %.3f : ÃÖ´ë°ª2-> %.3f :ÃÖ´ëºÀ1-> %.f : ÃÖ´ëºÀ2-> %.f",idx11,value11[idx11],value11[idx11+1],lowsAmt1,lowsAmt2,lowsBar1,lowsBar2,highAmt1,highAmt2,highBar1,highBar2); } Else { highAmt1 = value11[idx11+1]; highBar1 = idx11+1; hSw = 1; // Messagelog("102:::: :À妽º-> %.f :K°ª0-> %.3f : K°ª1-> %.3f :ÃÖ¼Ò°ª1-> %.3f : ÃÖ¼Ò°ª2-> %.3f :ÃÖ¼ÒºÀ1-> %.f : ÃÖ¼ÒºÀ2-> %.f :ÃÖ´ë°ª1-> %.3f : ÃÖ´ë°ª2-> %.3f :ÃÖ´ëºÀ1-> %.f : ÃÖ´ëºÀ2-> %.f",idx11,value11[idx11],value11[idx11+1],lowsAmt1,lowsAmt2,lowsBar1,lowsBar2,highAmt1,highAmt2,highBar1,highBar2); } } If value11[idx11] > value11[idx11+1] Then { If hSw == 1 Then{ hSw = 2; } Else If hSw == 2 and highAmt2 > 0 Then{ lSw = 3; idx21 = 999; //- Loop Å»Ãâ } If lSw == 0 Then{ lowsAmt1 = value11[idx11+1]; lowsBar1 = idx11+1; lSw = 1; // Messagelog("111:::: :À妽º-> %.f :K°ª0-> %.3f : K°ª1-> %.3f :ÃÖ¼Ò°ª1-> %.3f : ÃÖ¼Ò°ª2-> %.3f :ÃÖ¼ÒºÀ1-> %.f : ÃÖ¼ÒºÀ2-> %.f :ÃÖ´ë°ª1-> %.3f : ÃÖ´ë°ª2-> %.3f :ÃÖ´ëºÀ1-> %.f : ÃÖ´ëºÀ2-> %.f",idx11,value11[idx11],value11[idx11+1],lowsAmt1,lowsAmt2,lowsBar1,lowsBar2,highAmt1,highAmt2,highBar1,highBar2); } Else If lSw == 1 Then{ If lowsAmt1 > value11[idx11+1] Then{ lowsAmt1 = value11[idx11+1]; lowsBar1 = idx11+1; // Messagelog("112:::: :À妽º-> %.f :K°ª0-> %.3f : K°ª1-> %.3f :ÃÖ¼Ò°ª1-> %.3f : ÃÖ¼Ò°ª2-> %.3f :ÃÖ¼ÒºÀ1-> %.f : ÃÖ¼ÒºÀ2-> %.f :ÃÖ´ë°ª1-> %.3f : ÃÖ´ë°ª2-> %.3f :ÃÖ´ëºÀ1-> %.f : ÃÖ´ëºÀ2-> %.f",idx11,value11[idx11],value11[idx11+1],lowsAmt1,lowsAmt2,lowsBar1,lowsBar2,highAmt1,highAmt2,highBar1,highBar2); } } Else If lSw == 2 Then{ If lowsAmt2 == 0 Then{ lowsAmt2 = value11[idx11+1]; lowsBar2 = idx11+1; // Messagelog("113:::: :À妽º-> %.f :K°ª0-> %.3f : K°ª1-> %.3f :ÃÖ¼Ò°ª1-> %.3f : ÃÖ¼Ò°ª2-> %.3f :ÃÖ¼ÒºÀ1-> %.f : ÃÖ¼ÒºÀ2-> %.f :ÃÖ´ë°ª1-> %.3f : ÃÖ´ë°ª2-> %.3f :ÃÖ´ëºÀ1-> %.f : ÃÖ´ëºÀ2-> %.f",idx11,value11[idx11],value11[idx11+1],lowsAmt1,lowsAmt2,lowsBar1,lowsBar2,highAmt1,highAmt2,highBar1,highBar2); } Else If lowsAmt2 > value11[idx11+1] Then{ lowsAmt2 = value11[idx11+1]; lowsBar2 = idx11+1; // Messagelog("114:::: :À妽º-> %.f :K°ª0-> %.3f : K°ª1-> %.3f :ÃÖ¼Ò°ª1-> %.3f : ÃÖ¼Ò°ª2-> %.3f :ÃÖ¼ÒºÀ1-> %.f : ÃÖ¼ÒºÀ2-> %.f :ÃÖ´ë°ª1-> %.3f : ÃÖ´ë°ª2-> %.3f :ÃÖ´ëºÀ1-> %.f : ÃÖ´ëºÀ2-> %.f",idx11,value11[idx11],value11[idx11+1],lowsAmt1,lowsAmt2,lowsBar1,lowsBar2,highAmt1,highAmt2,highBar1,highBar2); } } } Else { If lSw == 1 Then{ lSw = 2; } If hSw == 0 Then{ highAmt1 = value11[idx11+1]; highBar1 = idx11+1; hSw = 1; // Messagelog("121:::: :À妽º-> %.f :K°ª0-> %.3f : K°ª1-> %.3f :ÃÖ¼Ò°ª1-> %.3f : ÃÖ¼Ò°ª2-> %.3f :ÃÖ¼ÒºÀ1-> %.f : ÃÖ¼ÒºÀ2-> %.f :ÃÖ´ë°ª1-> %.3f : ÃÖ´ë°ª2-> %.3f :ÃÖ´ëºÀ1-> %.f : ÃÖ´ëºÀ2-> %.f",idx11,value11[idx11],value11[idx11+1],lowsAmt1,lowsAmt2,lowsBar1,lowsBar2,highAmt1,highAmt2,highBar1,highBar2); } Else If hSw == 1 Then{ If highAmt1 < value11[idx11+1] Then{ highAmt1 = value11[idx11+1]; highBar1 = idx11+1; // Messagelog("122:::: :À妽º-> %.f :K°ª0-> %.3f : K°ª1-> %.3f :ÃÖ¼Ò°ª1-> %.3f : ÃÖ¼Ò°ª2-> %.3f :ÃÖ¼ÒºÀ1-> %.f : ÃÖ¼ÒºÀ2-> %.f :ÃÖ´ë°ª1-> %.3f : ÃÖ´ë°ª2-> %.3f :ÃÖ´ëºÀ1-> %.f : ÃÖ´ëºÀ2-> %.f",idx11,value11[idx11],value11[idx11+1],lowsAmt1,lowsAmt2,lowsBar1,lowsBar2,highAmt1,highAmt2,highBar1,highBar2); } } Else If hSw == 2 Then{ If highAmt2 == 0 Then{ highAmt2 = value11[idx11+1]; highBar2 = idx11+1; // Messagelog("123:::: :À妽º-> %.f :K°ª0-> %.3f : K°ª1-> %.3f :ÃÖ¼Ò°ª1-> %.3f : ÃÖ¼Ò°ª2-> %.3f :ÃÖ¼ÒºÀ1-> %.f : ÃÖ¼ÒºÀ2-> %.f :ÃÖ´ë°ª1-> %.3f : ÃÖ´ë°ª2-> %.3f :ÃÖ´ëºÀ1-> %.f : ÃÖ´ëºÀ2-> %.f",idx11,value11[idx11],value11[idx11+1],lowsAmt1,lowsAmt2,lowsBar1,lowsBar2,highAmt1,highAmt2,highBar1,highBar2); } Else If highAmt2 < value11[idx11+1] Then{ highAmt2 = value11[idx11+1]; highBar2 = idx11+1; // Messagelog("124:::: :À妽º-> %.f :K°ª0-> %.3f : K°ª1-> %.3f :ÃÖ¼Ò°ª1-> %.3f : ÃÖ¼Ò°ª2-> %.3f :ÃÖ¼ÒºÀ1-> %.f : ÃÖ¼ÒºÀ2-> %.f :ÃÖ´ë°ª1-> %.3f : ÃÖ´ë°ª2-> %.3f :ÃÖ´ëºÀ1-> %.f : ÃÖ´ëºÀ2-> %.f",idx11,value11[idx11],value11[idx11+1],lowsAmt1,lowsAmt2,lowsBar1,lowsBar2,highAmt1,highAmt2,highBar1,highBar2); } } } } //Messagelog("198:::: :À妽º-> %.f :ÃÖ¼Ò°ª1-> %.3f : ÃÖ¼Ò°ª2-> %.3f :ÃÖ¼ÒºÀ1-> %.f : ÃÖ¼ÒºÀ2-> %.f :ÃÖ´ë°ª1-> %.3f : ÃÖ´ë°ª2-> %.3f :ÃÖ´ëºÀ1-> %.f : ÃÖ´ëºÀ2-> %.f",idx11,lowsAmt1,lowsAmt2,lowsBar1,lowsBar2,highAmt1,highAmt2,highBar1,highBar2); If lowsAmt1 >= lowsAmt2 and lowsBar1 <= lowsBar2 and value11[0] > value11[1] Then { pass1 = 1; sVar11 = "Y"; Condition99 = True; Plot1(pass1, "½ºÅäij½ºÆ½"); Messagelog("199::°á°ú¿©ºÎ %s ::: GC1-> %.3f :: GC2-> %.3f : DC1-> %.3f : DC2-> %.3f : GC1À§Ä¡-> %.f",sVar11,value13,value14,value15,value16,value19); }