Input : shortPeriod(5), midPeriod(10), longPeriod(20), longPeriod1(60), longPeriod2(120), longPeriod3(240), longPeriod4(720), rsiPeriod(10), LPercent(30), Fline(999999999999), SPercent(70), volPeriod(5), sto5period(5), sto5period1(3), sto5period2(3), sto10period(10), sto10period1(6), sto10period2(6), sto20Period(20), sto20Period1(12), sto20Period2(12), sto65Period(65), sto65Period1(39), sto65Period2(39), sto130Period(130), sto130Period1(78), sto130Period2(78),simPeriod(10), disph(105.01), dispL(94.99), dispL1(90), simh(70), simL(30), stoh(80), stoL(20), barperiod(10), Faddsto(1), Flosscutrate(0.015), Faddbox(0.2), Fdepvaluemin(1.1), Fdepvaluemin1(1.5), Fdepvaluemin2(1.8), Fdepvaluemid(3), Fdepvaluemax(5), Fd4depvaluemax(7), Fdepratemin(0.006), Fdepratemin1(0.01), Fdepratemin3(0.015), Fdepratemid(0.02), Fdepratemid1(0.025), Fdepratemid3(0.03), Fdepratemax(0.05), Flpdepmin(0.03), Flpdepmid(0.1), Fcontby2(2), Fcontreg(2), Fcont5min(2); var : Bcontby2(0), Bcontreg(0), Bcont5min(0), Scontby2(0), Scontreg(0), Scont5min(0), sp(0), mp(0), lp(0), lp1(0), lp2(0), lp3(0), lp4(0), rp(0), vp(0), bidask(0), sto5k(0), sto5d(0), sto10k(0), sto10d(0), sto20k(0), sto20d(0), sto65k(0), sto65d(0), sto130k(0), sto130d(0), upV(0), upV1(0), upV2(0), downV(0), downV1(0), downV2(0), tupV(0), tupV1(0), tupV2(0), tdownV(0), tdownV1(0), tdownV2(0), downupV(0), downupV1(0), downupV2(0), updownV(0), updownV1(0), updownV2(0), maxupV(0), maxdownV(0), minupV(0), mindownV(0), sph1(0), sph2(0), sph3(0), spL1(0), spL2(0), spL3(0), mph1(0), mph2(0), mpL1(0), mpL2(0), lph1(0), lph2(0), lpL1(0), lpL2(0), lp1L1(0), lp1L2(0), lp1h1(0), lp1h2(0), lp2L1(0), lp2L2(0), lp2h1(0), lp2h2(0), spL1bar(0), spL2bar(0), sph1bar(0), sph2bar(0), mpL1bar(0), mpL2bar(0), mph1bar(0), mph2bar(0), lpL1bar(0), lpL2bar(0), lph1bar(0), lph2bar(0), lp1L1bar(0), lp1L2bar(0), lp1h1bar(0), lp1h2bar(0), lp2L1bar(0), lp2L2bar(0), lp2h1bar(0), lp2h2bar(0), sto5kh1(0), sto5kh2(0), sto5kL1(0), sto5kL2(0), sto5dh1(0), sto5dh2(0), sto5dh3(0), sto5dL1(0), sto5dL2(0), sto5dL3(0), sto10kh1(0), sto10kh2(0), sto10kh3(0), sto10kL1(0), sto10kL2(0), sto10kL3(0), sto10kh1bar(0), sto10kh2bar(0), sto10kL1bar(0), sto10kL2bar(0), sto10dh1(0), sto10dh2(0), sto10dh3(0), sto10dL1(0), sto10dL2(0), sto10dL3(0), sto10dh1bar(0), sto10dh2bar(0), sto10dL1bar(0), sto10dL2bar(0), sto20kh1(0), sto20kh2(0), sto20kh3(0), sto20kL1(0), sto20kL2(0), sto20kL3(0), sto20kh1bar(0), sto20kh2bar(0), sto20kL1bar(0), sto20kL2bar(0), sto20dh1(0), sto20dh2(0), sto20dh3(0), sto20dL1(0), sto20dL2(0), sto20dL3(0), sto20dh1bar(0), sto20dh2bar(0), sto20dL1bar(0), sto20dL2bar(0), sto65kh1(0), sto65kh2(0), sto65kL1(0), sto65kL2(0), sto65kh1bar(0), sto65kh2bar(0), sto65kL1bar(0), sto65kL2bar(0), sto65dh1(0), sto65dh2(0), sto65dh3(0), sto65dL1(0), sto65dL2(0), sto65dL3(0), sto65dh1bar(0), sto65dh2bar(0), sto65dL1bar(0), sto65dL2bar(0), sto130kh1(0), sto130kh2(0), sto130kL1(0), sto130kL2(0), sto130kh1bar(0), sto130kh2bar(0), sto130kL1bar(0), sto130kL2bar(0), sto130dh1(0), sto130dh2(0), sto130dh3(0), sto130dL1(0), sto130dL2(0), sto130dL3(0), sto130dh1bar(0), sto130dh2bar(0), sto130dL1bar(0), sto130dL2bar(0), sto5up(0), sto5down(0), sto10up(0), sto10down(0), sto20up(0), sto20down(0), sto65up(0), sto65down(0), sto130up(0), sto130down(0), sto10up1(0), sto10down1(0), sto20up1(0), sto20down1(0), sto65up1(0), sto65down1(0), sto130up1(0), sto130down1(0), sto10up2(0), sto10down2(0), sto20up2(0), sto20down2(0), sto65up2(0), sto65down2(0), sto130up2(0), sto130down2(0), stok10n20Lcon(0), stok10or20Lcon(0), stok10n20hcon(0), stok10or20hcon(0), stodL10n20Lcon(0), stodL10or20Lcon(0), stodh10n20hcon(0), stodh10or20hcon(0), stodL10n20upcon(0), stodL10or20upcon(0), stodh10n20downcon(0), stodh10or20downcon(0), stok65n130Lcon(0), stok65or130Lcon(0), stok65n130hcon(0), stok65or130hcon(0), stodL65n130Lcon(0), stodL65or130Lcon(0), stodh65n130hcon(0), stodh65or130hcon(0), stodL65n130upcon(0), stodL65or130upcon(0), stodh65n130downcon(0), stodh65or130downcon(0), bapup(0), bapdown(0), upbidaskcon(0), bfupbidaskcon(0), downbidaskcon(0), bfdownbidaskcon(0), borbfupbidaskcon(0), borbfdownbidaskcon(0), dayupbidaskcon(0), daydownbidaskcon(0), sto5h1(0), sto5h2(0), sto5L1(0), sto5L2(0), stok5h1(0), stok5h2(0), stok5h3(0),stok5L1(0), stok5L2(0), stok5L3(0), stod5h1(0), stod5h2(0), stod5h3(0), stod5L1(0), stod5L2(0), stod5L3(0), stok10h1(0), stok10h2(0), stok10h3(0), stok10L1(0), stok10L2(0), stok10L3(0), stod10h1(0), stod10h2(0), stod10h3(0), stod10L1(0), stod10L2(0), stod10L3(0), stok20h1(0), stok20h2(0), stok20h3(0), stok20L1(0), stok20L2(0), stok20L3(0), stod20h1(0), stod20h2(0), stod20h3(0), stod20L1(0), stod20L2(0), stod20L3(0), stok65h1(0), stok65h2(0), stok65h3(0), stok65L1(0), stok65L2(0), stok65L3(0), stod65h1(0), stod65h2(0), stod65h3(0), stod65L1(0), stod65L2(0), stod65L3(0), stok130h1(0), stok130h2(0), stok130h3(0), stok130L1(0), stok130L2(0), stok130L3(0), stod130h1(0), stod130h2(0), stod130h3(0), stod130L1(0), stod130L2(0), stod130L3(0), sto5index(0), sto10index(0), sto20index(0), sto65index(0), sto130index(0), Lstlp1(0), Hstlp1(0), ylstlp1(0), yhstlp1(0), Cnlp1234con (0), spnlp1234con(0), splp01dr(0), splp1234dr(0), lp0123dr(0), lp023dr(0), lp1234dr(0), lp123dr(0), lp124dr(0), lp134dr(0), lp234dr(0), bfsplp01dr(0), bflp0123dr(0), bflp023dr(0), bflp1234dr(0), spdupcon(0), mpdupcon(0), lpdupcon(0), spmpdupcon(0), splpdupcon(0), mplpdupcon(0), spmpnlpdupcon(0), mplpnlp12dupcon(0), splp1dupcon(0), mplp1dupcon(0), lplp1dupcon(0), mplp2dupcon(0), lplp2dupcon(0), lp1dupcon(0), lp2dupcon(0), daylp1L1bar(0), daylp1h1bar(0), uplonglpdr(0), downlonglpdr(0), shorttrend(0), midtrend(0), uplongtrend(0), downlongtrend(0), displp3(0), dayhighlp2(0), daylowlp2(0), dayhighlp3(0), daylowlp3(0), dayhighlp4(0), daylowlp4(0), dayhighdisplp3(0), daylowdisplp3(0), simri(0), dayhighsimri(0), daylowsimri(0), simsumV(0), simcount(0), plusb(0), minusb(0), plusc(0), minusc(0), barcount(0), plusbm(0), minusbm(0), bfdaycloselp(0), dayopenlp(0), daylestlp1(0), dayhestlp1(0), dayopenlp1(0), bfdaylestlp1(0), bfdayhestlp1(0), bfdayopenlp1(0), bap(0), bapL1(0), bapL2(0), baph1(0), baph2(0), uphbbarcon(0), uphb5con(0), uphb10con(0), uphb20con(0), uphbbapcon(0), downhbbarcon(0), downhb5con(0), downhb10con(0), downhb20con(0), downhbbapcon(0), jeong(0), yeog(0), bfjeong(0), bfyeog(0), stoupcon(0), stodowncon(0), notstoupcon(0), notstodowncon(0), buymincon(0), sellmincon(0), buyregcon(0), sellregcon(0), notbuyregcon(0), notsellregcon(0), buybetcon(0), sellbetcon(0), notbuybetcon(0), notsellbetcon(0), tboxmid(0), yboxmid(0), y2boxmid(0), y3boxmid(0), tboxdep(0), yboxdep(0), y2boxdep(0), y3boxdep(0), boxupcnt(0), boxdowncnt(0), boxupbetcnt(0), boxdownbetcnt(0), via(0), contcnt(0), upgapcon(0), downgapcon(0), contgapcnt(0), upgapdaycnt(0), downgapdaycnt(0), upgaplow(0), downgaphigh(0), contupcnt(0), contdowncnt(0), notbuycon(0), notsellcon(0), notbuyclgrd(0), notsellclgrd(0), notbuyclcon(0), notsellclcon(0), forcedbuycon(0), forcedsellcon(0), forcedbuyclcon(0), forcedsellclcon(0), forcedstoupcon(0), forcedstodowncon(0), addbuyclcon(0), addsellclcon(0), addbuyclconcnt(0), addsellclconcnt(0), addbuyclcon99(0), addsellclcon99(0), addbuyclconcnt99(0), addsellclconcnt99(0), dayopenupV(0), dayopendownV(0), dayopenC(0), daybgstupV(0), daybgstdownV(0), bfdaybgstupV(0), bfdaybgstdownV(0), dayupVcnt(0), daydownVcnt(0), dayupVsum(0), daydownVsum(0), dayupVavg(0), daydownVavg(0), dayopenvol(0), daybgstvol(0), bfdayopenvol(0), bfdaybgstvol(0), bgstvolcon(0), bgstupVcon(0), bgstdownVcon(0), savec(0), savesp(0), savelp(0), depvaluemin(0), depvaluemin1(0), depvaluemin3(0), depvaluemid(0), depvaluemid1(0), depvaluemid3(0), depvaluemax(0), d4depvaluemax(0), d2boxdep(0), d2boxhigh(0), d2boxlow(0), d2boxmid(0), d3d2boxdep(0), d3d2boxhigh(0), d3d2boxlow(0), d3d2boxmid(0), d3boxdep(0), d3boxhigh(0), d3boxlow(0), d3boxmid(0), d4boxdep(0), d4boxhigh(0), d4boxlow(0), d4boxmid(0), d5boxdep(0), d5boxhigh(0), d5boxlow(0), d5boxmid(0), d6boxdep(0), d6boxhigh(0), d6boxlow(0), d6boxmid(0), d7boxdep(0), d7boxhigh(0), d7boxlow(0), d7boxmid(0), boxdep(0), boxhigh(0), boxlow(0), boxmid(0), contboxcnt(0), baseboxhigh(0), baseboxlow(0), baseboxmid(0), baseboxdep(0), lp1crupresist(0), lp2crupresist(0), lp3crupresist(0), lp4crupresist(0), lp1crdownresist(0), lp2crdownresist(0), lp3crdownresist(0), lp4crdownresist(0), lp1shupresist(0), lp2shupresist(0), lp3shupresist(0), lp4shupresist(0), lpcrupresist(0), lpshupresist(0), lp1shdownresist(0), lp2shdownresist(0), lp3shdownresist(0), lp4shdownresist(0), lpcrdownresist(0), lpshdownresist(0), lpcrupcon(0), lp1crupcon(0), lp2crupcon(0), lp3crupcon(0), lp4crupcon(0), lpcrdowncon(0), lp1crdowncon(0), lp2crdowncon(0), lp3crdowncon(0), lp4crdowncon(0), d1crupresist(0), d2crupresist(0), d3crupresist(0), d4crupresist(0), d1crdownresist(0), d2crdownresist(0), d3crdownresist(0), d4crdownresist(0), d1shupresist(0), d2shupresist(0), d3shupresist(0), d4shupresist(0), boxcrupresist(0), boxshupresist(0), box7shupresist(0), d1shdownresist(0), d2shdownresist(0), d3shdownresist(0), d4shdownresist(0), boxcrdownresist(0), boxshdownresist(0), box7shdownresist(0), lp1234convercon(0), lp123convercon(0), lp123n4convercon(0), lp123or4convercon(0), boxconvercon(0), d2convercnt(0), d3convercnt(0), d4convercnt(0), lp1234gapmincon(0), lp123gapmincon(0), lp234gapmincon(0), entbartrend(0), clbartrend(0), clbartrend1(0), Crossdown520con(0), upfailure10con(0), displp3con(0), simricon(0), bidaskindex(0), bidaskupcnt(0), bidaskdowncnt(0), daybuyclcon(0), daysellclcon(0), bfdaybuyclcon(0), bfdaysellclcon(0),bfposition(0), bfdayuplpcnt(0), bfdaydownlpcnt(0), bfdayuplp4cnt(0), bfdaydownlp4cnt(0), dayuplpcnt(0), daydownlpcnt(0), dayuplp4cnt(0), daydownlp4cnt(0), count(0), bar12high(0), bar12low(0), bar12dep(0), bar6high(0), bar6low(0), bar6dep(0), bar6highsum(0), bar6lowsum(0), bar6highavg(0), bar6lowavg(0), sellcldownupcon(0), buyclupdowncon(0), contbidaskcnt(0), contbarcnt(0), contvolcnt(0); sp = ma(C, shortPeriod); mp = ma(C, midPeriod); lp = ma(C, longPeriod); lp1 = ma(C, longPeriod1); lp2 = ma(C, longPeriod2); lp3 = ma(C, longPeriod3); lp4 = ma(C, longPeriod4); rp = rsi(rsiperiod); vp = ma(v, volperiod); bidask = ma(bids,3) - ma(asks,3); bap = ma(bidask, 3); sto5k = StochasticsK(sto5Period,sto5Period1); sto5d = StochasticsD(sto5Period,sto5Period1,sto5Period2); sto10k = StochasticsK(sto10Period,sto10Period1); sto10d = StochasticsD(sto10Period,sto10Period1,sto10Period2); sto20k = StochasticsK(sto20Period,sto20Period1); sto20d = StochasticsD(sto20Period,sto20Period1,sto20Period2); sto65k = StochasticsK(sto65Period,sto65Period1); sto65d = StochasticsD(sto65Period,sto65Period1,sto65Period2); sto130k = StochasticsK(sto130Period,sto130Period1); sto130d = StochasticsD(sto130Period,sto130Period1,sto130Period2); bapL1 = Swinglow(1,bap,2,1,50); bapL2 = Swinglow(2,bap,2,1,50); baph1 = Swinghigh(1,bap,2,1,50); baph2 = Swinghigh(2,bap,2,1,50); spL1 = Swinglow(1,sp,2,1,100); spL2 = Swinglow(2,sp,2,1,100); spL3 = Swinglow(3,sp,2,1,100); sph1 = SwingHigh(1,sp,2,1,100); sph2 = SwingHigh(2,sp,2,1,100); sph3 = SwingHigh(3,sp,2,1,100); spL1bar = Swinglowbar(1,sp,2,1,100); spL2bar = Swinglowbar(2,sp,2,1,100); sph1bar = SwingHighbar(1,sp,2,1,100); sph2bar = SwingHighbar(2,sp,2,1,100); mpL1 = Swinglow(1,mp,3,1,100); mpL2 = Swinglow(2,mp,3,1,100); mph1 = SwingHigh(1,mp,3,1,100); mph2 = SwingHigh(2,mp,3,1,100); mpL1bar = Swinglowbar(1,mp,3,1,100); mpL2bar = Swinglowbar(2,mp,3,1,100); mph1bar = SwingHighbar(1,mp,3,1,100); mph2bar = SwingHighbar(2,mp,3,1,100); lpL1 = Swinglow(1,lp,5,1,200); lpL2 = Swinglow(2,lp,5,1,200); lph1 = SwingHigh(1,lp,5,1,200); lph2 = SwingHigh(2,lp,5,1,200); lpL1bar = Swinglowbar(1,lp,5,1,200); lpL2bar = Swinglowbar(2,lp,5,1,200); lph1bar = SwingHighbar(1,lp,5,1,200); lph2bar = SwingHighbar(2,lp,5,1,200); lp1L1 = Swinglow(1,lp1,5,1,600); lp1L2 = Swinglow(2,lp1,5,1,600); lp1h1 = SwingHigh(1,lp1,5,1,600); lp1h2 = SwingHigh(2,lp1,5,1,600); lp1L1bar = Swinglowbar(1,lp1,5,1,600); lp1L2bar = Swinglowbar(2,lp1,5,1,600); lp1h1bar = SwingHighbar(1,lp1,5,1,600); lp1h2bar = SwingHighbar(2,lp1,5,1,600); lp2L1 = Swinglow(1,lp2,5,1,600); lp2L2 = Swinglow(2,lp2,5,1,600); lp2h1 = SwingHigh(1,lp2,5,1,600); lp2h2 = SwingHigh(2,lp2,5,1,600); lp2L1bar = Swinglowbar(1,lp2,5,1,600); lp2L2bar = Swinglowbar(2,lp2,5,1,600); lp2h1bar = SwingHighbar(1,lp2,5,1,600); lp2h2bar = SwingHighbar(2,lp2,5,1,600); displp3 = Disparity(longPeriod3); sto5kh1 = SwingHigh(1,sto5k,3,1,100); sto5kh2 = SwingHigh(2,sto5k,3,1,100); sto5kL1 = Swinglow(1,sto5k,3,1,100); sto5kL2 = Swinglow(2,sto5k,3,1,100); sto10kh1 = SwingHigh(1,sto10k,3,1,100); sto10kh2 = SwingHigh(2,sto10k,3,1,100); sto10kh3 = SwingHigh(3,sto10k,3,1,100); sto10kL1 = Swinglow(1,sto10k,3,1,100); sto10kL2 = Swinglow(2,sto10k,3,1,100); sto10kL3 = Swinglow(3,sto10k,3,1,100); sto10kh1bar = SwingHighbar(1,sto10k,3,1,100); sto10kh2bar = SwingHighbar(2,sto10k,3,1,100); sto10kL1bar = Swinglowbar(1,sto10k,3,1,100); sto10kL2bar = Swinglowbar(2,sto10k,3,1,100); sto20kh1 = SwingHigh(1,sto20k,3,1,100); sto20kh2 = SwingHigh(2,sto20k,3,1,100); sto20kh3 = SwingHigh(3,sto20k,3,1,100); sto20kL1 = Swinglow(1,sto20k,3,1,100); sto20kL2 = Swinglow(2,sto20k,3,1,100); sto20kL3 = Swinglow(3,sto20k,3,1,100); sto20kh1bar = SwingHighbar(1,sto20k,3,1,100); sto20kh2bar = SwingHighbar(2,sto20k,3,1,100); sto20kL1bar = Swinglowbar(1,sto20k,3,1,100); sto20kL2bar = Swinglowbar(2,sto20k,3,1,100); sto65kh1 = SwingHigh(1,sto65k,3,1,300); sto65kh2 = SwingHigh(2,sto65k,3,1,300); sto65kL1 = Swinglow(1,sto65k,3,1,300); sto65kL2 = Swinglow(2,sto65k,3,1,300); sto65kh1bar = SwingHighbar(1,sto65k,3,1,300); sto65kh2bar = SwingHighbar(2,sto65k,3,1,300); sto65kL1bar = Swinglowbar(1,sto65k,3,1,300); sto65kL2bar = Swinglowbar(2,sto65k,3,1,300); sto130kh1 = SwingHigh(1,sto130k,5,1,600); sto130kh2 = SwingHigh(2,sto130k,5,1,600); sto130kL1 = Swinglow(1,sto130k,5,1,600); sto130kL2 = Swinglow(2,sto130k,5,1,600); sto130kh1bar = SwingHighbar(1,sto130k,5,1,600); sto130kh2bar = SwingHighbar(2,sto130k,5,1,600); sto130kL1bar = Swinglowbar(1,sto130k,5,1,600); sto130kL2bar = Swinglowbar(2,sto130k,5,1,600); sto5dh1 = SwingHigh(1,sto5d,3,1,100); sto5dh2 = SwingHigh(2,sto5d,3,1,100); sto5dh3 = SwingHigh(3,sto5d,3,1,100); sto5dL1 = Swinglow(1,sto5d,3,1,100); sto5dL2 = Swinglow(2,sto5d,3,1,100); sto5dL3 = Swinglow(3,sto5d,3,1,100); sto10dh1 = SwingHigh(1,sto10d,5,1,100); sto10dh2 = SwingHigh(2,sto10d,5,1,100); sto10dh3 = SwingHigh(3,sto10d,5,1,100); sto10dL1 = Swinglow(1,sto10d,5,1,100); sto10dL2 = Swinglow(2,sto10d,5,1,100); sto10dL3 = Swinglow(3,sto10d,5,1,100); sto10dh1bar = SwingHighbar(1,sto10d,5,1,100); sto10dh2bar = SwingHighbar(2,sto10d,5,1,100); sto10dL1bar = Swinglowbar(1,sto10d,5,1,100); sto10dL2bar = Swinglowbar(2,sto10d,5,1,100); sto20dh1 = SwingHigh(1,sto20d,5,1,200); sto20dh2 = SwingHigh(2,sto20d,5,1,200); sto20dh3 = SwingHigh(3,sto20d,5,1,200); sto20dL1 = Swinglow(1,sto20d,5,1,200); sto20dL2 = Swinglow(2,sto20d,5,1,200); sto20dL3 = Swinglow(3,sto20d,5,1,200); sto20dh1bar = SwingHighbar(1,sto20d,5,1,200); sto20dh2bar = SwingHighbar(2,sto20d,5,1,200); sto20dL1bar = Swinglowbar(1,sto20d,5,1,200); sto20dL2bar = Swinglowbar(2,sto20d,5,1,200); sto65dh1 = SwingHigh(1,sto65d,10,1,600); sto65dh2 = SwingHigh(2,sto65d,10,1,600); sto65dL1 = Swinglow(1,sto65d,10,1,600); sto65dL2 = Swinglow(2,sto65d,10,1,600); sto65dh1bar = SwingHighbar(1,sto65d,10,1,600);// sto65dh2bar = SwingHighbar(2,sto65d,10,1,600);// sto65dL1bar = Swinglowbar(1,sto65d,10,1,600);// sto65dL2bar = Swinglowbar(2,sto65d,10,1,600);// sto130dh1 = SwingHigh(1,sto130d,10,1,600); sto130dh2 = SwingHigh(2,sto130d,10,1,600); sto130dL1 = Swinglow(1,sto130d,10,1,600); sto130dL2 = Swinglow(2,sto130d,10,1,600); sto130dh1bar = SwingHighbar(1,sto130d,10,1,600); sto130dh2bar = SwingHighbar(2,sto130d,10,1,600); sto130dL1bar = Swinglowbar(1,sto130d,10,1,600); sto130dL2bar = Swinglowbar(2,sto130d,10,1,600); // ---------- 원하는 포지션 수량 조정및 청산에 따른 보조 루틴 ---------- // { if marketposition() == 0 then// 잔고가 없는 경우 {via = 0; contcnt = 0; Bcontby2 = Fcontby2; Bcontreg = Fcontreg; Bcont5min = Fcont5min; Scontby2 = Fcontby2; Scontreg = Fcontreg; Scont5min = Fcont5min;} else if marketposition() == 1 then// 매수 잔고가 있는 경우 {Bcontby2 = Fcontby2 - Currentcontracts();// 매수 희망잔고에서 기존 잔고를 차감후 주문 Bcontreg = Fcontreg - Currentcontracts();// 매수 희망잔고에서 기존 잔고를 차감후 주문 Bcont5min = Fcont5min - Currentcontracts();// 매수 희망잔고에서 기존 잔고를 차감후 주문 Scontby2 = Fcontby2; Scontreg = Fcontreg; Scont5min = Fcont5min;}// 매도시에는 희망잔고부여 else if marketposition() == -1 then// 매도 잔고가 있는 경우 {Scontby2 = Fcontby2 - Currentcontracts();// 매도 희망잔고에서 기존 잔고를 차감후 주문 Scontreg = Fcontreg - Currentcontracts();// 매도 희망잔고에서 기존 잔고를 차감후 주문 Scont5min = Fcont5min - Currentcontracts();// 매도 희망잔고에서 기존 잔고를 차감후 주문 Bcontby2 = Fcontby2; Bcontreg = Fcontreg; Bcont5min = Fcont5min;}// 매수시에는 희망잔고부여 } // ---------- 일중청산 여부 판단 루틴 ---------- // if dayindex() == 0 then {bfdaybuyclcon = daybuyclcon; bfdaysellclcon = daysellclcon;} { if dayindex() == 0 then {bfposition = marketposition(); daybuyclcon = 0; daysellclcon = 0;} if bfposition == 0 and marketposition() <> 0 then {bfposition = marketposition();} if bfposition == 1 and marketposition() < 1 then {daybuyclcon = 1;} if bfposition == -1 and marketposition() > -1 then {daysellclcon = 1;} } // ---------- 봉의 크기 산출(시가와 종가와 차이) ---------- // {upV = 0; upV1 = 0; upV2 = 0; downV = 0; downV1 = 0; downV2 = 0;} {tupV = 0; tupV1 = 0; tupV2 = 0; tdownV = 0; tdownV1 = 0; tdownV2 = 0;} {downupV = 0; downupV1 = 0; downupV2 = 0; updownV = 0; updownV1 = 0; updownV2 = 0;} if C >= O then {upV = C - O; updownV = H - C; downupV = O - L; } if C[1] >= O[1] then {upV1 = C[1] - O[1]; updownV1 = H[1] - C[1]; downupV1 = O[1] - L[1];} if C[2] >= O[2] then {upV2 = C[2] - O[2]; updownV2 = H[2] - C[2]; downupV2 = O[2] - L[2];} if C <= O then {downV = O - C; downupV = C - L; updownV = H - O;} if C[1] <= O[1] then {downV1 = O[1] - C[1]; downupV1 = C[1] - L[1]; updownV1 = H[1] - O[1];} if C[2] <= O[2] then {downV2 = O[2] - C[2]; downupV2 = C[2] - L[2]; updownV2 = H[2] - O[2];} {tupV = C - L; tupV1 = C[1] - L[1]; tupV2 = C[2] - L[2];} {tdownV = H - C; tdownV1 = H[1] - C[1]; tdownV2 = H[2] - C[2];} // ---------- 박스권상단, 박스권하단및 박스권 중간값, 박스권 크기 산출 루틴 ---------- // { depvaluemin = 0; depvaluemin1 = 0; depvaluemin3 = 0; depvaluemid = 0; depvaluemid1 = 0; depvaluemid3 = 0; depvaluemax = 0; d4depvaluemax = 0; tboxmid = 0; yboxmid = 0; y2boxmid = 0; y3boxmid = 0; // 금일 또는 전일의 최고가와 최저가의 중간값 tboxdep = 0; yboxdep = 0; y2boxdep = 0; y3boxdep = 0; d2boxdep = 0; d2boxhigh = 0; d2boxlow = 0; d2boxmid = 0; d3d2boxdep = 0; d3d2boxhigh = 0; d3d2boxlow = 0; d3d2boxmid = 0; d3boxdep = 0; d3boxhigh = 0; d3boxlow = 0; d3boxmid = 0; d4boxdep = 0; d4boxhigh = 0; d4boxlow = 0; d4boxmid = 0; d5boxdep = 0; d5boxhigh = 0; d5boxlow = 0; d5boxmid = 0; d6boxdep = 0; d6boxhigh = 0; d6boxlow = 0; d6boxmid = 0; d7boxdep = 0; d7boxhigh = 0; d7boxlow = 0; d7boxmid = 0; boxupcnt = 0; boxupbetcnt = 0;// ?일간의 박스권을 상향 탈출시 boxdowncnt = 0; boxdownbetcnt = 0; // ?일간의 박스권을 하향 탈출시 //Fdepratemin(0.006), Fdepratemin1(0.01), Fdepratemin3(0.015), //Fdepratemid(0.02), Fdepratemid1(0.025), Fdepratemid3(0.03), Fdepratemax(0.05) depvaluemin = dayclose(1) * Fdepratemin; depvaluemin3 = dayclose(1) * Fdepratemin3; depvaluemin1 = dayclose(1) * Fdepratemin1; depvaluemid1 = dayclose(1) * Fdepratemid1; depvaluemid = dayclose(1) * Fdepratemid; depvaluemid3 = dayclose(1) * Fdepratemid3; depvaluemax = dayclose(1) * Fdepratemax; tboxmid = (dayhigh(0) + daylow(0)) / 2; yboxmid = (dayhigh(1) + daylow(1)) / 2; y2boxmid = (dayhigh(2) + daylow(2)) / 2; y3boxmid = (dayhigh(3) + daylow(3)) / 2; tboxdep = dayhigh(0) - daylow(0); yboxdep = dayhigh(1) - daylow(1); y2boxdep = dayhigh(2) - daylow(2); y3boxdep = dayhigh(3) - daylow(3); } {// 3일전과 2일일의 최고가와 최저가를 비교하여 박스권의 폭및 그 중간값을 구함 { if dayhigh(3) > dayhigh(2) then {d3d2boxhigh = dayhigh(3);} if dayhigh(3) <= dayhigh(2) then {d3d2boxhigh = dayhigh(2);} if daylow(3) < daylow(2) then {d3d2boxlow = daylow(3);} if daylow(3) >= daylow(2) then {d3d2boxlow = daylow(2);} } {d3d2boxdep = d3d2boxhigh - d3d2boxlow; d3d2boxmid = (d3d2boxhigh + d3d2boxlow) / 2;} } {// 전전일과 전일의 최고가와 최저가를 산출하여 과거 2일간의 박스권의 폭및 그 중간값을 구함 { if dayhigh(2) > dayhigh(1) then {d2boxhigh = dayhigh(2);} if dayhigh(2) <= dayhigh(1) then {d2boxhigh = dayhigh(1);} if daylow(2) < daylow(1) then {d2boxlow = daylow(2);} if daylow(2) >= daylow(1) then {d2boxlow = daylow(1);} } {d2boxdep = d2boxhigh - d2boxlow; d2boxmid = (d2boxhigh + d2boxlow) / 2;} } {// 금일 이전 과거 3일간의 최고가및 최저가를 구함 { if dayhigh(3) > d2boxhigh then {d3boxhigh = dayhigh(3);} if dayhigh(3) <= d2boxhigh then {d3boxhigh = d2boxhigh;} if daylow(3) < d2boxlow then {d3boxlow = daylow(3);} if daylow(3) >= d2boxlow then {d3boxlow = d2boxlow;} } {d3boxdep = d3boxhigh - d3boxlow; d3boxmid = (d3boxhigh + d3boxlow) / 2;} } {// 금일 이전 과거 4일간의 최고가및 최저가를 구함 { if dayhigh(4) > d3boxhigh then {d4boxhigh = dayhigh(4);} if dayhigh(4) <= d3boxhigh then {d4boxhigh = d3boxhigh;} if daylow(4) < d3boxlow then {d4boxlow = daylow(4);} if daylow(4) >= d3boxlow then {d4boxlow = d3boxlow;} } {d4boxdep = d4boxhigh - d4boxlow; d4boxmid = (d4boxhigh + d4boxlow) / 2;} } {// 금일 이전 과거 5일간의 최고가및 최저가를 구함 { if dayhigh(5) > d4boxhigh then {d5boxhigh = dayhigh(5);} if dayhigh(5) <= d4boxhigh then {d5boxhigh = d4boxhigh;} if daylow(5) < d4boxlow then {d5boxlow = daylow(5);} if daylow(5) >= d4boxlow then {d5boxlow = d4boxlow;} } {d5boxdep = d5boxhigh - d5boxlow; d5boxmid = (d5boxhigh + d5boxlow) / 2;} } {// 금일 이전 과거 6일간의 최고가및 최저가를 구함 { if dayhigh(6) > d5boxhigh then {d6boxhigh = dayhigh(6);} if dayhigh(6) <= d5boxhigh then {d6boxhigh = d5boxhigh;} if daylow(6) < d5boxlow then {d6boxlow = daylow(6);} if daylow(6) >= d5boxlow then {d6boxlow = d5boxlow;} } {d6boxdep = d6boxhigh - d6boxlow; d6boxmid = (d6boxhigh + d6boxlow) / 2;} } {// 금일 이전 과거 7일간의 최고가및 최저가를 구함 { if dayhigh(7) > d6boxhigh then {d7boxhigh = dayhigh(7);} if dayhigh(7) <= d6boxhigh then {d7boxhigh = d6boxhigh;} if daylow(7) < d6boxlow then {d7boxlow = daylow(7);} if daylow(7) >= d6boxlow then {d7boxlow = d6boxlow;} } {d7boxdep = d7boxhigh - d7boxlow; d7boxmid = (d7boxhigh + d7boxlow) / 2;} } // ---------- 스토 쌍바닥및 쌍봉여부 판단 ---------- // { sto5up = 0; sto5down = 0; sto10up = 0; sto10down = 0; sto20up = 0; sto20down = 0; sto65up = 0; sto65down = 0; sto130up = 0; sto130down = 0; sto10up1 = 0; sto10down1 = 0; sto20up1 = 0; sto20down1 = 0; sto65up1 = 0; sto65down1 = 0; sto130up1 = 0; sto130down1 = 0; sto10up2 = 0; sto10down2 = 0; sto20up2 = 0; sto20down2 = 0; sto65up2 = 0; sto65down2 = 0; sto130up2 = 0; sto130down2 = 0; } if Crossup(sto5k,sto5d) then { sto5L2 = sto5L1; sto5L1 = sto5k[1];} if Crossdown(sto5k,sto5d) then { sto5h2 = sto5h1; sto5h1 = sto5k[1];} if Crossup(sto10k,sto10d) then {stok10L3 = stok10L2; stok10L2 = stok10L1; stok10L1 = sto10k[1]; stod10L3 = stod10L2; stod10L2 = stod10L1; stod10L1 = sto10d[1]; sto10index = index;} if Crossdown(sto10k,sto10d) then {stok10h3 = stok10h2; stok10h2 = stok10h1; stok10h1 = sto10k[1]; stod10h3 = stod10h2; stod10h2 = stod10h1; stod10h1 = sto10d[1]; sto10index = index;} if Crossup(sto20k,sto20d) then {stok20L3 = stok20L2; stok20L2 = stok20L1; stok20L1 = sto20k[1]; stod20L3 = stod20L2; stod20L2 = stod20L1; stod20L1 = sto20d[1]; sto20index = index;} if Crossdown(sto20k,sto20d) then {stok20h3 = stok20h2; stok20h2 = stok20h1; stok20h1 = sto20k[1]; stod20h3 = stod20h2; stod20h2 = stod20h1; stod20h1 = sto20d[1]; sto20index = index;} if Crossup(sto65k,sto65d) then {stok65L3 = stok65L2; stok65L2 = stok65L1; stok65L1 = sto65k[1]; stod65L3 = stod65L2; stod65L2 = stod65L1; stod65L1 = sto65d[1]; sto65index = index;} if Crossdown(sto65k,sto65d) then {stok65h3 = stok65h2; stok65h2 = stok65h1; stok65h1 = sto65k[1]; stod65h3 = stod65h2; stod65h2 = stod65h1; stod65h1 = sto65d[1]; sto65index = index;} if Crossup(sto130k,sto130d) then {stok130L3 = stok130L2; stok130L2 = stok130L1; stok130L1 = sto130k[1]; stod130L3 = stod130L2; stod130L2 = stod130L1; stod130L1 = sto130d[1]; sto130index = index;} if Crossdown(sto130k,sto130d) then {stok130h3 = stok130h2; stok130h2 = stok130h1; stok130h1 = sto130k[1]; stod130h3 = stod130h2; stod130h2 = stod130h1; stod130h1 = sto130d[1]; sto130index = index;} // 스토쌍봉, 쌍바닥 조건 만족시 봉 경과 제한함 if sto5k + 1 < sto5d and sto5k < sto5k[1] and sto5index + 5 >= index then { if sto5dh1 < sto5dh2 then { if sto5dh2 < sto5dh3 then {sto5down = 3;}// 스토10이 쓰리봉인 경우 else {sto5down = 2;}// 스토10이 쌍봉인 경우 } else if stok5h1 < stok5h2 and stod5h1 + 3 < stod5h2 then {sto5down = 2;} } if sto5k > sto5d + 1 and sto5k > sto5k[1] and sto5index + 5 >= index then { if sto5dL1 > sto5dL2 then { if sto5dL2 > sto5dL3 then {sto5up = 3;}// 스토10이 쓰리바닥인 경우 else {sto5up = 2;}// 스토10이 쌍바닥인 경우 } else if stok5L1 > stok5L2 and stod5L1 > stod5L2 + 2 then {sto5up = 2;} } if sto10k + 1 < sto10d and sto10k < sto10k[1] and sto10index + 5 >= index then { if sto10dh1 < sto10dh2 then { if sto10dh2 < sto10dh3 then {sto10down = 3;}// 스토10이 쓰리봉인 경우 else {sto10down = 2;}// 스토10이 쌍봉인 경우 } else if sto10dh2bar - sto10dh1bar < 8 then { if sto10dh1 < sto10dh3 then {sto10down = 2;} } else if stok10h1 < stok10h2 and stod10h1 + 3 < stod10h2 then {sto10down = 2;} else if sto10kh1 < sto10kh2 and sto10kh1 < sto10d[sto10kh1bar] and sto10kh1bar < 5 and sto10k < stoh then {sto10down = 2;} } if sto10k > sto10d + 1 and sto10k > sto10k[1] and sto10index + 5 >= index then { if sto10dL1 > sto10dL2 then { if sto10dL2 > sto10dL3 then {sto10up = 3;}// 스토10이 쓰리바닥인 경우 else {sto10up = 2;}// 스토10이 쌍바닥인 경우 } else if sto10dL2bar - sto10dL1bar < 8 then { if sto10dL1 > sto10dL3 then {sto10up = 2;} } else if stok10L1 > stok10L2 and stod10L1 > stod10L2 + 2 then {sto10up = 2;} else if sto10kL1 > sto10kL2 and sto10kL1 > sto10d[sto10kL1bar] and sto10kL1bar < 5 then {sto10up = 2;} } if sto20k + 1 < sto20d and sto20k < sto20k[1] and sto20index + 10 >= index then { if sto20dh1 < sto20dh2 then { if sto20dh2 < sto20dh3 then {sto20down = 3;}// 스토20이 쓰리봉인 경우 else {sto20down = 2;}// 스토20이 쌍봉인 경우 } else if sto20dh2bar - sto20dh1bar < 8 then { if sto20dh1 < sto20dh3 then {sto20down = 2;} } else if stok20h1 < stok20h2 and stod20h1 + 3 < stod20h2 then {sto20down = 2;} else if sto20kh1 < sto20kh2 and sto20kh1 < sto20d[sto20kh1bar] and sto20kh1bar < 5 and sto20k < stoh then {sto20down = 2;} } if sto20k > sto20d + 1 and sto20k > sto20k[1] and sto20index + 10 >= index then { if sto20dL1 > sto20dL2 then { if sto20dL2 > sto20dL3 then {sto20up = 3;}// 스토20이 쓰리바닥인 경우 else {sto20up = 2;}// 스토20이 쌍바닥인 경우 } else if sto20dL2bar - sto20dL1bar < 8 then { if sto20dL1 > sto20dL3 then {sto20up = 2;} } else if stok20L1 > stok20L2 and stod20L1 > stod20L2 + 2 then {sto20up = 2;} else if sto20kL1 > sto20kL2 and sto20kL1 > sto20d[sto20kL1bar] and sto20kL1bar < 5 then {sto20up = 2;} } if (sto65dh1 + 3 < sto65dh2 or (sto65dh1 < sto65dh2 and sto65dh1 < stoh) or sto65kh1 + 5 < sto65kh2 ) and sto65k < sto65d and sto65k < sto65k[1] and sto65index + 24 >= index then {sto65down = 2;}// 스토65이 쌍봉인 경우 if (sto65dL1 > sto65dL2 + 3 or (sto65dL1 > sto65dL2 and sto65dL1 > stoL) or sto65kL1 > sto65kL2 + 5 ) and sto65k > sto65d and sto65k > sto65k[1] and sto65index + 24 >= index then {sto65up = 2;}// 스토65이 쌍바닥인 경우 if (sto130dh1 + 3 < sto130dh2 or (sto130dh1 < sto130dh2 and sto130dh1 < stoh) or sto130kh1 + 5 < sto130kh2 ) and sto130k < sto130d and sto130k < sto130k[1] and sto130index + 24 >= index then {sto130down = 2;}// 스토130이 쌍봉인 경우 if (sto130dL1 > sto130dL2 + 3 or (sto130dL1 > sto130dL2 and sto130dL1 > stoL) or sto130kL1 > sto130kL2 + 5 ) and sto130k > sto130d and sto130k > sto130k[1] and sto130index + 24 >= index then {sto130up = 2;}// 스토130이 쌍바닥인 경우 // 스토쌍봉, 쌍바닥 조건 만족시 봉 경과 제한 없음. 단, stok의 방향은 확인 if sto10k + 1 < sto10d and sto10k < sto10k[1] then { if sto10dh1 < sto10dh2 then { if sto10dh2 < sto10dh3 then {sto10down1 = 3;}// 스토10이 쓰리봉인 경우 else {sto10down1 = 2;}// 스토10이 쌍봉인 경우 } else if stok10h1 < stok10h2 and stod10h1 + 3 < stod10h2 then {sto10down1 = 2;} else if sto10kh1 < sto10kh2 and sto10kh1 < sto10d[sto10kh1bar] and sto10k < stoh then {sto10down1 = 2;} } if sto10k > sto10d + 1 and sto10k > sto10k[1] then { if sto10dL1 > sto10dL2 then { if sto10dL2 > sto10dL3 then {sto10up1 = 3;}// 스토10이 쓰리바닥인 경우 else {sto10up1 = 2;}// 스토10이 쌍바닥인 경우 } else if stok10L1 > stok10L2 and stod10L1 > stod10L2 + 2 then {sto10up1 = 2;} else if sto10kL1 > sto10kL2 and sto10kL1 > sto10d[sto10kL1bar] then {sto10up1 = 2;} } if sto20k + 1 < sto20d and sto20k < sto20k[1] then { if sto20dh1 < sto20dh2 then { if sto20dh2 < sto20dh3 then {sto20down1 = 3;}// 스토20이 쓰리봉인 경우 else {sto20down1 = 2;}// 스토20이 쌍봉인 경우 } else if stok20h1 < stok20h2 and stod20h1 + 3 < stod20h2 then {sto20down1 = 2;} else if sto20kh1 < sto20kh2 and sto20kh1 < sto20d[sto20kh1bar] and sto20k < stoh then {sto20down1 = 2;} } if sto20k > sto20d + 1 and sto20k > sto20k[1] then { if sto20dL1 > sto20dL2 then { if sto20dL2 > sto20dL3 then {sto20up1 = 3;}// 스토20이 쓰리바닥인 경우 else {sto20up1 = 2;}// 스토20이 쌍바닥인 경우 } else if stok20L1 > stok20L2 and stod20L1 > stod20L2 + 2 then {sto20up1 = 2;} else if sto20kL1 > sto20kL2 and sto20kL1 > sto20d[sto20kL1bar] then {sto20up1 = 2;} } if (sto65dh1 + 3 < sto65dh2 or (sto65dh1 < sto65dh2 and sto65dh1 < stoh) or sto65kh1 + 5 < sto65kh2 ) and sto65k < sto65d and sto65k < sto65k[1] then {sto65down1 = 2;}// 스토65이 쌍봉인 경우 if (sto65dL1 > sto65dL2 + 3 or (sto65dL1 > sto65dL2 and sto65dL1 > stoL) or sto65kL1 > sto65kL2 + 5 ) and sto65k > sto65d and sto65k > sto65k[1] then {sto65up1 = 2;}// 스토65이 쌍바닥인 경우 if (sto130dh1 + 3 < sto130dh2 or (sto130dh1 < sto130dh2 and sto130dh1 < stoh) or sto130kh1 + 5 < sto130kh2 ) and sto130k < sto130d and sto130k < sto130k[1] then {sto130down1 = 2;}// 스토130이 쌍봉인 경우 if (sto130dL1 > sto130dL2 + 3 or (sto130dL1 > sto130dL2 and sto130dL1 > stoL) or sto130kL1 > sto130kL2 + 5 ) and sto130k > sto130d and sto130k > sto130k[1] then {sto130up1 = 2;}// 스토130이 쌍바닥인 경우 // 스토쌍봉, 쌍바닥 조건 만족시 봉 경과 제한 없음. 단, stod의 방향은 확인 if sto10k + 1 < sto10d and sto10d < sto10d[1] then { if sto10dh1 < sto10dh2 then { if sto10dh2 < sto10dh3 then {sto10down2 = 3;}// 스토10이 쓰리봉인 경우 else {sto10down2 = 2;}// 스토10이 쌍봉인 경우 } else if stok10h1 < stok10h2 and stod10h1 + 3 < stod10h2 then {sto10down2 = 2;} else if sto10kh1 < sto10kh2 and sto10kh1 < sto10d[sto10kh1bar] and sto10k < stoh then {sto10down2 = 2;} } if sto10k > sto10d + 1 and sto10d > sto10d[1] then { if sto10dL1 > sto10dL2 then { if sto10dL2 > sto10dL3 then {sto10up2 = 3;}// 스토10이 쓰리바닥인 경우 else {sto10up2 = 2;}// 스토10이 쌍바닥인 경우 } else if stok10L1 > stok10L2 and stod10L1 > stod10L2 + 2 then {sto10up2 = 2;} else if sto10kL1 > sto10kL2 and sto10kL1 > sto10d[sto10kL1bar] then {sto10up2 = 2;} } if sto20k + 1 < sto20d and sto20d < sto20d[1] then { if sto20dh1 < sto20dh2 then { if sto20dh2 < sto20dh3 then {sto20down2 = 3;}// 스토20이 쓰리봉인 경우 else {sto20down2 = 2;}// 스토20이 쌍봉인 경우 } else if stok20h1 < stok20h2 and stod20h1 + 3 < stod20h2 then {sto20down2 = 2;} else if sto20kh1 < sto20kh2 and sto20kh1 < sto20d[sto20kh1bar] and sto20k < stoh then {sto20down2 = 2;} } if sto20k > sto20d + 1 and sto20d > sto20d[1] then { if sto20dL1 > sto20dL2 then { if sto20dL2 > sto20dL3 then {sto20up2 = 3;}// 스토20이 쓰리바닥인 경우 else {sto20up2 = 2;}// 스토20이 쌍바닥인 경우 } else if stok20L1 > stok20L2 and stod20L1 > stod20L2 + 2 then {sto20up2 = 2;} else if sto20kL1 > sto20kL2 and sto20kL1 > sto20d[sto20kL1bar] then {sto20up2 = 2;} } if (sto65dh1 + 3 < sto65dh2 or (sto65dh1 < sto65dh2 and sto65dh1 < stoh) or sto65kh1 + 5 < sto65kh2 ) and sto65k < sto65d and sto65d < sto65d[1] then {sto65down2 = 2;}// 스토65이 쌍봉인 경우 if (sto65dL1 > sto65dL2 + 3 or (sto65dL1 > sto65dL2 and sto65dL1 > stoL) or sto65kL1 > sto65kL2 + 5 ) and sto65k > sto65d and sto65d > sto65d[1] then {sto65up2 = 2;}// 스토65이 쌍바닥인 경우 if (sto130dh1 + 3 < sto130dh2 or (sto130dh1 < sto130dh2 and sto130dh1 < stoh) or sto130kh1 + 5 < sto130kh2 ) and sto130k < sto130d and sto130d < sto130d[1] then {sto130down2 = 2;}// 스토130이 쌍봉인 경우 if (sto130dL1 > sto130dL2 + 3 or (sto130dL1 > sto130dL2 and sto130dL1 > stoL) or sto130kL1 > sto130kL2 + 5 ) and sto130k > sto130d and sto130d > sto130d[1] then {sto130up2 = 2;}// 스토130이 쌍바닥인 경우 // ---------- 스토10, 20의 과냉, 과열 여부 판단 ---------- // {stok10n20Lcon = 0; stok10or20Lcon = 0; stok10n20hcon = 0; stok10or20hcon = 0; stodL10n20Lcon = 0; stodL10or20Lcon = 0; stodh10n20hcon = 0; stodh10or20hcon = 0; stodL10n20upcon = 0; stodL10or20upcon = 0; stodh10n20downcon = 0; stodh10or20downcon = 0;} { if (sto20k[1] < stoL or sto20k < stoL) and (sto10k[1] < stoL or sto10k < stoL) then {stok10n20Lcon = 1;} if (sto20k[1] < stoL or sto10k[1] < stoL) or (sto20k < stoL or sto10k < stoL) then {stok10or20Lcon = 1;} if (sto20k[1] > stoh or sto20k > stoh) and (sto10k[1] > stoh or sto10k > stoh) then {stok10n20hcon = 1;} if (sto20k[1] > stoh or sto10k[1] > stoh) or (sto20k > stoh or sto10k > stoh) then {stok10or20hcon = 1;} if (sto10k < sto10dh1 and sto10d < sto10dh1 and sto10dh1 > stoh and (sto10dh1bar > 5 or (sto10dh1bar > 3 and sto10k < stoh))) and (sto20d < sto20dh1 and sto20dh1 > stoh and (sto20dh1bar > 5 or (sto20dh1bar > 3 and sto20k < stoh))) then {stodh10n20hcon = 1;} if (sto10k > sto10dL1 and sto10d > sto10dL1 and sto10dL1 < stoL and (sto10dL1bar > 5 or (sto10dL1bar > 3 and sto10k > stoL))) and (sto20d > sto20dL1 and sto20dL1 < stoL and (sto20dL1bar > 5 or (sto20dL1bar > 3 and sto20k > stoL))) then {stodL10n20Lcon = 1;} if (sto10k < sto10dh1 and sto10d < sto10dh1 and sto10dh1 > stoh and (sto10dh1bar > 5 or (sto10dh1bar > 3 and sto10k < stoh))) or (sto20d < sto20dh1 and sto20dh1 > stoh and (sto20dh1bar > 5 or (sto20dh1bar > 3 and sto20k < stoh))) then {stodh10or20hcon = 1;} if (sto10k > sto10dL1 and sto10d > sto10dL1 and sto10dL1 < stoL and (sto10dL1bar > 5 or (sto10dL1bar > 3 and sto10k > stoL))) or (sto20d > sto20dL1 and sto20dL1 < stoL and (sto20dL1bar > 5 or (sto20dL1bar > 3 and sto20k > stoL))) then {stodL10or20Lcon = 1;} if (sto10k < sto10dh1 and sto10d < sto10dh1 and (sto10dh1bar > 5 or (sto10dh1bar > 3 and sto10k < stoh))) and (sto20d < sto20dh1 and (sto20dh1bar > 5 or (sto20dh1bar > 3 and sto20k < stoh))) then {stodh10n20downcon = 1;} if (sto10k > sto10dL1 and sto10d > sto10dL1 and (sto10dL1bar > 5 or (sto10dL1bar > 3 and sto10k > stoL))) and (sto20d > sto20dL1 and (sto20dL1bar > 5 or (sto20dL1bar > 3 and sto20k > stoL))) then {stodL10n20upcon = 1;} if (sto10k < sto10dh1 and sto10d < sto10dh1 and (sto10dh1bar > 5 or (sto10dh1bar > 3 and sto10k < stoh))) or (sto20d < sto20dh1 and (sto20dh1bar > 5 or (sto20dh1bar > 3 and sto20k < stoh))) then {stodh10or20downcon = 1;} if (sto10k > sto10dL1 and sto10d > sto10dL1 and (sto10dL1bar > 5 or (sto10dL1bar > 3 and sto10k > stoL))) or (sto20d > sto20dL1 and (sto20dL1bar > 5 or (sto20dL1bar > 3 and sto20k > stoL))) then {stodL10or20upcon = 1;} } // ---------- 스토65, 130의 과냉, 과열 여부 판단 ---------- // {stok65n130Lcon = 0; stok65or130Lcon = 0; stok65n130hcon = 0; stok65or130hcon = 0; stodL65n130Lcon = 0; stodL65or130Lcon = 0; stodh65n130hcon = 0; stodh65or130hcon = 0; stodL65n130upcon = 0; stodL65or130upcon = 0; stodh65n130downcon = 0; stodh65or130downcon = 0;} { if (sto130k[1] < stoL or sto130k < stoL) and (sto65k[1] < stoL or sto65k < stoL) then {stok65n130Lcon = 1;} if (sto130k[1] < stoL or sto65k[1] < stoL) or (sto130k < stoL or sto65k < stoL) then {stok65or130Lcon = 1;} if (sto130k[1] > stoh or sto130k > stoh) and (sto65k[1] > stoh or sto65k > stoh) then {stok65n130hcon = 1;} if (sto130k[1] > stoh or sto65k[1] > stoh) or (sto130k > stoh or sto65k > stoh) then {stok65or130hcon = 1;} if (sto65k < sto65dh1 and sto65d < sto65dh1 and sto65dh1 > stoh and sto65dh1bar < sto65dL1bar) and (sto130d < sto130dh1 and sto130dh1 > stoh and sto130dh1bar < sto130dL1bar) then {stodh65n130hcon = 1;} if (sto65k > sto65dL1 and sto65d > sto65dL1 and sto65dL1 < stoL and sto65dL1bar < sto65dh1bar) and (sto130d > sto130dL1 and sto130dL1 < stoL and sto130dL1bar < sto130dh1bar) then {stodL65n130Lcon = 1;} if (sto65k < sto65dh1 and sto65d < sto65dh1 and sto65dh1 > stoh and sto65dh1bar < sto65dL1bar) or (sto130d < sto130dh1 and sto130dh1 > stoh and sto130dh1bar < sto130dL1bar) then {stodh65or130hcon = 1;} if (sto65k > sto65dL1 and sto65d > sto65dL1 and sto65dL1 < stoL and sto65dL1bar < sto65dh1bar) or (sto130d > sto130dL1 and sto130dL1 < stoL and sto130dL1bar < sto130dh1bar) then {stodL65or130Lcon = 1;} if (sto65k < sto65dh1 and sto65d < sto65dh1 and sto65dh1bar < sto65dL1bar) and (sto130d < sto130dh1 and sto130dh1bar < sto130dL1bar) then {stodh65n130downcon = 1;} if (sto65k > sto65dL1 and sto65d > sto65dL1 and sto65dL1bar < sto65dh1bar) and (sto130d > sto130dL1 and sto130dL1bar < sto130dh1bar) then {stodL65n130upcon = 1;} if (sto65k < sto65dh1 and sto65d < sto65dh1 and sto65dh1bar < sto65dL1bar) or (sto130d < sto130dh1 and sto130dh1bar < sto130dL1bar) then {stodh65or130downcon = 1;} if (sto65k > sto65dL1 and sto65d > sto65dL1 and sto65dL1bar < sto65dh1bar) or (sto130d > sto130dL1 and sto130dL1bar < sto130dh1bar) then {stodL65or130upcon = 1;} } // ---------- 호잔 이평의 쌍바닥, 쌍봉및 호잔의 - => + 또는 + => - 로 급변 여부 판단 ---------- // {bapup = 0; bapdown = 0; upbidaskcon =0; bfupbidaskcon =0; downbidaskcon =0; bfdownbidaskcon =0; borbfupbidaskcon = 0; borbfdownbidaskcon = 0;} { if baph1 < baph2 and ((bap < bap[1] and !(bidask > bidask[1] and bidask[1] > bidask[2])) or (bidask < 0 and bidask < bidask[1] and bidask[1] < bidask[2])) then {bapdown = 2;}// 호잔이평이 쌍봉인 경우 if bapL1 > bapL2 and ((bap > bap[1] and !(bidask < bidask[1] and bidask[1] < bidask[2])) or (bidask > 0 and bidask > bidask[1] and bidask[1] > bidask[2])) then {bapup = 2;}// 호잔이평이 쌍바닥인 경우 } { if dayindex() == 0 then {bidaskindex = 0;} if bidask > 0 and bidask[1] < 0 then {upbidaskcon = 1; bidaskindex = index;} if bidask < 0 and bidask[1] > 0 then {downbidaskcon = 1; bidaskindex = index;} } { if bidask[1] > 0 and bidask[2] < 0 then {bfupbidaskcon = 1;} if bidask[1] < 0 and bidask[2] > 0 then {bfdownbidaskcon = 1;} } { if upbidaskcon == 1 or bfupbidaskcon == 1 then {borbfupbidaskcon = 1;} if downbidaskcon == 1 or bfdownbidaskcon == 1 then {borbfdownbidaskcon = 1;} } { if dayindex() == 0 then {bidaskupcnt = 0; bidaskdowncnt = 0;} if bidask > 0 then {bidaskupcnt = bidaskupcnt + 1;}// 일중 호잔이 + 인 횟수 산출 if bidask < 0 then {bidaskdowncnt = bidaskdowncnt + 1;}// 일중 호잔이 - 인 횟수 산출 } // ---- 금일중 호잔의 상승반전, 또는 하락반전 여부 판단---// { if dayindex() == 0 then {dayupbidaskcon = 0; daydownbidaskcon = 0;} for count = dayindex() downto 1 begin//계산이 되는 총 봉의 갯수 { if upbidaskcon[count] == 1 then dayupbidaskcon = 1; if downbidaskcon[count] == 1 then daydownbidaskcon = 1; } End; } // ---------- 전일및 금일중 60이평선(일봉 5이평선)의 최고점, 최저점 검색 ----------// { if dayindex() == 0 then {daylestlp1 = lp1; dayhestlp1 = lp1; dayopenlp1 = lp1; bfdaycloselp = lp[1]; dayopenlp = lp; bfdaylestlp1 = daylestlp1[1]; bfdayhestlp1 = dayhestlp1[1]; bfdayopenlp1 = dayopenlp1[1]; daylp1L1bar = 0; daylp1h1bar = 0;} else if dayindex() > 0 then { if daylestlp1 > lp1[1] then daylestlp1 = lp1[1]; if dayhestlp1 < lp1[1] then dayhestlp1 = lp1[1]; } } { if lp1L1 > lp1L2 then { if lp1[1] == lp1L1 then {daylp1L1bar = index - 1;} if lp1[2] == lp1L1 then {daylp1L1bar = index - 2;} if lp1[3] == lp1L1 then {daylp1L1bar = index - 3;} } if lp1h1 < lp1h2 then { if lp1[1] == lp1h1 then {daylp1h1bar = index - 1;} if lp1[2] == lp1h1 then {daylp1h1bar = index - 2;} if lp1[3] == lp1h1 then {daylp1h1bar = index - 3;} } } // ---------- 전일및 금일중 봉의 상승, 하락의 최대값 산출 ----------// { if dayindex() == 0 then { dayopenupV = upV; dayopendownV = downV; dayopenC = C; dayupVcnt = 0; daydownVcnt = 0; dayupVsum = 0; daydownVsum = 0; if C >= O then {daybgstupV = upV; daybgstdownV = 0; dayupVcnt = dayupVcnt + 1; dayupVsum = dayupVsum + upV;} if C <= O then {daybgstupV = 0; daybgstdownV = downV; daydownVcnt = daydownVcnt + 1; daydownVsum = daydownVsum + downV;} bfdaybgstupV = daybgstupV[1]; bfdaybgstdownV = daybgstdownV[1]; } if dayindex() > 0 then { if daybgstupV < upV[1] then daybgstupV = upV[1]; if daybgstdownV < downV[1] then daybgstdownV = downV[1]; if C > O then {dayupVcnt = dayupVcnt + 1; dayupVsum = dayupVsum + upV;} if C < O then {daydownVcnt = daydownVcnt + 1; daydownVsum = daydownVsum + downV;} } } bgstupVcon = 0; bgstdownVcon = 0; { if ((upV > bfdaybgstdownV and upV >= daybgstdownV) or (upV >= bfdaybgstdownV and upV > daybgstdownV)) then {bgstupVcon = 1;} if ((downV > bfdaybgstupV and downV >= daybgstupV) or (downV >= bfdaybgstupV and downV > daybgstupV)) then {bgstdownVcon = 1;} } dayupVavg = 0; daydownVavg = 0; { dayupVavg = dayupVsum / dayupVcnt; daydownVavg = daydownVsum / daydownVcnt; } // ---------- 전일및 금일중 최대거래량 산출 ----------// if dayindex() == 0 Then { dayopenvol = V; //당일 첫봉 거래량 bfdayopenvol = dayopenvol[1]; //전일 첫봉 거래량 daybgstvol = V; // 금일 최고 거래량 초기화 bfdaybgstvol = daybgstvol[1]; //전일최고거래량 } if dayindex() > 0 Then { if V[1] > daybgstvol Then daybgstvol = V[1]; //당일 최고거래량 } bgstvolcon = 0; { if V > daybgstvol or V > bfdaybgstvol then {bgstvolcon = 1;} } // ---- 전일중 봉의 고가, 저가가 30분 20이평선및 720이평선위 또는 밑에 있는지 여부 판단 ---// if dayindex() == 0 then { bfdayuplpcnt = 0; bfdaydownlpcnt = 0; bfdayuplp4cnt = 0; bfdaydownlp4cnt = 0; for count = 12 downto 1 begin//계산이 되는 총 봉의 갯수 { if C[count] > lp[count] then bfdayuplpcnt = bfdayuplpcnt + 1; if C[count] < lp[count] then bfdaydownlpcnt = bfdaydownlpcnt + 1; if C[count] > lp4[count] then bfdayuplp4cnt = bfdayuplp4cnt + 1; if C[count] < lp4[count] then bfdaydownlp4cnt = bfdaydownlp4cnt + 1; } End; } // ---- 금일중 봉의 고가, 저가가 30분 20이평선및 720이평선위 또는 밑에 있는지 여부 판단 ---// { dayuplpcnt = 0; daydownlpcnt = 0; dayuplp4cnt = 0; daydownlp4cnt = 0; for count = dayindex() downto 1 begin//계산이 되는 총 봉의 갯수 { if C[count] > lp[count] then dayuplpcnt = dayuplpcnt + 1; if C[count] < lp[count] then daydownlpcnt = daydownlpcnt + 1; if C[count] > lp4[count] then dayuplp4cnt = dayuplp4cnt + 1; if C[count] < lp4[count] then daydownlp4cnt = daydownlp4cnt + 1; } End; } // ---- 최근 봉 15개의 최고가, 최저가를 산출하여 폭에 따라 청산 금지 여부 판단 ---// {bar12high = H[11]; bar12low = L[11]; bar12dep = H - L;}//초기화 //if dayindex() > 4 then { for count = 11 downto 0 begin//계산이 되는 총 봉의 갯수 { if H[count] > bar12high then bar12high = H[count]; if L[count] < bar12low then bar12low = L[count]; // 1씩 차감함 } End; bar12dep = bar12high - bar12low; } // ---- 최근 봉 5개의 최고가, 최저가의 평균을 산출하여 폭에 따라 청산 여부 판단 ---// {bar6high = H[5]; bar6low = L[5]; bar6dep = H - L; bar6highavg = 0; bar6lowavg = 0; bar6highsum = 0; bar6lowsum = 0;} //if dayindex() > 4 then { for count = 5 downto 0 begin//계산이 되는 총 봉의 갯수 { if H[count] > bar6high then bar6high = H[count]; if L[count] < bar6low then bar6low = L[count]; bar6highsum = bar6highsum + H[count]; bar6lowsum = bar6lowsum + L[count]; } End; bar6dep = bar6high - bar6low; bar6highavg = bar6highsum / 6; bar6lowavg = bar6lowsum / 6; } // ---------- 투자 심리도 작성 ----------// //if C >= dayopen(0) then { simsumV = 0; for simcount = 0 to simperiod-1 begin //계산이 되는 총 봉의 갯수 if dayclose(simcount) > dayclose(simcount+1) then { //현재봉이 전봉보다 클 경우 simsumV = simsumV+1; // 1씩 누적함 } End; simri = simsumV/simperiod*100; //총 투적한 값을 기간으로 나누어줌 } // ---- 금일중 장기이평선및 이격도, 투심의 최고가, 최저가 산출---// { if dayindex() == 0 then {daylowlp2 = lp2; dayhighlp2 = lp2; daylowlp3 = lp3; dayhighlp3 = lp3; daylowlp4 = lp4; dayhighlp4 = lp4; daylowdisplp3 = displp3; dayhighdisplp3 = displp3; daylowsimri = simri; dayhighsimri = simri;} for count = dayindex() downto 1 begin//계산이 되는 총 봉의 갯수 { if lp2[count] > dayhighlp2 then dayhighlp2 = lp2[count]; if lp2[count] < daylowlp2 then daylowlp2 = lp2[count]; if lp3[count] > dayhighlp3 then dayhighlp3 = lp3[count]; if lp3[count] < daylowlp3 then daylowlp3 = lp3[count]; if lp4[count] > dayhighlp4 then dayhighlp4 = lp4[count]; if lp4[count] < daylowlp4 then daylowlp4 = lp4[count]; if displp3[count] > dayhighdisplp3 then dayhighdisplp3 = displp3[count]; if displp3[count] < daylowdisplp3 then daylowdisplp3 = displp3[count]; if simri[count] > dayhighsimri then dayhighsimri = simri[count]; if simri[count] < daylowsimri then daylowsimri = simri[count]; } End; } // ---------- 봉 평균값 작성 ----------// { plusb = 0; minusb = 0; plusc = 0; minusc = 0; plusbm = 0; minusbm = 0; for barcount = 0 to barperiod-1 begin //계산이 되는 총 봉의 갯수 if C[barcount] > O[barcount] then { plusb = plusb + C[barcount] - O[barcount]; plusc = plusc + 1; } if C[barcount] < O[barcount] then { minusb = minusb + O[barcount] - C[barcount]; minusc = minusc + 1; // 1씩 누적함 } End if plusc > 0 then {plusbm = plusb/plusc;} if minusc > 0 then {minusbm = minusb/minusc;} //봉값누적분을 봉갯수로 나누어줌 } // ---------- 횡보후 상승및 하락 여부 판단 루틴 ---------- // {uphbbarcon = 0; uphb5con = 0; uphb10con = 0; uphb20con = 0; uphbbapcon = 0; downhbbarcon = 0; downhb5con = 0; downhb10con = 0; downhb20con = 0; downhbbapcon = 0;} { if (C[1] - C[3] < C - C[1] and C[1] - C[3] >= -0.1) or (C[1] - C[2] < C - C[1] and C[1] - C[2] > 0) then {uphbbarcon = 1;} if ((sp[1] - sp[3] < sp - sp[1] and sp[1] - sp[3] >= -0.1) or (sp[1] - sp[2] < sp - sp[1] and sp[1] - sp[2] > 0) or (sp[2] - sp[3] < sp[1] - sp[2] and sp[2] - sp[3] > 0 and C > O and C[1] > O[1] and C[1] > H[2] and upV > upV1)) and sp > sp[1] then {uphb5con = 1;} if ((mp[1] - mp[3] < mp - mp[1] and mp[1] - mp[3] >= -0.1) or (mp[1] - mp[2] < mp - mp[1] and mp[1] - mp[2] > 0) or (mp[2] - mp[3] < mp[1] - mp[2] and mp[2] - mp[3] > 0 and C > O and C[1] > O[1] and C[1] > H[2] and upV > upV1)) and mp > mp[1] then {uphb10con = 1;} if ((lp[1] - lp[3] < lp - lp[1] and lp[1] - lp[3] >= -0.1) or (lp[1] - lp[2] < lp - lp[1] and lp[1] - lp[2] > 0) or (lp[2] - lp[3] < lp[1] - lp[2] and lp[2] - lp[3] > 0 and C > O and C[1] > O[1] and C[1] > H[2] and upV > upV1)) and lp > lp[1] then {uphb20con = 1;} if ((bap[1] - bap[3] < bap - bap[1] and bap[1] - bap[3] >= -0.1) or (bap[1] - bap[2] < bap - bap[1] and bap[1] - bap[2] > 0) or (bap[2] - bap[3] < bap[1] - bap[2] and bap[2] - bap[3] > 0 and C > O and C[1] > O[1] and C[1] > H[2] and upV > upV1)) and bap > bap[1] then {uphbbapcon = 1;} } { if (C[1] - C[3] > C - C[1] and C[1] - C[3] <= 0.1) or (C[1] - C[2] > C - C[1] and C[1] - C[2] < 0) then {downhbbarcon = 1;} if ((sp[1] - sp[3] > sp - sp[1] and sp[1] - sp[3] <= 0.1) or (sp[1] - sp[2] > sp - sp[1] and sp[1] - sp[2] < 0) or (sp[2] - sp[3] > sp[1] - sp[2] and sp[2] - sp[3] < 0 and C < O and C[1] < O[1] and C[1] < L[2] and downV > downV1)) and sp < sp[1] then {downhb5con = 1;} if ((mp[1] - mp[3] > mp - mp[1] and mp[1] - mp[3] <= 0.1) or (mp[1] - mp[2] > mp - mp[1] and mp[1] - mp[2] < 0) or (mp[2] - mp[3] > mp[1] - mp[2] and mp[2] - mp[3] < 0 and C < O and C[1] < O[1] and C[1] < L[2] and downV > downV1)) and mp < mp[1] then {downhb10con = 1;} if ((lp[1] - lp[3] > lp - lp[1] and lp[1] - lp[3] <= 0.1) or (lp[1] - lp[2] > lp - lp[1] and lp[1] - lp[2] < 0) or (lp[2] - lp[3] > lp[1] - lp[2] and lp[2] - lp[3] < 0 and C < O and C[1] < O[1] and C[1] < L[2] and downV > downV1)) and lp < lp[1] then {downhb20con = 1;} if ((bap[1] - bap[3] > bap - bap[1] and bap[1] - bap[3] <= 0.1) or (bap[1] - bap[2] > bap - bap[1] and bap[1] - bap[2] < 0) or (bap[2] - bap[3] > bap[1] - bap[2] and bap[2] - bap[3] < 0 and C < O and C[1] < O[1] and C[1] < L[2] and downV > downV1)) and bap < bap[1] then {downhbbapcon = 1;} } // ---------- 정배열, 역배열 공통 루틴 ---------- // {jeong = 0; yeog = 0; bfjeong = 0; bfyeog = 0;} { if sp >= mp and mp > lp and sp > sp[1] and mp > mp[1] and lp > lp[1] then { if lp >= lp1 and lp1 > lp1[1] then {jeong = 2;} else {jeong = 1;} } if sp <= mp and mp < lp and sp < sp[1] and mp < mp[1] and lp < lp[1] then { if lp <= lp1 and lp1 < lp1[1] then {yeog = 2;} else {yeog = 1;} } } { if sp[1] >= mp[1] and mp[1] > lp[1] and sp[1] > sp[2] and mp[1] > mp[2] and lp[1] > lp[2] then { if lp[1] >= lp1[1] and lp1[1] > lp1[2] then {bfjeong = 2;} else {bfjeong = 1;} } if sp[1] <= mp[1] and mp[1] < lp[1] and sp[1] < sp[2] and mp[1] < mp[2] and lp[1] < lp[2] then { if lp[1] <= lp1[1] and lp1[1] < lp1[2] then {bfyeog = 2;} else {bfyeog = 1;} } } // ---------- 이평선(5,10,20,60,120,240,720)의 배열 상태로 추세 판단 ---------- // spdupcon = 0; { if sp > sp[1] and spL1 > spL2 then {spdupcon = 1;} if sp < sp[1] and sph1 < sph2 then {spdupcon = -1;} } mpdupcon = 0; { if mp > mp[1] and mpL1 > mpL2 then {mpdupcon = 1;} if mp < mp[1] and mph1 < mph2 then {mpdupcon = -1;} } lpdupcon = 0; { if lp > lp[1] and lpL1 > lpL2 then {lpdupcon = 1;} if lp < lp[1] and lph1 < lph2 then {lpdupcon = -1;} } spmpdupcon = 0; { if ((spdupcon > 0 and spL1 > mp) or (uphb5con == 1 and sp[3] >= mp[3])) and mp > mp[1] and sp > mp then {spmpdupcon = 1;} if ((spdupcon < 0 and sph1 < mp) or (downhb5con == 1 and sp[3] <= mp[3])) and mp < mp[1] and sp < mp then {spmpdupcon = -1;} } splpdupcon = 0; { if ((spdupcon > 0 and spL1 > lp) or (uphb5con == 1 and sp[3] >= lp[3])) and lp > lp[1] and sp > lp then {splpdupcon = 1;} if ((spdupcon < 0 and sph1 < lp) or (downhb5con == 1 and sp[3] <= lp[3])) and lp < lp[1] and sp < lp then {splpdupcon = -1;} } mplpdupcon = 0; { if ((mpdupcon > 0 and mpL1 > lp) or (uphb10con == 1 and mp[3] >= lp[3])) and lp > lp[1] and mp > lp then {mplpdupcon = 1;} if ((mpdupcon < 0 and mph1 < lp) or (downhb10con == 1 and mp[3] <= lp[3])) and lp < lp[1] and mp < lp then {mplpdupcon = -1;} } spmpnlpdupcon = 0; { if spmpdupcon == 1 or splpdupcon == 1 or mplpdupcon == 1 then spmpnlpdupcon = 1; if spmpdupcon == -1 or splpdupcon == -1 or mplpdupcon == -1 then spmpnlpdupcon = -1; } splp1dupcon = 0; { if ((spdupcon > 0 and spL1 > lp1) or (uphb5con == 1 and sp[3] >= lp1[3])) and lp1 > lp1[1] and sp > lp1 then {splp1dupcon = 1;} if ((spdupcon < 0 and sph1 < lp1) or (downhb5con == 1 and sp[3] <= lp1[3])) and lp1 < lp1[1] and sp < lp1 then {splp1dupcon = -1;} } mplp1dupcon = 0; { if ((mpdupcon > 0 and mpL1 > lp1) or (uphb10con == 1 and mp[3] >= lp1[3])) and lp1 > lp1[1] and mp > lp1 then {mplp1dupcon = 1;} if ((mpdupcon < 0 and mph1 < lp1) or (downhb10con == 1 and mp[3] <= lp1[3])) and lp1 < lp1[1] and mp < lp1 then {mplp1dupcon = -1;} } lplp1dupcon = 0; { if ((lpdupcon > 0 and lpL1 > lp1) or (uphb20con == 1 and lp[3] >= lp1[3])) and lp1 > lp1[1] and lp > lp1 then {lplp1dupcon = 1;} if ((lpdupcon < 0 and lph1 < lp1) or (downhb20con == 1 and lp[3] <= lp1[3])) and lp1 < lp1[1] and lp < lp1 then {lplp1dupcon = -1;} } mplp2dupcon = 0; { if ((mpdupcon > 0 and mpL1 > lp2) or (uphb10con == 1 and mp[3] >= lp2[3])) and lp2 > lp2[1] and mp > lp2 then {mplp2dupcon = 1;} if ((mpdupcon < 0 and mph1 < lp2) or (downhb10con == 1 and mp[3] <= lp2[3])) and lp2 < lp2[1] and mp < lp2 then {mplp2dupcon = -1;} } lplp2dupcon = 0; { if ((lpdupcon > 0 and lpL1 > lp2) or (uphb20con == 1 and lp[3] >= lp2[3])) and lp2 > lp2[1] and lp > lp2 then {lplp2dupcon = 1;} if ((lpdupcon < 0 and lph1 < lp2) or (downhb20con == 1 and lp[3] <= lp2[3])) and lp2 < lp2[1] and lp < lp2 then {lplp2dupcon = -1;} } mplpnlp12dupcon = 0; { if mplp1dupcon == 1 or lplp1dupcon == 1 or mplp2dupcon == 1 or lplp2dupcon == 1 then mplpnlp12dupcon = 1; if mplp1dupcon == -1 or lplp1dupcon == -1 or mplp2dupcon == -1 or lplp2dupcon == -1 then mplpnlp12dupcon = -1; } lp1dupcon = 0; { if sp > lp1 and lp1L1 > lp1L2 and lp1 > lp1[1] and lp1[1] > lp1[2] and lp1L1bar < 36 then {lp1dupcon = 1;} if sp < lp1 and lp1h1 < lp1h2 and lp1 < lp1[1] and lp1[1] < lp1[2] and lp1h1bar < 36 then {lp1dupcon = -1;} } lp2dupcon = 0; { if sp > lp2 and lp2L1 > lp2L2 and lp2 > lp2[1] and lp2L1bar < 36 then {lp2dupcon = 1;} if sp < lp2 and lp2h1 < lp2h2 and lp2 < lp2[1] and lp2h1bar < 36 then {lp2dupcon = -1;} } spnlp1234con = 0; { if sp > lp1 and sp > lp2 and sp > lp3 then { if sp > lp4 then {spnlp1234con = 2;} else {spnlp1234con = 1;} } if sp < lp1 and sp < lp2 and sp < lp3 then { if sp < lp4 then {spnlp1234con = -2;} else {spnlp1234con = -1;} } } Cnlp1234con = 0; { if C > lp1 and C > lp2 and C > lp3 then { if C > lp4 then {Cnlp1234con = 2;} else {Cnlp1234con = 1;} } if C < lp1 and C < lp2 and C < lp3 then { if C < lp4 then {Cnlp1234con = -2;} else {Cnlp1234con = -1;} } } splp01dr = 0; { if sp > lp and lp > lp1 and lp > lp[1] and (lp1 > lp1[1] or (sp > lp1 and lp1 > daylestlp1 and lp1[1] > lp1[2])) then {splp01dr = 1;} if sp < lp and lp < lp1 and lp < lp[1] and lp1 < lp1[1] then {splp01dr = -1;} } splp1234dr = 0; { if sp > lp1 and (lp1 > lp1[1] or (sp > lp1 and lp1 > daylestlp1 and lp1[1] > lp1[2])) then { if lp1 >= lp2 and lp2 > lp2[1] and lp2 >= lp3 and lp3 > lp3[1] and lp3 >= lp4 and lp4 > lp4[1] then {splp1234dr = 4;}// 장기 상승추세인 경우 else if lp1 >= lp2 and lp2 > lp2[1] and lp2 >= lp3 and lp3 > lp3[1] then {splp1234dr = 3;} else if lp1 >= lp2 and lp2 > lp2[1] then {splp1234dr = 2;} else {splp1234dr = 1;} } if sp < lp1 and lp1 < lp1[1] then { if lp1 <= lp2 + 0.1 and lp2 < lp2[1] and lp2 <= lp3 and lp3 < lp3[1] and lp3 <= lp4 and lp4 < lp4[1] then {splp1234dr = -4;} else if lp1 <= lp2 + 0.1 and lp2 < lp2[1] and lp2 <= lp3 and lp3 < lp3[1] then {splp1234dr = -3;} else if lp1 <= lp2 + 0.1 and lp2 < lp2[1] then {splp1234dr = -2;} else {splp1234dr = -1;} } } lp0123dr = 0; { if lp >= lp1 and lp > lp[1] and (lp1 > lp1[1] or (sp > lp1 and lp1 > daylestlp1 and lp1[1] > lp1[2])) then {lp0123dr = 1;}// 초기 상승추세인 경우 if lp >= lp1 and lp > lp[1] and (lp1 > lp1[1] or (sp > lp1 and lp1 > daylestlp1 and lp1[1] > lp1[2])) then { if (lp1 >= lp2 and lp2 > lp2[1] ) or (lp1 >= lp3 and lp3 > lp3[1] ) then { if sp > lp2 and sp > lp3 and lp2 > lp2[1] and lp3 > lp3[1] then {lp0123dr = 2;}// 중기 상승추세인 경우 } if lp1 >= lp2 and lp2 >= lp3 and lp2 > lp2[1] then {lp0123dr = 2;}// 장기 상승추세인 경우 if lp1 >= lp2 and lp2 >= lp3 and lp2 > lp2[1] and lp3 > lp3[1] then {lp0123dr = 3;}// 장기 상승추세인 경우 } } { if lp <= lp1 and lp < lp[1] and lp1 < lp1[1] then {lp0123dr = -1;}//초기 하락추세인 경우 if lp <= lp1 and lp < lp[1] and lp1 < lp1[1] then { if (lp1 <= lp2 + Faddbox and lp2 < lp2[1] ) or (lp1 <= lp3 + Faddbox and lp3 < lp3[1] ) then { if sp < lp2 and sp < lp3 and lp2 < lp2[1] and lp3 < lp3[1] then {lp0123dr = -2;}// 중기 하락추세인 경우 } if lp1 <= lp2 + Faddbox and (lp2 <= lp3 + Faddbox or spnlp1234con < 0) and lp2 < lp2[1] then {lp0123dr = -2;}// 장기 하락추세인 경우 if lp1 <= lp2 + Faddbox and lp2 <= lp3 + Faddbox and lp2 < lp2[1] and lp3 < lp3[1] then {lp0123dr = -3;}// 장기 하락추세인 경우 } } lp123dr = 0; { if lp1 >= lp2 and lp2 >= lp3 and lp1 > lp1[1] and lp2 > lp2[1] then { if lp3 > lp3[1] then {lp123dr = 2;} else {lp123dr = 1;} } if lp1 <= lp2 and lp2 <= lp3 and lp1 < lp1[1] and lp2 < lp2[1] then { if lp3 < lp3[1] then {lp123dr = -2;} else {lp123dr = -1;} } } lp023dr = 0; { if lp1 >= lp2 and lp2 >= lp3 and lp2 > lp2[1] and lp3 > lp3[1] then { if lp3 >= lp4 or (lp >= lp2 and lp > lp[1] and (lp[1] > lp[2] or jeong > 0 or sp > lp)) then {lp023dr = 1;}// 중기 상승추세인 경우 } if lp1 <= lp2 and lp2 <= lp3 and lp2 < lp2[1] and lp3 < lp3[1] then { if lp3 <= lp4 or (lp <= lp2 and lp < lp[1] and (lp[1] < lp[2] or yeog > 0 or sp < lp)) then {lp023dr = -1;}// 중기 상승추세인 경우 } } lp1234dr = 0; { if lp1 >= lp2 and lp2 >= lp3 - 0.05 and (lp1 > lp1[1] or (sp > lp1 and lp1 > daylestlp1 and lp1[1] > lp1[2])) and lp2 > lp2[1] and lp3 > lp3[1] then { if lp3 >= lp4 and lp4 > lp4[1] then {lp1234dr = 2;}// 장기 상승추세인 경우 else {lp1234dr = 1;}// 장기 상승추세인 경우 } if lp1 <= lp2 + 0.1 and lp2 <= lp3 and lp1 < lp1[1] and lp2 < lp2[1] and lp3 < lp3[1] then { if lp3 <= lp4 and lp4 < lp4[1] then {lp1234dr = -2;}// 장기 하락추세인 경우 else {lp1234dr = -1;}// 장기 하락추세인 경우 } } bflp1234dr = 0; { if lp1[1] >= lp2[1] and lp2[1] >= lp3[1] and lp1[1] > lp1[2] and lp2[1] > lp2[2] and lp3[1] > lp3[2] then { if lp3[1] >= lp4[1] and lp4[1] > lp4[2] then {bflp1234dr = 2;}// 장기 상승추세인 경우 else {bflp1234dr = 1;}// 장기 상승추세인 경우 } if lp1[1] <= lp2[1] + Faddbox and lp2[1] <= lp3[1] and lp1[1] < lp1[2] and lp2[1] < lp2[2] and lp3[1] < lp3[2] then { if lp3[1] <= lp4[1] and lp4[1] < lp4[2] then {bflp1234dr = -2;}// 장기 하락추세인 경우 else {bflp1234dr = -1;}// 장기 하락추세인 경우 } } lp124dr = 0; { if lp1 >= lp2 and lp2 >= lp4 and lp1 > lp1[1] and lp2 > lp2[1] and lp4 > lp4[1] then {lp124dr = 1;}// 장기 상승추세인 경우 if lp1 <= lp2 and lp2 <= lp4 and lp1 < lp1[1] and lp2 < lp2[1] and lp4 < lp4[1] then {lp124dr = -1;}// 장기 하락추세인 경우 } lp134dr = 0; { if lp1 >= lp3 and lp3 >= lp4 and lp1 > lp1[1] and lp3 > lp3[1] and lp4 > lp4[1] then {lp134dr = 1;}// 장기 상승추세인 경우 if lp1 <= lp3 and lp3 <= lp4 and lp1 < lp1[1] and lp3 < lp3[1] and lp4 < lp4[1] then {lp134dr = -1;}// 장기 하락추세인 경우 } lp234dr = 0; // 좌측클리어루틴 적용시 수익이 많이 저하되는 원인규명후 적용해야 함. { if lp2 >= lp3 and lp3 >= lp4 and lp2 > lp2[1] and lp3 > lp3[1] and lp4 > lp4[1] and ((lp1 >= lp2 - 0.5 or (lp1 >= lp2 - 1 and lp123convercon == 0) or (lp1 > lp1[1] and lp1 >= lp3)) or (lp1 > lp3 and C > lp1 and C > lp2 and boxupcnt > 1)) then {lp234dr = 1;}// 장기 상승추세인 경우 if lp2 <= lp3 and lp3 <= lp4 and lp2 < lp2[1] and lp3 < lp3[1] and lp4 < lp4[1] and ((lp1 <= lp2 + 0.5 or (lp1 <= lp2 + 1 and lp123convercon == 0) or (lp1 < lp1[1] and lp1 <= lp3)) or (lp1 < lp3 and C < lp1 and C < lp2 and boxdowncnt > 1)) then {lp234dr = -1;}// 장기 하락추세인 경우 } {uplonglpdr = 0; downlonglpdr = 0;} { if (lp1234dr > 0 or lp123dr > 0 or lp134dr > 0 or lp124dr > 0 or lp023dr > 0 or lp234dr > 0) then {uplonglpdr = 1;} if (lp1234dr < 0 or lp123dr < 0 or lp134dr < 0 or lp124dr < 0 or lp023dr < 0 or lp234dr < 0) then {downlonglpdr = 1;} } {uplongtrend = 0; downlongtrend = 0;} { if (lp1234dr > 0 or lp123dr > 0 or lp134dr > 0 or lp124dr > 0 or lp023dr > 0 or lp234dr > 0) or (lp1dupcon > 0 and uplonglpdr >= 0) then {uplongtrend = 1;} if (lp1234dr < 0 or lp123dr < 0 or lp134dr < 0 or lp124dr < 0 or lp023dr < 0 or lp234dr < 0) or (lp1dupcon < 0 and downlonglpdr >= 0) then {downlongtrend = 1;} } shorttrend = 0; { if spmpdupcon > 0 or splpdupcon > 0 or mplpdupcon > 0 then {shorttrend = 1;} if spmpdupcon < 0 or splpdupcon < 0 or mplpdupcon < 0 then {shorttrend = -1;} } midtrend = 0; { if mplp1dupcon > 0 or lplp1dupcon > 0 or splp01dr > 0 or lp0123dr > 0 then {midtrend = 1;} if mplp1dupcon < 0 or lplp1dupcon < 0 or splp01dr < 0 or lp0123dr < 0 then {midtrend = -1;} } // ---------- 상향시 이평선의 저항및 하향시 이평선의 지지를 판단 ---------- // {lp1crupresist = 0; lp2crupresist = 0; lp3crupresist = 0; lp4crupresist = 0; lpcrupresist = 0; lp1crdownresist = 0; lp2crdownresist = 0; lp3crdownresist = 0; lp4crdownresist = 0; lpcrdownresist = 0;} {// 앞의 봉 또는 현재봉이 이평선돌파 후 현재봉이 다시 그 이평선 지지, 저항받는 모습 if (H[1] > lp1 or H > lp1 or dayhigh(0)[1] > lp1) and C < lp1 then {lp1crupresist = 1;} if (H[1] > lp2 or H > lp2 or dayhigh(0)[1] > lp2) and C < lp2 then {lp2crupresist = 1; lpcrupresist = lpcrupresist + 1;} if (H[1] > lp3 or H > lp3 or dayhigh(0)[1] > lp3) and C < lp3 then {lp3crupresist = 1; lpcrupresist = lpcrupresist + 1;} if (H[1] > lp4 or H > lp4 or dayhigh(0)[1] > lp4) and C < lp4 then {lp4crupresist = 1; lpcrupresist = lpcrupresist + 1;} if (L[1] < lp1 or L < lp1 or daylow(0)[1] < lp1) and C > lp1 then {lp1crdownresist = 1;} if (L[1] < lp2 or L < lp2 or daylow(0)[1] < lp2) and C > lp2 then {lp2crdownresist = 1; lpcrdownresist = lpcrdownresist + 1;} if (L[1] < lp3 or L < lp3 or daylow(0)[1] < lp3) and C > lp3 then {lp3crdownresist = 1; lpcrdownresist = lpcrdownresist + 1;} if (L[1] < lp4 or L < lp4 or daylow(0)[1] < lp4) and C > lp4 then {lp4crdownresist = 1; lpcrdownresist = lpcrdownresist + 1;} } {lp1shupresist = 0; lp2shupresist = 0; lp3shupresist = 0; lp4shupresist = 0; lpshupresist = 0; lp1shdownresist = 0; lp2shdownresist = 0; lp3shdownresist = 0; lp4shdownresist = 0; lpshdownresist = 0;} {// 일중 최고가 또는 최저가가 이평선돌파 후 현재 봉이 다시 그 이평선 지지, 저항받는 모습 if dayhigh(0) > lp1 - 1 and C < lp1 then {lp1shupresist = 1;} if dayhigh(0) > lp2 - 1 and C < lp2 then {lp2shupresist = 1; lpshupresist = lpshupresist + 1;} if dayhigh(0) > lp3 - 1 and C < lp3 then {lp3shupresist = 1; lpshupresist = lpshupresist + 1;} if dayhigh(0) > lp4 - 1 and C < lp4 then {lp4shupresist = 1; lpshupresist = lpshupresist + 1;} if daylow(0) < lp1 + 1 and C > lp1 then {lp1shdownresist = 1;} if daylow(0) < lp2 + 1 and C > lp2 then {lp2shdownresist = 1; lpshdownresist = lpshdownresist + 1;} if daylow(0) < lp3 + 1 and C > lp3 then {lp3shdownresist = 1; lpshdownresist = lpshdownresist + 1;} if daylow(0) < lp4 + 1 and C > lp4 then {lp4shdownresist = 1; lpshdownresist = lpshdownresist + 1;} } {lp1crupcon = 0; lp2crupcon = 0; lp3crupcon = 0; lp4crupcon = 0; lpcrupcon = 0; lp1crdowncon = 0; lp2crdowncon = 0; lp3crdowncon = 0; lp4crdowncon = 0; lpcrdowncon = 0;} {// 앞의 봉 또는 현재봉이 이평선돌파 후 현재봉이 다시 그 이평선 지지, 저항받는 모습 if (H[1] > lp1 or H > lp1) and C < lp1 + 0.5 then {lp1crupcon = 1;} if (H[1] > lp2 or H > lp2) and C < lp2 + 0.5 then {lp2crupcon = 1; lpcrupcon = lpcrupcon + 1;} if (H[1] > lp3 or H > lp3) and C < lp3 + 0.5 then {lp3crupcon = 1; lpcrupcon = lpcrupcon + 1;} if (H[1] > lp4 or H > lp4) and C < lp4 + 0.5 then {lp4crupcon = 1; lpcrupcon = lpcrupcon + 1;} if (L[1] < lp1 or L < lp1) and C > lp1 - 0.5 then {lp1crdowncon = 1;} if (L[1] < lp2 or L < lp2) and C > lp2 - 0.5 then {lp2crdowncon = 1; lpcrdowncon = lpcrdowncon + 1;} if (L[1] < lp3 or L < lp3) and C > lp3 - 0.5 then {lp3crdowncon = 1; lpcrdowncon = lpcrdowncon + 1;} if (L[1] < lp4 or L < lp4) and C > lp4 - 0.5 then {lp4crdowncon = 1; lpcrdowncon = lpcrdowncon + 1;} } // ---------- 상향시 박스권 상단의 저항및 하향시 박스권 하단의 지지를 판단 ---------- // {d1crupresist = 0; d2crupresist = 0; d3crupresist = 0; d4crupresist = 0; boxcrupresist = 0; d1crdownresist = 0; d2crdownresist = 0; d3crdownresist = 0; d4crdownresist = 0; boxcrdownresist = 0;} { if (H[1] > dayhigh(1) or H > dayhigh(1) or dayhigh(0)[1] > dayhigh(1)) and C <= dayhigh(1) then {d1crupresist = 1;} if (H[1] > dayhigh(2) or H > dayhigh(2) or dayhigh(0)[1] > dayhigh(2) or dayhigh(1) > dayhigh(2)) and C <= dayhigh(2) then {d2crupresist = 1; boxcrupresist = boxcrupresist + 1;} if (H[1] > dayhigh(3) or H > dayhigh(3) or dayhigh(0)[1] > dayhigh(3) or dayhigh(1) > dayhigh(3)) and C <= dayhigh(3) then {d3crupresist = 1; boxcrupresist = boxcrupresist + 1;} if (H[1] > dayhigh(4) or H > dayhigh(4) or dayhigh(0)[1] > dayhigh(4) or dayhigh(1) > dayhigh(4)) and C <= dayhigh(4) then {d4crupresist = 1; boxcrupresist = boxcrupresist + 1;} if (L[1] < daylow(1) or L < daylow(1) or daylow(0)[1] < daylow(1)) and C >= daylow(1) then {d1crdownresist = 1;} if (L[1] < daylow(2) or L < daylow(2) or daylow(0)[1] < daylow(2) or daylow(1) < daylow(2)) and C >= daylow(2) then {d2crdownresist = 1; boxcrdownresist = boxcrdownresist + 1;} if (L[1] < daylow(3) or L < daylow(3) or daylow(0)[1] < daylow(3) or daylow(1) < daylow(3)) and C >= daylow(3) then {d3crdownresist = 1; boxcrdownresist = boxcrdownresist + 1;} if (L[1] < daylow(4) or L < daylow(4) or daylow(0)[1] < daylow(4) or daylow(1) < daylow(4)) and C >= daylow(4) then {d4crdownresist = 1; boxcrdownresist = boxcrdownresist + 1;} } {d1shupresist = 0; d2shupresist = 0; d3shupresist = 0; d4shupresist = 0; boxshupresist = 0; d1shdownresist = 0; d2shdownresist = 0; d3shdownresist = 0; d4shdownresist = 0; boxshdownresist = 0;} { if dayhigh(0) > dayhigh(1) - 1 and C <= dayhigh(1) then {d1shupresist = 1;} if (dayhigh(0) > dayhigh(2) - 1 or dayhigh(1) > dayhigh(2)) and C <= dayhigh(2) then {d2shupresist = 1; boxshupresist = boxshupresist + 1;} if (dayhigh(0) > dayhigh(3) - 1 or dayhigh(1) > dayhigh(3)) and C <= dayhigh(3) then {d3shupresist = 1; boxshupresist = boxshupresist + 1;} if (dayhigh(0) > dayhigh(4) - 1 or dayhigh(1) > dayhigh(4)) and C <= dayhigh(4) then {d4shupresist = 1; boxshupresist = boxshupresist + 1;} if daylow(0) < daylow(1) + 1 and C >= daylow(1) then {d1shdownresist = 1;} if (daylow(0) < daylow(2) + 1 or daylow(1) < daylow(2)) and C >= daylow(2) then {d2shdownresist = 1; boxshdownresist = boxshdownresist + 1;} if (daylow(0) < daylow(3) + 1 or daylow(1) < daylow(3)) and C >= daylow(3) then {d3shdownresist = 1; boxshdownresist = boxshdownresist + 1;} if (daylow(0) < daylow(4) + 1 or daylow(1) < daylow(4)) and C >= daylow(4) then {d4shdownresist = 1; boxshdownresist = boxshdownresist + 1;} } {box7shupresist = 0; box7shdownresist = 0;} { //if C <= dayhigh(1) + depvaluemin and C >= daylow(1) then {box7shupresist = box7shupresist + 1;} //if C <= dayhigh(2) + depvaluemin and C >= daylow(2) then {box7shupresist = box7shupresist + 1;} if C <= dayhigh(3) + depvaluemin and C >= daylow(3) then {box7shupresist = box7shupresist + 1;} if C <= dayhigh(4) + depvaluemin and C >= daylow(4) then {box7shupresist = box7shupresist + 1;} if C <= dayhigh(5) + depvaluemin and C >= daylow(5) then {box7shupresist = box7shupresist + 1;} if C <= dayhigh(6) + depvaluemin and C >= daylow(6) then {box7shupresist = box7shupresist + 1;} if C <= dayhigh(7) + depvaluemin and C >= daylow(7) then {box7shupresist = box7shupresist + 1;} //if C >= daylow(1) - depvaluemin and C <= dayhigh(1) then {box7shdownresist = box7shdownresist + 1;} //if C >= daylow(2) - depvaluemin and C <= dayhigh(2) then {box7shdownresist = box7shdownresist + 1;} //if C >= daylow(3) - depvaluemin and C <= dayhigh(3) then {box7shdownresist = box7shdownresist + 1;} if C >= daylow(4) - depvaluemin and C <= dayhigh(4) then {box7shdownresist = box7shdownresist + 1;} if C >= daylow(5) - depvaluemin and C <= dayhigh(5) then {box7shdownresist = box7shdownresist + 1;} if C >= daylow(6) - depvaluemin and C <= dayhigh(6) then {box7shdownresist = box7shdownresist + 1;} if C >= daylow(7) - depvaluemin and C <= dayhigh(7) then {box7shdownresist = box7shdownresist + 1;} } // ---------- 일봉 이평선및 박스권의 수렴형 여부 판단 ---------- // {lp1234convercon = 0; lp123convercon = 0; lp123n4convercon = 0; lp123or4convercon = 0;} { if max(lp1,lp2,lp3) - min(lp1,lp2,lp3) < 1.7 then {lp123convercon = 1;} if max(lp1,lp2,lp3,lp4) - min(lp1,lp2,lp3,lp4) < 4 then {lp1234convercon = 1;} if lp123convercon == 1 and lp1234convercon == 1 then {lp123n4convercon = 1;} if lp123convercon == 1 or lp1234convercon == 1 then {lp123or4convercon = 1;} } boxconvercon = 0; { if (dayhigh(3) + Faddbox >= dayhigh(2) and dayhigh(2) + Faddbox >= dayhigh(1) and daylow(3) - Faddbox <= daylow(2) and daylow(2) - Faddbox <= daylow(1) and C <= d3boxhigh and C >= d3boxlow) or (dayhigh(2) > dayhigh(1) and dayhigh(2) > dayhigh(0) and daylow(2) < daylow(1) and daylow(2) < daylow(0)) then {boxconvercon = 1;} } {d2convercnt = 0; d3convercnt = 0; d4convercnt = 0;} { if dayhigh(0) <= dayhigh(4) and daylow(0) >= daylow(4) then { {d4convercnt = d4convercnt + 1;} if dayhigh(1) <= dayhigh(4) and daylow(1) >= daylow(4) then {d4convercnt = d4convercnt + 1;} if dayhigh(2) <= dayhigh(4) and daylow(2) >= daylow(4) then {d4convercnt = d4convercnt + 1;} if dayhigh(3) <= dayhigh(4) and daylow(3) >= daylow(4) then {d4convercnt = d4convercnt + 1;} } if dayhigh(0) <= dayhigh(3) and daylow(0) >= daylow(3) then { {d3convercnt = d3convercnt + 1;} if dayhigh(1) <= dayhigh(3) and daylow(1) >= daylow(3) then {d3convercnt = d3convercnt + 1;} if dayhigh(2) <= dayhigh(3) and daylow(2) >= daylow(3) then {d3convercnt = d3convercnt + 1;} } if dayhigh(0) <= dayhigh(2) and daylow(0) >= daylow(2) then { {d2convercnt = d2convercnt + 1;} if dayhigh(1) <= dayhigh(2) and daylow(1) >= daylow(2) then {d2convercnt = d2convercnt + 1;} } } // ---------- 이평선의 기울기가 일정수준이하인지 판단 ---------- // {lp1234gapmincon = 0; lp123gapmincon = 0; lp234gapmincon = 0;} { if abs(avg((lp1 - lp1[1]), (lp2 - lp2[1]), (lp3 - lp3[1]), (lp4 - lp4[1]))) <= Flpdepmin and abs(lp1 - lp1[1]) <= abs(lp1[1] - lp1[2]) and abs(lp2 - lp2[1]) <= abs(lp2[1] - lp2[2]) and abs(lp3 - lp3[1]) <= abs(lp3[1] - lp3[2]) and abs(lp4 - lp4[1]) <= abs(lp4[1] - lp4[2]) then {lp1234gapmincon = 1;} if abs(avg((lp1 - lp1[1]), (lp2 - lp2[1]), (lp3 - lp3[1]))) <= Flpdepmin and abs(lp1 - lp1[1]) <= abs(lp1[1] - lp1[2]) and abs(lp2 - lp2[1]) <= abs(lp2[1] - lp2[2]) and abs(lp3 - lp3[1]) <= abs(lp3[1] - lp3[2]) then {lp123gapmincon = 1;} if abs(avg((lp2 - lp2[1]), (lp3 - lp3[1]), (lp4 - lp4[1]))) <= Flpdepmin and abs(lp2 - lp2[1]) <= abs(lp2[1] - lp2[2]) and abs(lp3 - lp3[1]) <= abs(lp3[1] - lp3[2]) and abs(lp4 - lp4[1]) <= abs(lp4[1] - lp4[2]) then {lp234gapmincon = 1;} } // 2007.5.2 작성 {barcount = 0; boxdep = 0; boxhigh = 0; boxlow = 0; boxmid = 0; contboxcnt = 0; baseboxhigh = 0; baseboxlow = 0; baseboxmid = 0; baseboxdep = 0;} { if d2boxdep <= depvaluemax and C <= d2boxhigh and C >= d2boxlow then contboxcnt = contboxcnt + 1; { if dayhigh(3) > dayhigh(2) then {boxhigh = dayhigh(3);} if dayhigh(3) <= dayhigh(2) then {boxhigh = dayhigh(2);} if daylow(3) < daylow(2) then {boxlow = daylow(3);} if daylow(3) >= daylow(2) then {boxlow = daylow(2);} boxdep = boxhigh - boxlow; boxmid = (boxhigh - boxlow) / 2; if boxdep <= Fdepvaluemax and d2boxhigh <= boxhigh and d2boxlow >= boxlow then contboxcnt = contboxcnt + 1; baseboxhigh = boxhigh; baseboxlow = boxlow; baseboxdep = boxdep; } } if C > dayhigh(1) then { if C > dayhigh(4) and C > dayhigh(3) and C > dayhigh(2) then {boxupcnt = 4;} else if C > dayhigh(3) and C > dayhigh(2) then {boxupcnt = 3;} else if C > dayhigh(2) then {boxupcnt = 2;} else {boxupcnt = 1;} } if C > dayhigh(1) + Faddbox then { if C > dayhigh(4) and C > dayhigh(3) and C > dayhigh(2) then {boxupbetcnt = 4;} else if C > dayhigh(3) and C > dayhigh(2) then {boxupbetcnt = 3;} else if C > dayhigh(2) then {boxupbetcnt = 2;} else {boxupbetcnt = 1;} } if C < daylow(1) then { if C < daylow(4) and C < daylow(3) and C < daylow(2) then {boxdowncnt = 4;} else if C < daylow(3) and C < daylow(2) then {boxdowncnt = 3;} else if C < daylow(2) then {boxdowncnt = 2;} else {boxdowncnt = 1;} } if C < daylow(1) - Faddbox then { if C < daylow(4) and C < daylow(3) and C < daylow(2) then {boxdownbetcnt = 4;} else if C < daylow(3) and C < daylow(2) then {boxdownbetcnt = 3;} else if C < daylow(2) then {boxdownbetcnt = 2;} else {boxdownbetcnt = 1;} } // ---------- 갭상승, 갭하락 여부 판단루틴 ---------- // {upgapcon = 0; downgapcon = 0; contgapcnt = 0; upgapdaycnt = 0; downgapdaycnt = 0; upgaplow = 0; downgaphigh = 0;} { if daylow(0) > dayhigh(1) or daylow(1) > dayhigh(2) or daylow(2) > dayhigh(3) or daylow(3) > dayhigh(4) then {upgapcon = 1;}// 최근 4일 이내에 상승갭이 있었는지 여부 if dayhigh(0) < daylow(1) or dayhigh(1) < daylow(2) or dayhigh(2) < daylow(3) or dayhigh(3) < daylow(4) then {downgapcon = 1;}// 최근 4일 이내에 하락갭이 있었는지 여부 } { if daylow(0) > dayhigh(1) and daylow(1) > dayhigh(2) and daylow(2) > dayhigh(3) then {contgapcnt = 3;}// 연속 상승갭의 횟수 카운트 else if daylow(0) > dayhigh(1) and daylow(1) > dayhigh(2) then {contgapcnt = 2;} else if daylow(0) > dayhigh(1) then {contgapcnt = 1;} } { if dayhigh(0) < daylow(1) and dayhigh(1) < daylow(2) and dayhigh(2) < daylow(3) then {contgapcnt = -3;}// 연속 하락갭의 횟수 카운트 else if dayhigh(0) < daylow(1) and dayhigh(1) < daylow(2) then {contgapcnt = -2;} else if dayhigh(0) < daylow(1) then {contgapcnt = -1;} } { if daylow(0) > dayhigh(1) and daylow(0) > dayhigh(2) and daylow(0) > dayhigh(3) and daylow(0) > dayhigh(4) then {upgapdaycnt = 4;}// 상승갭의 상승일수 카운트 else if daylow(0) > dayhigh(1) and daylow(0) > dayhigh(2) and daylow(0) > dayhigh(3) then {upgapdaycnt = 3;} else if daylow(0) > dayhigh(1) and daylow(0) > dayhigh(2) then {upgapdaycnt = 2;} else if daylow(0) > dayhigh(1) then {upgapdaycnt = 1;} } { if dayhigh(0) < daylow(1) and dayhigh(0) < daylow(2) and dayhigh(0) < daylow(3) and dayhigh(0) < daylow(4) then {downgapdaycnt = -4;}// 하락갭의 하락일수 카운트 else if dayhigh(0) < daylow(1) and dayhigh(0) < daylow(2) and dayhigh(0) < daylow(3) then {downgapdaycnt = -3;} else if dayhigh(0) < daylow(1) and dayhigh(0) < daylow(2) then {downgapdaycnt = -2;} else if dayhigh(0) < daylow(1) then {downgapdaycnt = -1;} } { if daylow(0) > dayhigh(1) then// 금일 갭상승후 갭 하락돌파 못할 경우 {upgaplow = dayhigh(1);} else if daylow(1) > dayhigh(2) then// 전일 갭상승 후 { if dayopen(0) > dayhigh(2) then// 금일의 저가가 전일의 갭을 하락돌파 못할 경우 {upgaplow = dayhigh(2);} } else if daylow(2) > dayhigh(3) then// 전전일 갭상승 후 { if dayopen(0) > dayhigh(3) and daylow(1) > dayhigh(3) then// 금일 또는 전일의 저가가 {upgaplow = dayhigh(3);} // 전전일의 갭을 하락돌파 못할 경우 } else if daylow(3) > dayhigh(4) then// 전전전일 갭상승 후 { if dayopen(0) > dayhigh(4) and daylow(1) > dayhigh(4) and daylow(2) > dayhigh(4) then {upgaplow = dayhigh(4);} // 금일, 전일, 전전일의 저가가 전전전일의 갭을 하락돌파 못할 경우 } } { if dayhigh(0) < daylow(1) then// 금일 갭하락후 갭 상승돌파 못할 경우 {downgaphigh = daylow(1);} else if dayhigh(1) < daylow(2) then// 전일 갭하락 후 { if dayopen(0) < daylow(2) then// 금일의 고가가 전일의 갭을 상승돌파 못할 경우 {downgaphigh = daylow(2);} } else if dayhigh(2) < daylow(3) then// 전전일 갭하락 후 { if dayopen(0) < daylow(3) and dayhigh(1) < daylow(3) then// 금일 또는 전일의 고가가 {downgaphigh = daylow(3);} // 전전일의 갭을 상승돌파 못할 경우 } else if dayhigh(3) < daylow(4) then// 전전전일 갭상승 후 { if dayopen(0) < daylow(4) and dayhigh(1) < daylow(4) and dayhigh(2) < daylow(4) then {downgaphigh = daylow(4);} // 금일, 전일, 전전일의 고가가 전전전일의 갭을 상승돌파 못할 경우 } } // ---------- 연속상승, 연속하락 여부 판단루틴 ---------- // {contupcnt = 0; contdowncnt = 0;} { if dayopen(2) < dayclose(2) and dayopen(1) < dayclose(1) and dayopen(0) < C and dayclose(3) < dayclose(2) and dayclose(2) < dayclose(1) and dayclose(1) < C then contupcnt = 3; else if dayopen(1) < dayclose(1) and dayopen(0) < C and dayclose(2) < dayclose(1) and dayclose(1) < C then contupcnt = 2; else if dayopen(0) < C and dayclose(1) < C then contupcnt = 1; if dayopen(2) > dayclose(2) and dayopen(1) > dayclose(1) and dayopen(0) > C and dayclose(3) > dayclose(2) and dayclose(2) > dayclose(1) and dayclose(1) > C then contdowncnt = 3; else if dayopen(1) > dayclose(1) and dayopen(0) > C and dayclose(2) > dayclose(1) and dayclose(1) > C then contdowncnt = 2; else if dayopen(0) > C and dayclose(1) > C then contdowncnt = 1; } // ---------- 봉파동의 강약에 따른 강제 매수, 매도 진입및 청산 여부 판단 루틴 ---------- // entbartrend = 0;// 단독으로 매수및 매도제한 사용해도 확률 높음 //if dayindex() > 0 then { if lpshupresist < 2 and !(sto10k < sto10d and sto20k < sto20d) then { if C > O and C[1] > O[1] and V > V[1] and V[1] > V[2] and sto10k < stoh and upV >= 0.3 and upV1 >= 0.3 and bidask > 0 and bidask > bidask[1] and bidask[1] > bidask[2] then {entbartrend = 1;} } if lpshdownresist < 2 and !((sto10k > sto10d and sto20k > sto20d) and lp123n4convercon == 1 and !((C < lp2 and C < lp3 and C < lp4 and lp2 < lp2[1] and lp3 < lp3[1] and lp4 < lp4[1]))) and !(lp123n4convercon == 1 and C >= daylow(1) and sp > lp1) then if !(sto20k > sto20d and sto10dL1 < stoL and sto10k > sto10dL1 and !(lp < lp[1] and contgapcnt < 0)) then if !(lp1234dr > 0 or lp234dr > 0) or !(C >= daylow(1) - Faddbox or C >= daylow(0)[1] - Faddbox) or (V + V[1] > dayopenvol) then { if C < O and C[1] < O[1] and V > V[1] and V[1] > V[2] and sto10k > stoL and sto20k > stoL and ((downV >= 0.6 and downV1 >= Faddbox) or (downV >= 0.8 and downV1 >= 0.1) or ((downbidaskcon == 1 or C < daylow(0)[1]) and downV >= 0.3 and downV1 >= Faddbox)) and bidask < 0 and bidask < bidask[1] and sto65k > stoL and !(sto20k > sto20d and sto20up > 1) and !(sto10k > sto10d and sto10up > 1) then {entbartrend = -1;} } } {clbartrend = 0; clbartrend1 = 0;} if dayindex() > 0 and V > V[1] and V[1] > V[2] then { if bidask > 0 and bidask > bidask[1] and bidask[1] > bidask[2] then { if C > O and C[1] > O[1] and upV >= 0.3 and upV1 >= Faddbox then {clbartrend = 1;} if C > O and upV >= Faddbox and ((C[1] > O[1] and upV > upV1) or (C[1] <= O[1] and upV > downV1)) then {clbartrend1 = 1;} } if bidask < bidask[1] and bidask[1] < bidask[2] then { if C < O and C[1] < O[1] and ((downV >= 0.3 and downV1 >= Faddbox) or (downbidaskcon == 1 and downV >= Faddbox and downV1 >= Faddbox) or (bfdownbidaskcon == 1 and downV >= 0.5)) and sto65k > stoL then {clbartrend = -1;} if C < O and downV >= Faddbox and ((C[1] < O[1] and downV > downV1) or (C[1] >= O[1] and downV > upV1)) then {clbartrend1 = -1;} } } Crossdown520con = 0;//장음봉 성립요건중 첫째 { if C < O and C < L[1] and O >= sp and O >= lp and C < sp and C < lp and H - L > H[1] - L[1] then {Crossdown520con = 1;} } upfailure10con = 0; { if H < mp and C < lp and downV >= Faddbox then { if (lp < lp[1] or (dayopen(0) < daylow(1) and C < daylow(1))) and !(lp1234dr == 2 and upgapcon == 1 and C > lp2 and C >= upgaplow) and !(sto65k > sto65d and sto65k > sto65k[1]) then {upfailure10con = 1;} } } displp3con = 0; { if (Crossup(displp3,dispL) or (daylowdisplp3 < dispL and displp3 > dispL)) then {displp3con = 1;} if (Crossdown(displp3,disph) or (dayhighdisplp3 > disph and displp3 < disph)) then {displp3con = -1;} } simricon = 0; { if (Crossup(simri,31) or (daylowsimri <= 30 and simri > 30)) then {simricon = 1;} if (Crossdown(simri,69) or (dayhighsimri >= 70 and simri < 70)) then {simricon = -1;} } {sellcldownupcon = 0; buyclupdowncon = 0;} { if ( tupV >= 0.4 and ( downupV > abs(O - C) * 2 or (downupV >= 0.5 and downupV > abs(O - C)) or (downupV >= 0.5 and downupV > (O - L)*0.4 and V > V[1]) ) ) then {sellcldownupcon = 1;} if (C > O and H - C > (C - O)*2 and C - O <= Faddbox) then {buyclupdowncon = 1;} } contbidaskcnt = 0; { if bidask > bidask[1] and bidask[1] > bidask[2] then { if bidask[2] > bidask[3] then contbidaskcnt = 2; else contbidaskcnt = 1; } if bidask < bidask[1] and bidask[1] < bidask[2] then { if bidask[2] < bidask[3] then contbidaskcnt = -2; else contbidaskcnt = -1; } } contbarcnt = 0; { if C > O and C[1] > O[1] and C > C[1] and upV >= Faddbox then { if C[2] > O[2] and C[1] > C[2] then contbarcnt = 2; else contbarcnt = 1; } if C < O and C[1] < O[1] and C < C[1] and downV >= Faddbox then { if C[2] < O[2] and C[1] < C[2] then contbarcnt = -2; else contbarcnt = -1; } } contvolcnt = 0; { if V > V[1] and V[1] > V[2] then { if V[2] > V[3] then contvolcnt = 2; else contvolcnt = 1; } } // ---------- 상승및 하락시 최소배팅(또는 5분봉 포지션기준) 거래진입 가능여부 결정 루틴 ---------- // {buymincon = 0; sellmincon = 0;} { if ((boxupcnt == 0 and boxdowncnt == 0 and C > yboxmid + Faddbox and C > tboxmid + Faddbox) or (boxupcnt > 0 and ((lp1 > lp1[1] and C < lp1) or (lp1 <= lp1[1] and sp < lp1)))) and (!(lp0123dr < 0 or lp1234dr < 0) or sto65k > sto65d) then// sto65k > sto65d삭제시 수익감소 {buymincon = 1;}// 현재가가 전일의 최고가 밑이고 전일과 금일의 중간가보다 높거나 // 60이평선이 상향이면 현재가가 60이평선보다 크지 않거나 // 60이평선이 하향이면 5이평선이 60이평선위에 있지 않으면 5분봉 거래 대상임 if ((boxdowncnt == 0 and boxupcnt == 0 and C < yboxmid - Faddbox and C < tboxmid - Faddbox) or (boxdowncnt > 0 and ((lp1 < lp1[1] and C > lp1) or (lp1 >= lp1[1] and sp > lp1)))) and (!(lp0123dr > 0 or lp1234dr > 0) or sto65k < sto65d) then// sto65k < sto65d삭제시 수익감소 {sellmincon = 1;}// 현재가가 전일의 최저가 위이고 전일과 금일의 중간가보다 낮거나 // 60이평선이 하향이면 현재가가 60이평선보다 작지 않거나 // 60이평선이 상향이면 5이평선이 60이평선 밑에 있지 않으면 5분봉 거래 대상임 } // ---------- 매수시 중간 또는 최대배팅 포지션 진입 조건 판단 ---------- // buyregcon = 0; if C > O and upV >= Faddbox and sp > sp[1] then if lp0123dr > 0 or spnlp1234con > 0 or uplongtrend > 0 or boxupbetcnt > 0 or sto65up1 == 2 or sto130up1 == 2 or upbidaskcon == 1 or entbartrend == 1 then { if (lp0123dr > 0 or uplongtrend > 0) and C >= yboxmid + Faddbox and C >= tboxmid + Faddbox then {buyregcon = 1;}// 5-20-60-(120 or 360)선 정배열 또는 20-60-120-360선 정배열시 if lp1dupcon > 0 then {buyregcon = 2;}// 일봉 5일선 쌍바닥위 5이평선 상향 if lp1 > lp1[1] and lp1[1] > lp1[2] and sto65up1 == 2 then {buyregcon = 3;}// 07. 7.3 작성 if ( ((sto65up == 2 or sto130up == 2 or (spmpnlpdupcon > 0 and mplpnlp12dupcon > 0)) and sp > lp1) or spnlp1234con > 0 or (lp0123dr > 0 and !(sp < lp2 and lp2 < lp2[1]) and !(sp < lp3 and lp3 < lp3[1])) ) and boxupcnt > 0 then {buyregcon = 4;} if borbfupbidaskcon == 1 then { if sto65k > sto65d and V > V[1] and dayindex() > 0 and boxupcnt > 0 then {buyregcon = 11;} } if entbartrend == 1 and (C > lp1 or C > dayhigh(0)[1]) and sto65k > sto65d and boxupcnt > 1 then {buyregcon = 21;} if contgapcnt > 0 and C > d4boxhigh then {buyregcon = 31;} if contgapcnt > 0 and C > d2boxhigh and C > lp1 and ( downlongtrend == 0 or (C > dayclose(1) * 1.02 and upV > depvaluemin / 2)) then {buyregcon = 41;} if (C > dayhigh(0)[1] + 0.4 and upV > depvaluemin and C > daylow(0) * 1.04 and entbartrend == 1 and dayindex() < 10) then {buyregcon = 51;} if (C > d4boxhigh + Faddbox and C > lp1 + Faddbox and C > lp2 and C > lp3) then {buyregcon = 61;}// 08.12.11 작성 } buybetcon = 0; if C > O and upV >= Faddbox and sp > sp[1] then if lp0123dr > 1 or uplongtrend > 0 or boxupbetcnt > 1 or sto65up1 == 2 or sto130up1 == 2 or entbartrend == 1 or (upbidaskcon == 1 and lpshupresist < 2) then { if (lp0123dr > 1 or uplongtrend > 0) and C >= yboxmid + Faddbox and C >= tboxmid + Faddbox then {buybetcon = 1;}// 5-20-60-(120 or 360)선 정배열 또는 20-60-120-360선 정배열시 if lp1dupcon > 0 then {buybetcon = 2;}// 일봉 5일선 쌍바닥위 5이평선 상향 if lp1 > lp1[1] and lp1[1] > lp1[2] and sto65up1 == 2 then {buybetcon = 3;}// 07. 7.3 작성 if ( ((sto65up == 2 and sto65index + 30 >= index) or (sto65kL1 > sto65kL2 and sto65k > sto65d) and sp > lp1 )// 일봉 스토5 쌍바닥 or ((sto130up == 2 and sto130index + 30 >= index) or (sto130kL1 > sto130kL2 and sto130k > sto130d) and sp > lp1)// 일봉 스토10 쌍바닥 or (lp0123dr > 0 and !(sp < lp2 and lp2 < lp2[1]) and !(sp < lp3 and lp3 < lp3[1]))) and boxupbetcnt > 1 and ((dayindex() > 0 and V > V[1]) or bgstvolcon == 1) then {buybetcon = 4;} if borbfupbidaskcon == 1 then { if sto65k > sto65d and ((dayindex() > 0 and V > V[1]) or bgstvolcon == 1) and boxupbetcnt > 0 then {buybetcon = 11;} } if entbartrend == 1 and (C > lp1 or C > dayhigh(0)[1]) and sto65k > sto65d and boxupcnt > 1 then {buybetcon = 21;} if contgapcnt > 0 and C > d4boxhigh then {buybetcon = 31;} if contgapcnt > 0 and C > d2boxhigh and C > lp1 and (downlongtrend == 0 or (C > dayclose(1) * 1.02 and upV > depvaluemin / 2)) then {buybetcon = 41;} if (C > dayhigh(0)[1] + 0.4 and upV > depvaluemin and C > daylow(0) * 1.04 and entbartrend == 1 and dayindex() < 10) then {buybetcon = 51;} if (C > d4boxhigh + Faddbox and C > lp1 + Faddbox and C > lp2 and C > lp3) then {buybetcon = 61;}// 08.12.11 작성 } // ---------- 매도시 중간 또는 최대배팅 포지션 진입 조건 판단 ---------- // sellregcon = 0; if C < O and downV >= 0.15 and sp < sp[1] then if lp0123dr < 0 or spnlp1234con < 0 or downlongtrend > 0 or boxdownbetcnt > 0 or sto65down1 == 2 or sto130down1 == 2 or downbidaskcon == 1 or entbartrend == -1 then { if (lp0123dr < -1 or downlongtrend > 0) then { if C <= yboxmid -Faddbox and C <= tboxmid - Faddbox then {sellregcon = 1;}// 5-20-60-(120 or 360)선 역배열 또는 20-60-120-360선 역배열시 if (entbartrend == -1 or clbartrend == -1) and (downV > depvaluemin or tboxdep > depvaluemin1) then {sellregcon = 2;} } if boxdownbetcnt > 1 then {sellregcon = 11;}// 이전 3일간의 박스권 하향탈출시 if lp1dupcon < 0 then {sellregcon = 12;}// 일봉 5일선 쌍봉밑 5이평선 하향 if lp1 < lp1[1] and lp1[1] < lp1[2] and sto65down1 == 2 then {sellregcon = 13;}// 07. 7.3 작성 if ( ((sto65down == 2 or sto130down == 2 or (spmpnlpdupcon < 0 and mplpnlp12dupcon < 0)) and C < lp1) or (lp0123dr < 0 and !(sp > lp2 and lp2 > lp2[1]) and !(sp > lp2 and lp2 > lp2[1])) ) and boxdownbetcnt > 0 then {sellregcon = 14;} if borbfdownbidaskcon == 1 then { if sto65k < sto65d and V > V[1] and boxdowncnt > 0 then {sellregcon = 21;} if C < lp1 - Faddbox and bgstvolcon == 1 and bgstdownVcon == 1 and downV > depvaluemin1 then {sellregcon = 22;} } if entbartrend == -1 and (C < lp1 or C < daylow(0)[1]) and sto65k < sto65d and boxdowncnt > 1 then {sellregcon = 31;} if entbartrend == -1 then { if (borbfdownbidaskcon == 1) and bgstdownVcon == 1 then {sellregcon = 41;} } if contgapcnt < 0 and C < d2boxlow and C < lp1 and ( uplongtrend < 1 or (C < dayclose(1) * 0.98 and downV > depvaluemin / 2)) then {sellregcon = 51;} if (C < daylow(0)[1] - 0.4 and downV > depvaluemin and C < dayhigh(0) * 0.96 and entbartrend == -1 and dayindex() < 10) then {sellregcon = 61;} if (lp1234dr == -2 and downV > depvaluemid and C < mp and C < lp2 and sto130k < stoL and displp3 < dispL) then {sellregcon = 62;} } sellbetcon = 0; if C < O and downV >= 0.15 and sp < sp[1] then if lp0123dr < -1 or downlongtrend > 0 or boxdownbetcnt > 1 or sto65down1 == 2 or sto130down1 == 2 or entbartrend == -1 or (downbidaskcon == 1 and lpshdownresist < 2) then { if (lp0123dr < -1 or downlongtrend > 0) then { if C <= yboxmid - Faddbox and C <= tboxmid - Faddbox then {sellbetcon = 1;}// 5-20-60-(120 or 360)선 역배열 또는 20-60-120-360선 역배열시 if (entbartrend == -1 or clbartrend == -1) and (downV > depvaluemin or tboxdep > depvaluemin1) then {sellbetcon = 2;} } if C < d3boxlow - Faddbox then {sellbetcon = 11;}// 이전 3일간의 박스권 하향탈출시 if lp1dupcon < 0 then {sellbetcon = 12;}// 일봉 5일선 쌍봉밑 5이평선 하향 if lp1 < lp1[1] and lp1[1] < lp1[2] and sto65down1 == 2 then {sellbetcon = 13;}// 07. 7.3 작성 if ( (sto65down == 2 or (sto65kL1 < sto65kL2 and sto65k < sto65d) and C < lp1 )// 일봉 스토5 쌍바닥 or (sto130down == 2 or (sto130kL1 < sto130kL2 and sto130k < sto130d) and C < lp1)// 일봉 스토10 쌍바닥 or (lp0123dr < 0 and !(sp > lp2 and lp2 > lp2[1]) and !(sp > lp3 and lp3 > lp3[1]))) and (boxdownbetcnt > 1 or (boxdownbetcnt > 0 and (entbartrend < 0 or ((sto65down == 2 or sto130down == 2) and bgstvolcon == 1 and bgstdownVcon == 1)))) then {sellbetcon = 14;} if borbfdownbidaskcon == 1 then { if sto65k < sto65d and V > V[1] and boxdownbetcnt > 1 and (C < lp1 or C < daylow(0)[1]) then {sellbetcon = 21;} if C < lp1 - Faddbox and bgstvolcon == 1 and bgstdownVcon == 1 and downV > depvaluemin1 then {sellbetcon = 22;} } if entbartrend == -1 and (C < lp1 or C < daylow(0)[1]) and sto65k < sto65d and boxdowncnt > 1 then {sellbetcon = 31;} if entbartrend == -1 then { if (borbfdownbidaskcon == 1) and bgstdownVcon == 1 then {sellbetcon = 41;} } if contgapcnt < 0 and C < d2boxlow and C < lp1 and (uplongtrend == 0 or (C < dayclose(1) * 0.98 and downV > depvaluemin / 2)) then {sellbetcon = 51;} if (C < daylow(0)[1] - 0.4 and downV > depvaluemin and C < dayhigh(0) * 0.96 and entbartrend == -1 and dayindex() < 10) then {sellbetcon = 61;} if (lp1234dr == -2 and downV > depvaluemid and C < mp and C < lp2 and sto130k < stoL and displp3 < dispL) then {sellbetcon = 62;} } // ---------- 거래금지 조건 판단(신규 매수진입 금지 조건) ---------- // notbuycon = 0; if !(C > dayhigh(0)[1] + 0.4 and upV > depvaluemin and C > daylow(0) * 1.04 and entbartrend == 1 and dayindex() < 10) then { if (sp < lp1 and mp < mp[1]) then {notbuycon = 01;} if !((C[1] <= O[1] and (C > H[1] or (sto65up == 2 and V > V[1])) and upV >= Faddbox) or (C[1] > O[1] and C > C[1])) then {notbuycon = 02;} if !(boxupcnt > 0 or (buymincon > 0 and upV >= Faddbox) or entbartrend == 1 or upbidaskcon == 1 or (sp > lp1 and (sto65up == 2 or sto130up == 2) and (C > dayhigh(1) + Faddbox or C > dayhigh(0)[1] + Faddbox))) then {notbuycon = 03;} if !(sto10k > sto10k[1] and (sto10k > sto10d or (dayindex() == 0 and C > dayclose(1)) or (mp > mp[1] and V > V[1]))) then {notbuycon = 04;} if !(sto20k > sto20d or lp > lp[1]) then {notbuycon = 05;} if !(lp0123dr > 1 or uplongtrend > 0) and !(sto20k < stoh or (downgapcon == 1 and C > downgaphigh) or boxupcnt > 1) then {notbuycon = 06;} if upV * 2 < updownV and updownV >= 0.5 and !(C > daylow(1) or C > daylow(0)[1]) then {notbuycon = 07;} if C <= dayhigh(1) and C <= dayhigh(2) and stodh10n20downcon == 1 and !(uplongtrend > 0 or lp0123dr > 1 or upV > depvaluemin / 2 or sto65up == 2 or sto130up == 2 or borbfupbidaskcon == 1) then {notbuycon = 08;} if !(downbidaskcon == 0 or dayindex() == 0) or (contbidaskcnt < 0 and bidask < 0) then {notbuycon = 22;} if !(daylow(0) > dayhigh(1) or (bidask > 0 and bidask > bidask[1]) or (boxupcnt > 1 or (boxupcnt > 0 and lp0123dr > 1 and C > dayhigh(0)[1])) or (dayindex() == 0 and (bidask > 0 or C > dayhigh(1)))) and !(lp1234dr > 0 and lp2 > lp4 and C > d4boxmid and C > d3boxmid and C > lp1 and spmpnlpdupcon == 1 and lp > lp1) and !(downlongtrend == 0 and C > yboxmid and (bgstvolcon == 1 or bgstupVcon == 1) and upV > depvaluemin and C > lp1 and (sto10up > 1 or sto20up > 1) and (sto65up == 2 or sto130up == 2)) and !(uplongtrend > 0 and (bgstvolcon == 1 or bgstupVcon == 1) and (sto10up > 1 or sto20up > 1) and C > lp1) then {notbuycon = 23;} if !(splp01dr > 0 or lp0123dr > 0 or uplongtrend > 0 or boxupcnt > 0 or yboxdep > Fdepvaluemid) then {notbuycon = 24;}// 2007.5.1 수정(박스권크기 5 --> 3으로 수정, 박스권에서 수익 증가) if boxupcnt == 0 and !(C > yboxmid + Faddbox and C > tboxmid + Faddbox) then {notbuycon = 25;} if displp3 > disph and sto65k > stoh and sto10dh1 > sto10d and sto10up < 2 and lp1234dr < 2 and !(upgapdaycnt > 3 and C > d4boxhigh + depvaluemin and upV >= Faddbox) and !(lp1234dr > 0 and lp0123dr > 1 and C > yboxmid and C[1] > O[1] and upV > depvaluemin / 2 and (borbfupbidaskcon == 1 or entbartrend == 1)) then {notbuycon = 26;} if displp3 > disph and sto65k > stoh and sto20k > stoh and sto10k > stoh and (lp1234dr < 1 or dayindex() == 11 or (lp1234dr == 1 and (C > lp4 and (lp > lp4 or lp4 > lp4[1])))) then {notbuycon = 28;} if (displp3 > disph or sto65k > stoh) and sto20k < sto20dh1 and sto10up < 2 and boxupcnt < 2 and !(lp1234dr > 0 and lp0123dr > 1 and C > yboxmid and C[1] > O[1] and upV > depvaluemin / 2 and (borbfupbidaskcon == 1 or entbartrend == 1)) then {notbuycon = 29;}// 하락에 동일 기준 적용시 손실발생 if sto65k > stoh and sto65k < sto65d and boxupcnt < 1 then {notbuycon = 30;} if (sto10down > 1 or sto20down > 1) then {notbuycon = 31;} if sto10k < sto10d and (sto10k < sto10dL1 or sto20k < sto20dL1) then {notbuycon = 32;} if !((lp0123dr > 0 or lp023dr > 0 or lp1234dr > 0 or (lp134dr > 0 and lp1 > lp2)) and (lp1 > lp3 or lp1 > lp4 or (C > lp3 and C > lp4))) and sto20dh1 > stoh and sto20k < sto20dh1 and sto20up < 2 and !(bgstvolcon == 1 and bgstupVcon == 1 and C > d4boxhigh + Faddbox) then {notbuycon = 33;}// 2007.5.1 수정(추세시 수익감소부문 수정요망) if sto20k > stoh and yboxdep < Fdepvaluemid and tboxdep < Fdepvaluemid and boxupcnt < 1 and C <= dayhigh(0)[1] then {notbuycon = 34;} if lp > lp[1] and sto20k < sto20dh1 and !(lp[1] > lp[2] or (sto65k > sto65d and (contbidaskcnt > 0 or lp1234dr > 0))) and ((lp1234dr < 1 and bfdaydownlpcnt > 7 and C <= d2boxhigh + Faddbox) or C <= d2boxhigh) and !(lp1234dr > 0 and lp2 > lp4 and C > d4boxmid and C > d3boxmid and C > lp1 and spmpnlpdupcon == 1 and lp > lp1) then {notbuycon = 35;} if !(splp01dr > 0 or lp0123dr > 0 or uplongtrend > 0 or boxupcnt > 0) and bidask < bidask[1] and bidask < 0 then {notbuycon = 36;} if C <= d2boxhigh and upV < d2boxdep / 2 and yboxdep <= Fdepvaluemid and upV < yboxdep / 2 and C <= dayhigh(1) + Faddbox and sto65k < sto65d and sto65up <> 2 and (sto10k < sto10dh1 and sto20k < sto20dh1) then {notbuycon = 37;} if d4boxdep <= Fd4depvaluemax and dayhigh(0) <= d4boxhigh and daylow(0) >= d4boxlow and !(uplongtrend > 0 or (contgapcnt > 0 and daylow(0) >= dayhigh(1) + 0.5) or (sp > lp1 and (sto10up1 > 1 or sto20up1 > 1 or sto65up == 2 or sto130up == 2 or Cnlp1234con > 0 or spnlp1234con > 0)) or (spmpnlpdupcon == 1 and contbidaskcnt > 0 and (((sto65up == 2 or sto130up == 2) and displp3 > dispL)) or (sto65k > sto65d and sto65dL1 < 21) or (sto65k[1] < stoL and sto65d > sto65dL1)) ) and !(downgapcon == 1 and C > downgaphigh and C > dayhigh(0)[1]) and !(downlongtrend == 0 and C > yboxmid and (bgstvolcon == 1 or bgstupVcon == 1) and upV > depvaluemin and C > lp1 and (sto10up > 1 or sto20up > 1) and (sto65up == 2 or sto130up == 2)) and !(C > d2boxhigh and C > lp1 and (borbfupbidaskcon == 1 or entbartrend == 1)) then {notbuycon = 38;} if dayindex() > 3 and tboxdep <= Fdepvaluemin2 and C <= dayhigh(0)[1] and (sto10d < sto10dh1 and sto20d < sto20dh1) and (sto10k > stoh or sto20k > stoh) then {notbuycon = 39;}// 07.5.28작성-매도분에도 적용후 테스트요망 if !(C > lp1 + Faddbox and (C[1] > lp1[1] + Faddbox or upV >= Faddbox)) and !( ((stodL10n20Lcon == 1 or sto10up1 > 1 or sto20up1 > 1) and bgstvolcon == 1 and bgstupVcon == 1) or ( spmpnlpdupcon == 1 and contbidaskcnt > 0 and ( ((sto65up == 2 or sto130up == 2) and displp3 > dispL) or (sto65k > sto65d and sto65dL1 < 21) or (sto65k[1] < stoL and sto65d > sto65dL1) ) ) ) then {notbuycon = 40;} if lp1 < lp1[1] and !(lp0123dr > 0 or uplongtrend > 0) and sto10k > stoh and sto20k > stoh and !(upV > daybgstdownV and upV > daybgstupV and upbidaskcon == 1) and !(C > d2boxhigh and C > lp1 and (borbfupbidaskcon == 1 or entbartrend == 1)) then {notbuycon = 41;} if dayindex() > 1 and !(lp0123dr > 1 or lp1234dr > 0) and downgapcon == 1 and dayhigh(0) > downgaphigh - 1 and C <= downgaphigh and !(V > V[1]) then// 상승갭저항시 {notbuycon = 42;} if lpcrupresist > 1 and (boxcrupresist > 1 or boxshupresist > 1 or lp123convercon == 1) then {notbuycon = 43;} if boxconvercon == 1 and lpshupresist > 0 and upV < 0.5 then {notbuycon = 44;}//수렴형이면서 이평선 저항시 if lp1234dr < 2 and d2boxdep < depvaluemid1 and C < d2boxhigh + Faddbox and sto65k < sto65d and (stok10n20hcon == 1 or stodh10or20hcon == 1) and !(uplongtrend > 0 and ((sto10up > 1 and sto20up > 1 and bgstvolcon == 1) or (splpdupcon == 1 and splp1dupcon == 1))) then {notbuycon = 45;} if dayindex() > 2 and tboxdep < Fdepvaluemin and C < dayhigh(0)[1] and boxshupresist > 1 and box7shupresist > 2 then {notbuycon = 46;} if (!(lp0123dr > 0 or uplongtrend > 0) or (boxcrupresist > 0 or boxshupresist > 0 or lpshupresist > 0)) and sto20k[1] > stoh and sto10k < sto10dh1 and sto10dh1 > stoh and sto10k < stoh and !(sto65up == 2 or sto65up1 == 2) then {notbuycon = 47;} if dayindex() > 3 and contgapcnt < 1 and (boxcrupresist > 0 or boxshupresist > 0) and bfdaydownlpcnt > 7 and daydownlpcnt > dayindex() - 2 then {notbuycon = 48;} if !((sp > sp[1] and sp[1] > sp[2]) or uphb5con > 0 or upV > daybgstdownV or V > dayopenvol or V[1] > dayopenvol or entbartrend == 1 or ((borbfupbidaskcon == 1) and V > V[1])) then {notbuycon = 49;} if dayindex() == 0 and !(upgapdaycnt > 3 and C > d4boxhigh + depvaluemin and upV >= Faddbox) then { if sto65k > stoh and !(upV > bfdaybgstdownV and upV > bfdaybgstupV) then {notbuycon = 50;} if !(splp01dr > 0 or lp0123dr > 0 or uplongtrend > 0) and ((boxupcnt > 0 and upV < 0.3) or (sto65up == 2 and upV <= 1)) then {notbuycon = 51;}// 반대로 하락에 적용시 수익률 감소 if sto10k > stoh and sto20k > stoh and sto10d < sto10dh1 and sto20d < sto20dh1 then {notbuycon = 52;}// 07.5.28작성-매도분에도 적용후 테스트요망 if C > dayhigh(1) and upV < 1 and updownV > upV * 2 then {notbuycon = 53;} if downlongtrend > 0 and (boxshupresist > 0 or box7shupresist > 0) and stodh10or20downcon == 1 and !(contbidaskcnt > 1 or (bidask > 0 and (bidask > bidask[1] or (dayclose(1) > daylow(1) * 1.02)))) then {notbuycon = 54;} } if sto20k < sto20d and !(entbartrend > 0 or (C > dayhigh(1) and bgstupVcon == 1 and bgstvolcon == 1) or (upbidaskcon == 1 and C > dayhigh(1) and (bgstupVcon == 1 or bgstvolcon == 1)) or (dayindex() > 0 and V > V[1] and upV > daybgstdownV)) and !(downlongtrend == 0 and C > yboxmid and (bgstvolcon == 1 or bgstupVcon == 1) and upV > depvaluemin and C > lp1 and (sto10up > 1 or sto20up > 1) and (sto65up == 2 or sto130up == 2)) and !(contgapcnt > 0 and C > d4boxhigh) and !(lp1234dr > 0 and lp0123dr > 1 and C > yboxmid and C[1] > O[1] and upV > depvaluemin / 2 and (borbfupbidaskcon == 1 or entbartrend == 1)) then { if !(lp0123dr > 1 or uplongtrend > 0 or lp[1] > lp[2] or boxupcnt > 1) or ((lp0123dr < -1 or downlongtrend > 0) and contgapcnt < 1) then {notbuycon = 61;} if (displp3 > disph or sto65k > stoh) then {notbuycon = 62;}// 하락에 동일 기준 적용시 손실발생 if sto10k < sto10dh1 and sto10up < 2 then {notbuycon = 63;} } if stodh10or20hcon == 1 and !(upgapdaycnt > 3 and C > d4boxhigh + depvaluemin and upV >= Faddbox) then { if boxupcnt == 0 and (lp <= lp[1] or lp[1] < lp[2]) and !((sto10up > 1 or sto20up > 1) or (lp1234dr > 0 and sp > lp1 and lp > lp1 and bgstupVcon == 1)) then {notbuycon = 71;} if sto65k > stoh and ((dayindex() == 0 and (displp3 > disph or simri > simh or V < bfdaybgstvol)) or (dayindex() > 0 and !((C >= d4boxhigh + Faddbox or bgstupVcon == 1 or entbartrend == 1) and C >= dayhigh(0)[1] + Faddbox))) then {notbuycon = 72;} if stodh10n20downcon == 1 and !(entbartrend == 1 or bgstvolcon == 1 or bgstupVcon == 1 or sto10up > 1 or sto20up > 1 or contgapcnt > 0) then {notbuycon = 73;} } if daybuyclcon == 1 then { if lpshupresist > 0 then {notbuycon = 81;} if boxshupresist > 0 then {notbuycon = 82;} if C <= dayhigh(0)[1] or C <= dayhigh(1) then {notbuycon = 83;} if !(bgstvolcon == 1 or bgstupVcon == 1 or entbartrend > 0) then {notbuycon = 84;} if uplongtrend == 0 and stok10n20hcon == 1 and (lp123convercon == 1 or lp1234convercon == 1) and box7shupresist > 0 then {notbuycon = 85;} } if sto65k < sto65d and lp1 < lp1[1] and sp < lp1 then { if downgapcon == 1 and C < downgaphigh and !(lp0123dr > 0 or uplongtrend > 0) and !(entbartrend == 1 or upbidaskcon == 1 or bgstvolcon == 1 or bgstupVcon == 1) then {notbuycon = 91;} if lpshupresist > 1 and !(lp0123dr > 0 or uplongtrend > 0) and !(C > d2boxhigh and C > lp1 and (borbfupbidaskcon == 1 or entbartrend == 1)) then {notbuycon = 92;} if lpshupresist > 0 and lp123n4convercon == 1 and !( ( ((sto65d > sto65dL1 and sto65dL1 < stoL) or (sto130d > sto130dL1 and sto130dL1 < stoL)) and (sto10up > 1 or sto20up > 1) ) or (bgstvolcon == 1 and bgstupVcon == 1 and stodL10n20Lcon == 1)) then {notbuycon = 93;} } if ((lp1 < lp1[1] and lp1crupresist == 1) and (lp2 < lp2[1] and lp2crupresist == 1)) or ((lp3 < lp3[1] and lp3crupresist == 1) and (lp4 < lp4[1] and lp4crupresist == 1)) or ((lp1 < lp1[1] and lp1crupresist == 1) and (lp3 < lp3[1] and lp3crupresist == 1)) or ((lp2 < lp2[1] and lp2crupresist == 1) and (lp4 < lp4[1] and lp4crupresist == 1)) or ((lp1 < lp1[1] and lp1crupresist == 1) and (lp4 < lp4[1] and lp4crupresist == 1)) or ((lp2 < lp2[1] and lp2crupresist == 1) and (lp3 < lp3[1] and lp3crupresist == 1)) then {notbuycon = 101;} if (C <= dayhigh(0)[1] or C <= dayhigh(1)) and sto65k > stoh and !((lp0123dr > 1 or uplongtrend > 0) and C > dayhigh(0)[1] and spmpnlpdupcon == 1) and !(lp1234dr > 0 and ((dayindex() == 0 and C > dayclose(1) + Faddbox) or C > dayhigh(0)[1]) and splp1dupcon == 1 and mplp1dupcon == 1 and lplp1dupcon == 1) then {notbuycon = 102;} if C <= dayhigh(1) then { if d3boxdep <= Fdepvaluemid and C <= d3boxhigh and !(V > V[1] and upV > daybgstdownV and upV > daybgstupV) then {notbuycon = 111;}// 07.5.28작성 if lp1 < lp2 and lp2 < lp3 and lp3 < lp4 and lp2 < lp2[1] and lp3 < lp3[1] and upV <= 0.3 and C < lp2 and sto20up <> 2 and sto65up <> 2 then {notbuycon = 112;} if stodh10n20hcon == 1 and !(entbartrend > 0 or (upV > upV1 and upV > downV1) or ((lp0123dr > 1 or uplongtrend > 0) and C > dayhigh(0)[1] and spmpnlpdupcon == 1)) then {notbuycon = 113;} if !(lp0123dr > 0 or uplongtrend > 0) and !(sp > lp1 or lp1 > lp1[1]) and !(C > lp1 and V > V[1] and upV > daybgstdownV and upV > daybgstupV and upV > bfdaybgstdownV and upV > bfdaybgstupV) then {notbuycon = 114;} } if C <= dayhigh(0)[1] then { if bidask < 0 and bidask < bidask[1] then {notbuycon = 121;} if (C <= dayhigh(1) or (bar6high + bar6low) / 2 <= dayhigh(1)) and !(bgstvolcon == 1 or bgstupVcon == 1 or entbartrend == 1 or borbfupbidaskcon == 1 or sto65up == 2 or sto130up == 2 or (spmpnlpdupcon == 1 and contbidaskcnt > 0 and (((sto65up == 2 or sto130up == 2) and displp3 > dispL)) or (sto65k > sto65d and sto65dL1 < 21) or (sto65k[1] < stoL and sto65d > sto65dL1))) and (sto10down1 == 2 or sto20down1 == 2 or sto10down2 == 2 or sto20down2 == 2 or stodh10or20downcon == 1) and !(lp1234dr > 0 and lp2 > lp4 and C > d4boxmid and C > d3boxmid and C > lp1 and spmpnlpdupcon == 1 and lp > lp1) then {notbuycon = 122;} if !(lp0123dr > 0 or lp1234dr > 0) and tboxdep <= depvaluemin1 and tboxmid - yboxmid < depvaluemin and (boxshupresist > 1 or box7shupresist > 1) and !(C > yboxmid and (bgstvolcon == 1 or bgstupVcon == 1) and upV > depvaluemin and C > lp1 and (sto65up == 2 or sto130up == 2) and (sto10up > 1 or sto20up > 1)) then {notbuycon = 123;} if tboxdep <= depvaluemin and bfdaydownlpcnt > 7 and !(bgstvolcon == 1 and bgstupVcon == 1) and contgapcnt < 1 and boxupcnt < 2 then {notbuycon = 124;} } if lp1234dr < 0 and !(entbartrend == 1 or bgstvolcon == 1) then { if !(sto10k > sto10d and sto20k > sto20d) then {notbuycon = 131;} if (!(sp > lp1 or (dayindex() == 0 and contgapcnt > 0 and upV >= bfdaybgstdownV) or (dayindex() > 0 and C[1] > O[1] and C > d2boxhigh + Faddbox)) or (lpshupresist == 1 and C <= dayhigh(0)[1] + Faddbox)) and !( (dayopenC > dayhigh(1) and dayopenvol > bfdaybgstvol and dayopenupV > 0.3 and C > dayhigh(1)) or ( spmpnlpdupcon == 1 and contbidaskcnt > 0 and (sto65up == 2 or sto130up == 2) and displp3 > dispL ) ) then //or (sto65k > sto65d and sto65dL1 < stoL) //or (sto65k[1] < stoL and sto65d > sto65dL1) ) ) ) then {notbuycon = 132;} } if sto10k < sto10dh1 and sto10dh1 > stoh and sto20k < sto20dh1 and sto20dh1 > stoh and (sto65k < sto65dh1 and (sto65dh1 > stoh or sto65dh1 < sto65dh2)) and sto130k < sto130d and !(lp0123dr > 1 or uplongtrend > 0 or sto65up1 == 2 or sto130up1 == 2) then {notbuycon = 141;} if dayindex() > 0 and boxshupresist > 0 and box7shupresist > 0 and d4boxdep < depvaluemax and C <= d4boxhigh and bidask < 0 and (contbidaskcnt < 0 or C <= dayhigh(0)[1] + Faddbox) and !(uplongtrend > 0 and (bgstvolcon == 1 or bgstupVcon == 1) and (sto10up > 1 or sto20up > 1) and C > lp1) then {notbuycon = 142;} if dayhigh(0) < d7boxhigh + Faddbox and dayhigh(0) < d4boxhigh + depvaluemin and (boxshupresist > 1 or box7shupresist > 1) and (boxshupresist[1] > 1 or box7shupresist[1] > 1) and (boxshupresist[2] > 1 or box7shupresist[2] > 1) and stodh10or20downcon == 1 and C < dayhigh(0)[1] and C < bar6high[1] and bar6dep < depvaluemin and daydownVavg > dayupVavg * 1.2 then {notbuycon = 143;} if dayindex() == 11 and C < dayhigh(1) and sp < lp1 and (boxshupresist > 0 or box7shupresist > 0) and !((lp0123dr > 1 or lp1234dr > 0) or (uplongtrend > 0 and (bgstvolcon == 1 or bgstupVcon == 1) and (sto10up > 1 or sto20up > 1))) then {notbuycon = 144;} if !(uplongtrend > 0 or (lp1 > lp3 and lp3 > lp4 and lp4 > lp4[1])) and (C < d3boxhigh or C < d4boxhigh) and (sto10k < sto10dh1 or sto20k < sto20dh1) and sto65k < sto65d and box7shupresist > 2 and !(contgapcnt > 0 and C > d2boxhigh and C > lp1 and (downlongtrend == 0 or (C > dayclose(1) * 1.02 and upV > depvaluemin / 2))) then {notbuycon = 145;} if dayindex() == 0 and C <= d3boxhigh + depvaluemin1 and stodh10or20downcon == 1 and !(uplongtrend > 0 or upbidaskcon == 1 or (bgstupVcon == 1 and upV > depvaluemin)) and ((contgapcnt < 1 or (box7shupresist > 0 and contbidaskcnt < -1)) and daylow(0) < d3boxhigh) and !(stok65n130Lcon ==1 and (sto10up == 3 or sto20up == 3) and C > dayclose(1) * 1.02) and !(C > d2boxhigh and C > lp1 and (borbfupbidaskcon == 1 or entbartrend == 1)) then {notbuycon = 146;} if sto65k > stoh and sto130k > stoh and displp3[1] > disph and simri >= simh and stodh10n20hcon == 1 then {notbuycon = 147;} if lp1234dr < 1 and stodh65or130hcon == 1 and stodh10or20hcon == 1 and boxshupresist > 0 and box7shupresist > 1 and sto10k < stoh and sto20k < stoh and !((sto10up > 1 and sto20up > 1) or (bgstvolcon == 1 and bgstupVcon == 1) or upbidaskcon == 1) then {notbuycon = 148;} if (boxshupresist > 0 or box7shupresist > 0) and C <= dayhigh(1) + Faddbox and C <= dayhigh(0)[1] + Faddbox and lp123convercon == 1 and stodh10n20hcon == 1 then {notbuycon = 149;} if lp1234dr < 1 and stodh10or20hcon == 1 and box7shupresist > 0 and box7shupresist[1] > 2 and box7shupresist[2] > 2 and lp123convercon == 1 then {notbuycon = 150;} if !(uplongtrend > 0 or lp0123dr > 1) and d4boxdep < depvaluemin3 + depvaluemid1 and dayhigh(0) < d4boxhigh and daylow(0) > d4boxlow and C < dayhigh(0)[1] and tboxdep < d4boxdep / 2 and upV <= Faddbox then {notbuycon = 151;} if (sto65down2 == 2 and sto130down2 == 2 and sto65k < sto65d and sto130k < sto130d) and lp1 < lp1[1] and lp1[1] < lp1[2] and C < d2boxhigh and !(V > V[1] or contgapcnt > 0) then {notbuycon = 152;} if boxshupresist > 1 and box7shupresist > 0 and stodh10n20downcon == 1 and C <= dayhigh(1) and sto65k < sto65d and ((sto10k < sto10d and sto10down2 == 2) or (sto20k < sto20d and sto20down2 == 2)) then {notbuycon = 153;} if !(uplongtrend > 0 or lp0123dr > 1) and C <= dayhigh(2) and C < lp2 and ((lpshupresist > 0 and boxshupresist > 0 and box7shupresist > 2) or (boxshupresist > 1 and box7shupresist > 2)) then //and bfdaydownlpcnt > 8 then {notbuycon = 154;} if !(uplongtrend > 0 or lp0123dr > 1) and C <= dayhigh(1) and lpshupresist > 0 and C < lp2 and stodh10or20hcon == 1 and stodh10n20downcon == 1 then //and bfdaydownlpcnt > 8 then {notbuycon = 155;} if uplongtrend == 0 and lp123n4convercon == 1 and lpshupresist > 0 and (boxshupresist > 0 or box7shupresist > 0) and C <= d2boxhigh + Faddbox and !(borbfupbidaskcon == 1) then {notbuycon = 156;} if stok65n130hcon == 1 and displp3 > disph and simri >= simh and C <= dayhigh(1) + depvaluemin and C <= d4boxhigh + depvaluemin and stodh10or20downcon == 1 then {notbuycon = 157;} if !(uplongtrend > 0 or lp0123dr > 1) and C < dayhigh(1) and (stodh65or130hcon == 1 or downlongtrend > 0) and stodh10or20hcon == 1 and (lpshupresist > 0 or lpcrupcon > 0) and (boxshupresist > 0 or box7shupresist > 0) and !(upV > depvaluemin1 and (bgstvolcon == 1 or bgstupVcon == 1 or borbfupbidaskcon > 0)) and !(spmpnlpdupcon == 1 and upV > depvaluemin) then {notbuycon = 158;}// 09.01.02 작성 } // ---------- 중간정도및 최대배팅 포지션 매수진입 금지 조건결정 루틴 ---------- // {notbuyregcon = 0; notbuybetcon = 0;} if notbuycon > 0 and !(entbartrend > 0 and (boxshupresist < 2 or box7shupresist < 2)) then {notbuyregcon = 99; notbuybetcon = 99;} if !(entbartrend == 1 or (dayindex() > 3 and upV >= 0.5 and upV > daybgstdownV and upV > daybgstupV)) then { if yboxdep <= Fdepvaluemid and C <= dayhigh(1) and sto65k[1] > stoL and sto65up <> 2 and !(lp0123dr > 2 or lp023dr > 0 or lp1234dr > 0 or (lp0123dr == 2 and contgapcnt > 0) or (sp > lp and lp > lp1 and sp > sp[1] and lp > lp[1])) then {notbuyregcon = 01; notbuybetcon = 01;} if d3boxdep <= Fdepvaluemid and C <= d3boxhigh and C <= dayhigh(0)[1] and sto65k < sto65d and bidask < 0 and upV < 0.3 then {notbuyregcon = 02; notbuybetcon = 02;} if (lp0123dr < 0 or downlongtrend > 0) and !(C > lp1 and lp1 > lp1[1]) and (sto65up < 2 and sto65up1 < 2) and !((dayindex() > 0 or (V > bfdaybgstvol and upV > bfdaybgstdownV and upV > bfdaybgstupV)) and boxupbetcnt > 1 and sto10d > sto10dh1) and !(C > lp1 and spmpnlpdupcon == 1 and C > d2boxhigh + Faddbox and sto10up1 > 1 and sto20up1 > 1) and !(C > d4boxhigh and C > lp1 + Faddbox and C > lp2 and (C > lp3 or stodL65n130upcon == 1)) then {notbuyregcon = 03; notbuybetcon = 03;} if !(splp01dr > 0 or lp0123dr > 0 or uplongtrend > 0 or (boxupcnt > 0 and (sto65k > sto65d or sto20up > 1 or sto10up > 1 or (Cnlp1234con == 2 and spmpnlpdupcon == 1 ))) or (boxupcnt > 1 and contgapcnt > 0) or (sto65up == 2 or sto65up1 == 2) or (C > d4boxhigh + Faddbox and C > lp1 + Faddbox and C > lp2 and C > lp3)) then {notbuyregcon = 04; notbuybetcon = 04;} if d2boxdep < depvaluemid1 and C < d2boxhigh + Faddbox and sto65k < sto65d and (stok10n20hcon == 1 or stodh10or20hcon == 1) then {notbuyregcon = 05; notbuybetcon = 05;} } // ---------- 아래의 매도 금지 조건을 제한하는 조건 ---------- // forcedsellcon = 0; if (lp0123dr < -1 or lp1234dr < 0 or lp1dupcon < 0) or Crossdown520con == 1 or !(C >= daylow(1) and (sp > sp[1] or sp[1] > sp[2] or lp > lp[1] or lp[1] > lp[2]) and (sto10k > sto10dL1 or sto20k > sto20dL1)) then if lp < lp[1] and (lp[1] < lp[2] or bgstvolcon == 1 or bgstdownVcon == 1) then if !(lp123convercon == 1 and C >= daylow(1) and sp > lp1) and !(sto65k > sto65d and sto65k > sto65k[1] and sto65dL1 < stoL and C > lp1 and boxdowncnt < 2) then { if C < lp1 - Faddbox and dayhigh(0) < dayhigh(2) and dayhigh(0) < dayhigh(1) and downV > daybgstupV and sto65k[1] > stoh and sto65k < sto65d and sto20down > 1 and sto10down > 1 and V > V[1] and (sph1 < sph2 or mph1 < mph2 or lph1 < lph2) then {forcedsellcon = 01;} if entbartrend == -1 and (sto20k < sto20d or bgstvolcon == 1) and (C < lp1 or ((sto65k < stoh or sto65k < sto65d) and C < daylow(0)[1])) and !(sto65k > sto65d and ((sto65d > sto65dL1 and sto65dL1 < stoL) or (sto65dL1 > sto65dL2 and sto65dL2 < stoL))) then { if Crossdown520con == 1 then {forcedsellcon = 11;} if lp1 < lp1[1] and lpshdownresist < 2 then { if sto10down1 > 1 and sto20down1 > 1 then {forcedsellcon = 12;} if lp1234dr < 0 or sto65k < sto65d then {forcedsellcon = 13;} if !(sto10d > sto10dL1 and (lp123convercon == 1 or sto10dL1 < stoL or sto10dL1 > sto10dL2)) and !(sto20d > sto20dL1 and (lp123convercon == 1 or sto20dL1 < stoL or sto20dL1 > sto20dL2)) then {forcedsellcon = 14;} } } if (C < daylow(0)[1] - 0.4 and downV > depvaluemin and C < dayhigh(0) * 0.96 and entbartrend == -1 and dayindex() < 10) then {forcedsellcon = 31;} if ( (lp1234dr < 0 or (downlongtrend == 1 and lp1 < lp2 and lp1 < lp3 and lp1 < lp1[1])) and (borbfdownbidaskcon == 1) and contbarcnt < -1 and C < yboxmid and ((dayindex() == 0 and C < dayclose(1)) or C < daylow(0)[1]) ) and !(lp > lp[1] and lp[1] > lp[2]) and !(C > daylow(2) - Faddbox and C >= daylow(1) and C >= daylow(0)[1] - Faddbox and stodL10or20Lcon == 1 and stodL10n20upcon == 1) then {forcedsellcon = 32;} if (entbartrend == -1 and (borbfdownbidaskcon == 1) and bgstvolcon== 1 and bgstdownVcon == 1) and !(downlonglpdr == 0 and lp0123dr > -2 and lp3 > lp3[1] and lp1 > lp3 and lp2 > lp3 and lp3 > lp4 and lp123or4convercon == 1 and stodL10n20upcon == 1 and sto65k > sto65d) then {forcedsellcon = 33;} } { if (lp1234dr < 1 and lp234dr < 1 and sp < lp1 and lp < lp1 and (sto10down > 1 or sto20down > 1) and stodh10or20hcon == 1 and sto65dh1bar < sto65dL1bar and sto65dh1 > stoh and (entbartrend == -1 or clbartrend == -1 or clbartrend1 == 1) and C < daylow(0)[1]) then {forcedsellcon = 51;} if (lpshupresist > 0 and (boxshupresist > 0 or box7shupresist > 0) and (bgstvolcon == 1 or bgstdownVcon == 1) and C < yboxmid and C < tboxmid - Faddbox and downV >= depvaluemin and V > V[1] and V[1] > V[2] and splp1dupcon == -1 and mplpnlp12dupcon == -1) then {forcedsellcon = 54;} if (lp1234dr == -2 and downV > depvaluemid and C < mp and C < lp2 and sto130k < stoL and displp3 < dispL) then {forcedsellcon = 55;} } // ---------- 거래금지 조건 판단(신규 매도진입 금지 조건) ---------- // notsellcon = 0; if forcedsellcon == 0 then { if (sp > lp1 and mp > mp[1]) then {notsellcon = 01;} if !(C[1] <= O[1] or (C < O[1] and C < O[2] and (downV >= Faddbox or C <= C[1] - Faddbox))) then {notsellcon = 02;} if !(boxdowncnt > 0 or (sellmincon > 0 and downV >= Faddbox) or entbartrend == -1 or ((downlongtrend == 1 and lp1 < lp4 and (entbartrend == -1 or clbartrend == -1)) and (downV > depvaluemin or tboxdep > depvaluemin1))) and !((sto10down > 1 or sto20down > 1) and stodh10or20hcon == 1 and sto65dh1bar < sto65dL1bar and sto65dh1 > stoh and (entbartrend == -1 or clbartrend == -1 or clbartrend1 == 1)) then {notsellcon = 03;} if !((sto10k < sto10k[1] or (sto10k < sto10d and sto20k < sto20k[1] and sto20k < sto20d and (contbarcnt < 0 or contvolcnt > 0)) or (contgapcnt < 0 and splpdupcon == -1 and splp1dupcon == -1 and (contbarcnt < 0 or contvolcnt > 0))) and (sto10k < sto10d or (dayindex() == 0 and C < dayclose(1)) or (mp < mp[1] and V > V[1]) or bgstvolcon == 1 or (downV > daybgstupV and downV > daybgstdownV) or (bgstdownVcon == 1 and spmpnlpdupcon == -1))) then {notsellcon = 04;} if !(sto20k < sto20d or lp < lp[1] or (Crossdown520con == 1 and downV > depvaluemin and (entbartrend == -1 or bgstvolcon == 1)) or ((downlongtrend == 1 and lp1 < lp4 and (entbartrend == -1 or clbartrend == -1)) and (downV > depvaluemin or tboxdep > depvaluemin1))) and !(lp1234dr < 0 and (borbfdownbidaskcon == 1) and contbarcnt < -1 and C < yboxmid and ((dayindex() == 0 and C < dayclose(1)) or C < daylow(0)[1]) ) then {notsellcon = 05;} if !((sto20k < stoL and downV >= 0.3) or sto20k >= stoL) and !(C < d4boxlow and C < daylow(0)[1]) and !(contgapcnt < 0 and splpdupcon == -1 and splp1dupcon == -1 and (contbarcnt < 0 or contvolcnt > 0)) then {notsellcon = 06;} if downV * 2 < downupV and downupV >= 0.5 and !(C < daylow(1) or C < daylow(0)[1]) then {notsellcon = 07;} if C >= daylow(1) and C >= daylow(2) and stodL10n20upcon == 1 and !(downlongtrend == 1 or lp0123dr < -1 or downV > depvaluemin / 2 or sto65down == 2 or sto130down == 2 or borbfdownbidaskcon == 1) then {notsellcon = 08;} if (lp123convercon == 1 and C >= daylow(1) and sp > lp1 and downV < depvaluemin) then {notsellcon = 11;} if (sto65k > sto65d and sto65k > sto65k[1] and sto65dL1 < stoL and C > lp1 and boxdowncnt < 2) then {notsellcon = 12;} if !(dayhigh(0) < daylow(1) or (bidask < 0 and bidask < bidask[1]) or boxdowncnt > 0 or (V > V[1] and C < daylow(0)[1]) or bgstvolcon == 1 or (downV > daybgstupV and downV > daybgstdownV and C < daylow(0)[1] and stok10n20Lcon == 0) or ((downlongtrend == 1 and lp1 < lp4 and (entbartrend == -1 or clbartrend == -1)) and (downV > depvaluemin or tboxdep > depvaluemin1))) then {notsellcon = 23;}// 2007.1Faddbox8 수정 if !(splp01dr < 0 or lp0123dr < 0 or downlongtrend > 0 or boxdowncnt > 0 or downbidaskcon == 1 or entbartrend == -1) and !(V > V[1] * 2 and bgstdownVcon == 1 and downV > depvaluemin and sto65up == 0 and sto130up == 0 and C < daylow(0)[1] - Faddbox) then {notsellcon = 24;}// 2007.5.1 수정 if (lp0123dr > 2 or uplongtrend > 0) and yboxdep <= Fdepvaluemax and boxdowncnt == 0 and entbartrend == 0 and !(V > V[1] * 2 and bgstdownVcon == 1 and downV > depvaluemin and sto65up == 0 and sto130up == 0 and C < daylow(0)[1] - Faddbox) then {notsellcon = 25;} if bidask > bidask[1] and bapL1 > bapL2 and !(bgstvolcon == 1 and (C < d4boxlow or (crossdown520con == 1 and bgstdownVcon == 1))) and !((bgstvolcon == 1 or bgstdownVcon == 1) and downlongtrend > 0 and C < lp1 and C < d2boxlow) and !(contgapcnt < 0 and splpdupcon == -1 and splp1dupcon == -1 and (contbarcnt < 0 or contvolcnt > 0)) then {notsellcon = 26;} if sto20k < stoL and yboxdep < Fdepvaluemid and tboxdep < Fdepvaluemid and boxdowncnt < 1 and C >= daylow(0) then {notsellcon = 27;} if (lp0123dr > 0 or uplongtrend > 0 or contgapcnt >= 0) and d2boxdep < Fdepvaluemid and C > d2boxlow - 0.3 and stok10or20Lcon == 1 and sto10k > sto10kL1 then {notsellcon = 28;}// 2007.5.1 수정 if contboxcnt > 1 and C >= d2boxlow and (sto65k < stoL or stok10or20Lcon == 1 or sto20k > sto20dL1) and !(Crossdown520con == 1 and downV > depvaluemin and (entbartrend == -1 or bgstvolcon == 1)) and !((downlongtrend == 1 and lp1 < lp4 and (entbartrend == -1 or clbartrend == -1)) and (downV > depvaluemin or tboxdep > depvaluemin1)) then {notsellcon = 29;}// 2007. 5. 21작성- 2회 이상의 박스권에서 매도거래금지-매수와 조건 상이 if d3boxdep <= Fdepvaluemid and C >= d3boxlow -Faddbox and dayhigh(0) <= d3boxhigh and sto65k < stoh and !(contgapcnt < 0 or C < d2boxlow - Faddbox) and !(lp023dr < -2 or lp1234dr < -1) and !((lp1234dr < 0 or (downlongtrend == 1 and lp1 < lp2 and lp1 < lp3 and lp1 < lp1[1])) and (borbfdownbidaskcon == 1) and contbarcnt < -1 and C < yboxmid and ((dayindex() == 0 and C < dayclose(1)) or C < daylow(0)[1]) ) and !(spmpnlpdupcon == -1 and bgstvolcon == 1 and bgstdownVcon == 1) and !(stok65n130hcon == 1 and stodh65or130hcon == 1 and spmpnlpdupcon == -1 and C < d2boxlow) then {notsellcon = 30;} if lp1234dr > 0 and lp > lp1 and !(C < d2boxlow - Faddbox or downV >= 1 or entbartrend == -1) then {notsellcon = 32;} if lp234dr == 1 and lp1 < lp1[1] and !(O > lp1 and O > lp2 and C < lp1 and C < lp2) and !(contgapcnt < 0 or entbartrend == -1 or lp1dupcon == -1 or (lp0123dr < 0 and spmpnlpdupcon == -1 and yboxmid - tboxmid > 0 and ((!(yboxmid - tboxmid < depvaluemin and y2boxmid - yboxmid < depvaluemin) or (sto10down == 3 or sto20down == 3)) and (yboxmid - tboxmid > depvaluemin or bgstvolcon == 1 or bgstdownVcon == 1)) and (lpshdownresist == 0 or bgstvolcon == 1 or bgstdownVcon == 1) and ((sto65dh1 > stoh and C < d2boxlow - Faddbox and C < daylow(0)[1] - Faddbox and (bapdown == 2 or contbidaskcnt < 0)) or sto65down == 2 or sto130down == 2))) and !(lp0123dr < 0 and C < lp1 and C < lp2 and C < lp3 and bgstvolcon == 1 and bgstdownVcon == 1) then {notsellcon = 33;} if sto10k > sto10d and !(lp0123dr < -2 or downlongtrend > 0 or entbartrend == -1 or clbartrend == -1) and (boxdowncnt == 0 or sto10k > sto10dh1 or sto20k > sto20dh1 or (sto10dL1 < stoL and sto10k > sto10kL1)) and !(downV >= 0.5 and V > V[1] and C < daylow(0)[1]) then {notsellcon = 34;} if lp1234dr == 2 and !(boxdowncnt > 2 or sto10down > 1 or sto20down > 1 or (C < lp1 and boxdowncnt > 1 and sto65k < sto65d)) then {notsellcon = 35;} if dayindex() > 0 and lp1 > lp1[1] and !(entbartrend == -1 or sto65k < sto65d or boxdowncnt > 1 or (boxdowncnt > 0 and C < lp1 - Faddbox and stok65n130hcon == 1 and downV > depvaluemin3) or ((sto20down1 == 2 or sto10down1 == 2) and (downlongtrend > 0 or (bgstvolcon == 1 and clbartrend < 0 and downV > depvaluemin / 2) or (bgstdownVcon == 1 and downV > depvaluemin) or (borbfdownbidaskcon > 0 and stok65or130hcon == 1)))) then {notsellcon = 36;} if !( (sp < sp[1] and sp[1] < sp[2]) or entbartrend == -1 or clbartrend == -1 or downV > daybgstupV or downV1 > daybgstupV or V > dayopenvol or V[1] > dayopenvol or ((borbfdownbidaskcon == 1) and (V > V[1] or V[1] > V[2])) ) then {notsellcon = 37;} if !((lp0123dr < 0 or downlongtrend > 0) and sp < lp2 and sp < lp3 and lp3 < lp3[1]) and sto20k[1] < stoL and sto10k > sto10dL1 and sto10k > stoL then {notsellcon = 38;} if lp1234dr > 0 and dayindex() > 2 and C >= daylow(0)[1] - Faddbox and downbidaskcon == 0 and contgapcnt == 0 and sto65k < stoh then {notsellcon = 39;} if (lp1234dr > 0 or (lp234dr > 0 and lp1 > lp2)) and C > lp2 and boxdowncnt < 2 and !(sph1 < sph2 or mph1 < mph2 or lph1 < lph2 or downhb5con == 1 or downhb10con == 1 or downhb20con == 1) then {notsellcon = 40;} if sto65k < stoL and sto10dh1 >= sto10dh2 and sto20dh1 >= sto20dh2 and ((sto10dL1 > sto10dL2 and sto10k > sto10dL1 and sto10dL1 < stoL) or (sto20dL1 > sto20dL2 and sto20k > sto20dL1 and sto20dL1 < stoL)) and !(lp1234dr < 0 and (borbfdownbidaskcon == 1) and contbarcnt < -1 and C < yboxmid and ((dayindex() == 0 and C < dayclose(1)) or C < daylow(0)[1]) ) then {notsellcon = 41;} if lp1234dr > -1 and !((sto10down > 2 or sto20down > 2) and (borbfdownbidaskcon == 1) and (lp1234dr < 0 or lp123n4convercon == 0)) and C >= daylow(1) - Faddbox and C >= d4boxlow and sto65k > sto65d and ((sto10d > sto10dL1 and (lp123convercon == 1 or sto10dL1 < stoL)) or (sto20d > sto20dL1 and (lp123convercon == 1 or sto20dL1 < stoL))) and !(V > V[1] * 2 and bgstdownVcon == 1 and downV > depvaluemin and sto65up == 0 and sto130up == 0 and C < daylow(0)[1] - Faddbox) then {notsellcon = 42;} if daysellclcon == 1 then //and !(V > V[1] and V > vp and C < daylow(0)[1] -Faddbox) then { if !(C < daylow(0)[1] - Faddbox or (sp[1] >= lp1 and sp < lp1) //or (V > V[1] and V > vp) or downbidaskcon == 1 or (bfdownbidaskcon == 1 and bidask < bidask[1]) or (dayindex() > 0 and ((downV > daybgstupV and downV > daybgstdownV and V > V[1]) or (bgstdownVcon == 1 and spmpnlpdupcon == -1)))) then {notsellcon = 61;} if sto65k < stoL and sto130k < stoL and sto20k < stoL and sto10k > sto10d and sto10dL1 < stoL and C >= daylow(0) - Faddbox then {notsellcon = 62;} } if dayindex() == 0 and !(lp1234dr < 0 and (borbfdownbidaskcon == 1) and contbarcnt < -1 and C < yboxmid and ((dayindex() == 0 and C < dayclose(1)) or C < daylow(0)[1]) ) then { if (C >= daylow(1) or (sto65k < stoL and !(downV > bfdaybgstupV and downV > bfdaybgstupV))) then {notsellcon = 71;} if C < daylow(1) and downV < 1 and downupV > downV * 2 then {notsellcon = 72;} } if stodL10or20Lcon == 1 then { if lp1234dr > -1 and sto65k < stoL and C >= daylow(1) and downV < daybgstupV and downV < daybgstdownV then {notsellcon = 81;} } if sto20k > sto20d and !((lp1234dr < 0 or (downlongtrend == 1 and lp1 < lp2 and lp1 < lp3 and lp1 < lp1[1])) and (borbfdownbidaskcon == 1) and contbarcnt < 0 and C < yboxmid and ((dayindex() == 0 and C < dayclose(1)) or C < daylow(0)[1]) ) then { if !(splp01dr < 0 or lp0123dr < -1 or downlongtrend > 0 or boxdowncnt > 1 or (lp < lp[1] and lp[1] < lp[2]) or Crossdown520con == 1) and !(bgstvolcon == 1 or bgstdownVcon == 1 or entbartrend == -1) then {notsellcon = 91;} if (sto10dL1 < stoL and sto10k > sto10dL1) and !(lp < lp[1] and contgapcnt < 0) and ((!((sto10k < sto10d and sto10dh1 < sto10dh2 and sto20k < sto20k[1] and sto20k < sto20dh1) or (sto10dL1 > sto10dL2 or sto20dL1 > sto20dL2))) or (dayclose(1) < yboxmid and dayopen(0) > dayclose(1) and dayopen(0) > yboxmid and sto10dL1 < stoL)) and !(mplpnlp12dupcon == -1 and C < daylow(0)[1] and downV > daybgstupV and downV > depvaluemin / 2 and displp3 < dispL and simri <= simL and sto65k < stoL and sto20k < 30 and sto10k < 30) and !(sto10k < sto10d and spmpnlpdupcon == -1 and mplpnlp12dupcon == -1 and bapdown == 2 and C < daylow(0)[1] - Faddbox) then {notsellcon = 92;} if sto65k < stoL and lp[1] > lp[2] then //or lp[2] > lp[3]) then {notsellcon = 93;} if !(lp < lp[1] and lp[1] < lp[2]) and !((Crossdown520con == 1 and (bgstvolcon == 1 or bgstdownVcon == 1)) or (downlongtrend == 1 and (entbartrend == -1 or clbartrend == -1) and tboxdep > depvaluemin1)) then {notsellcon = 94;} } if sto65k > sto65d then { if lp1 > lp1[1] and sp > lp1 then { if upgapcon == 1 and C > upgaplow and !(lp0123dr < 0 or downlongtrend > 0) and !(((entbartrend == -1 or downbidaskcon == 1) and (sto10down > 1 or sto20down > 1)) or (C < lp1 - Faddbox and (bgstvolcon == 1 or bgstdownVcon == 1) and (sto65k > stoh or sto130k > stoh) and (sto10down == 3 or sto20down == 3))) then {notsellcon = 101;} if lpshdownresist > 1 and !(lp0123dr < 0 or downlongtrend > 0) then {notsellcon = 102;} } if dayindex() == 0 and (O > d3boxlow or O > d4boxlow) and H - C < C - L and C - L >= 0.5 and ((sto20k > sto20dL1 and sto20down <> 2) or (sto10k > sto10dL1 and sto10down <> 2)) then {notsellcon = 103;} if C >= daylow(1) and C >= daylow(2) and !(entbartrend == -1 or clbartrend == -1 or sto10down > 1 or sto20down > 1 or bgstvolcon == 1) then {notsellcon = 104;} if sto65dL1 > sto65dL2 and sto65dL2 < stoL and C >= daylow(1) - Faddbox and C >= d2boxlow and C >= d4boxlow and entbartrend == 0 and sto65k < stoh and !((V > V[1] and downV > upV1) or (spmpnlpdupcon == -1 and contbidaskcnt < 0 and (sto65down == 2 or sto130down == 2 or sto10down > 1 or sto20down > 1) and displp3 < disph)) then// 2008.01.22 작성 {notsellcon = 105;} } if C > daylow(1) and !((sto10down > 1 or sto20down > 1) and stodh10or20hcon == 1 and sto65dh1bar < sto65dL1bar and sto65dh1 > stoh and (entbartrend == -1 or clbartrend == -1 or clbartrend1 == 1)) and !(bgstvolcon == 1 and bgstdownVcon == 1 and lp < lp1 and C < lp and lp < lp[1]) then { if C > daylow(0)[1] and !((sto10down > 2 or sto20down > 2) and (borbfdownbidaskcon == 1) and (lp1234dr < 0 or lp123n4convercon == 0)) and ((lp1234dr > -1 and sto65k < stoh) or (sto65k < stoL and daylow(0) >= daylow(1))) and !(lp1234dr < 0 and (borbfdownbidaskcon == 1) and contbarcnt < -1 and C < yboxmid and ((dayindex() == 0 and C < dayclose(1)) or C < daylow(0)[1]) ) then {notsellcon = 111;} if !(lp0123dr < -1 or downlongtrend > 0) and !(((sp < sp[1] and sp[1] < sp[2] and lp < lp[1] and lp[1] < lp[2]) or entbartrend == -1 or downV > daybgstupV or downV1 > daybgstupV or ((borbfdownbidaskcon == 1) and (V > V[1] or V[1] > V[2])) or V > dayopenvol or V[1] > dayopenvol) and (dayuplpcnt < 6 or sto65k > stoh)) and !(V > V[1] * 2 and bgstdownVcon == 1 and downV > depvaluemin and sto65up == 0 and sto130up == 0 and C < daylow(0)[1] - Faddbox) then {notsellcon = 112;} } if lp1234dr > 0 and !(entbartrend == -1 or bgstvolcon == 1) then { if !(sto10k < sto10d and sto20k < sto20d) then {notsellcon = 121;} } if C >= daylow(0)[1] then { if C >= daylow(1) and sto65k < stoL and stodL10or20Lcon == 1 and !(entbartrend == -1 or borbfdownbidaskcon == 1 or bgstvolcon == 1 or bgstdownVcon == 1) then {notsellcon = 131;} } if lp1 > lp1[1] and lp1[1] > lp1[2] and lp1 > lp2 and lp2 > lp3 and !(sto65k > stoh or sto130k > stoh or (sto65d < sto65dh1 and sto65dh1 > stoh) or boxdowncnt > 1) and (dayindex() == 0 or !(entbartrend == -1 or bgstvolcon == 1 or bgstdownVcon == 1)) then { if C > lp1 - Faddbox then {notsellcon = 141;} if spnlp1234con > 0 then {notsellcon = 142;} } if !(C < lp1 - Faddbox and (C[1] < lp1[1] - Faddbox or downV >= Faddbox)) then { if uplongtrend > 0 and sto65k > sto65d and !(V > V[1] * 2 and bgstdownVcon == 1 and downV > depvaluemin and sto65up == 0 and sto130up == 0 and C < daylow(0)[1] - Faddbox) then { if C >= daylow(1) then {notsellcon = 151;} if C >= d2boxlow - Faddbox and !(entbartrend == -1 or (bgstvolcon == 1 and bgstdownVcon == 1)) then {notsellcon = 152;} } } if boxshdownresist + box7shdownresist > 4 and C >= daylow(0)[1] and !(contgapcnt < 0 and dayhigh(0) < d2boxlow) and (lp123convercon == 1 or stok10or20Lcon == 1 or stodL10or20Lcon == 1) then {notsellcon = 161;} if !(lp0123dr < -1 or downlongtrend > 0) and (boxshdownresist > 1 or box7shdownresist > 1) and dayclose(1) - C < depvaluemid and bar6dep < depvaluemin1 and C >= daylow(0)[1] and C >= d2boxlow and C >= d3boxlow and C >= d4boxlow then {notsellcon = 162;} if dayindex() > 0 and boxshdownresist > 0 and box7shdownresist > 0 and d4boxdep < depvaluemax and C >= d4boxlow and bidask > 0 and !(contbidaskcnt < 0 or C < dayhigh(0)[1] - Faddbox) then {notsellcon = 163;} if sto65k > sto65d and C >= d2boxlow and !(entbartrend == -1 or bgstvolcon == 1 or bgstdownVcon == 1 or lp1234dr < -1 or borbfdownbidaskcon == 1) and ((sto10dL1 > sto10dL2 and sto10k > sto10dL1) or (sto20dL1 > sto20dL2 and sto20k > sto20dL1)) then {notsellcon = 164;} if lp[1] - lp < 0.02 and bfdayuplpcnt > 6 and dayclose(1) > bfdaycloselp and lp1234dr > -1 and C >= d2boxlow - Faddbox and box7shdownresist > 1 and !(entbartrend == -1 or downbidaskcon == 1) then {notsellcon = 165;} if C >= d4boxlow - depvaluemin and (boxshdownresist > 0 or box7shdownresist > 0) and sto10dL1 < stoL and sto10k > sto10dL1 and sto10dL1bar < sto10dh1bar and sto10dL1bar < 10 then {notsellcon = 166;} if stodL10or20Lcon == 1 and C >= daylow(1) - Faddbox and (boxshdownresist > 0 or box7shdownresist > 0) and sto20k < stoL then {notsellcon = 167;} if dayindex() == 0 and C >= d3boxlow and contgapcnt > -1 and (O - C) / 2 < C - L and stodL10or20upcon == 1 then {notsellcon = 168;} if uplongtrend > 0 and C >= d2boxlow - Faddbox and downV < Faddbox and C >= daylow(0)[1] then {notsellcon = 169;} if C >= daylow(1) - Faddbox and C >= d4boxlow - Faddbox and (stodL10or20upcon == 1 or stok10or20Lcon == 1) and d4boxdep < Fdepvaluemax and !((lp1234dr < -1 and (sto65down == 2 or sto130down == 2)) or (sto65k < sto65d and sto65dh1 > stoh and sto65dh1bar < sto65dL1bar)) then {notsellcon = 170;} if downlongtrend == 0 and C >= daylow(1) then { if (lpshdownresist > 0 or lpshdownresist[1] > 0) and sto20k > sto20d and sto65k > stoL then {notsellcon = 171;} if ((yboxdep < depvaluemin3) or (yboxdep < Fdepvaluemid)) and sto20k > sto20d and !(sto10k < sto10d and spmpnlpdupcon == -1 and mplpnlp12dupcon == -1 and bapdown == 2 and C < daylow(0)[1] - Faddbox) then {notsellcon = 172;} } if d4boxdep < depvaluemax and d3boxhigh > dayhigh(1) and dayhigh(1) > dayhigh(0) and d3boxlow < daylow(1) and C >= daylow(1) - Faddbox and sto65k > sto65d and sto65dL1 < stoL and lp > lp[1] and lp[1] > lp[2] then {notsellcon = 181;} if C > daylow(2) - Faddbox and C >= daylow(1) and C >= daylow(0)[1] - Faddbox and stodL10or20Lcon == 1 and stodL10n20upcon == 1 and !(entbartrend < 0 or bgstvolcon == 1) then {notsellcon = 182;} if dayindex() == 0 and stodL65or130Lcon == 1 and stodL10n20Lcon == 1 and contbidaskcnt > 1 and C >= d2boxlow and bfdayuplpcnt > 7 then {notsellcon = 183;} if lp > lp[1] and lp[1] > lp[2] then { if !(bgstvolcon == 1 or bgstdownVcon ==1 or H < lp) then {notsellcon = 191;}// 08.10.21 작성 } if downlongtrend == 0 and lp1 > lp1[1] and stok10n20Lcon == 1 and lp123convercon == 1 and (sto65up == 2 or sto130up == 2 or (sto65d > sto65dL1 and sto65dL1 < stoL) or (sto130d > sto130dL1 and sto130dL1 < stoL)) and !(splp1dupcon == -1 or mplp1dupcon == -1 or lplp1dupcon == -1) then {notsellcon = 201;} if downlonglpdr == 0 and lpshdownresist > 0 and (boxshdownresist > 0 or box7shdownresist > 0) and stodL65or130Lcon == 1 and stodL10or20upcon == 1 and C >= daylow(1) - depvaluemin1 and C >= d2boxlow then {notsellcon = 202;} if lp > lp[1] and lp[1] > lp[2] then { if C >= d4boxlow and C >= d7boxlow and C <= d4boxlow + depvaluemin1 and C <= d7boxlow + depvaluemin1 and stodL10n20upcon == 1 then {notsellcon = 211;} } if dayindex() == 0 then { if V > bfdayopenvol then { if ((sto10k > sto10d and sto10d > sto10dL1 and sto10dL1 < stoL) and (sto20k > sto20d and sto20d > sto20dL1 and sto20dL1 < stoL)) then {notsellcon = 221;} } else if ((sto10k > sto10d and sto10d > sto10dL1 and sto10dL1 < stoL) or (sto20k > sto20d and sto20d > sto20dL1 and sto20dL1 < stoL)) then {notsellcon = 222;} if downlongtrend == 0 and bidask > bidask[1] and (sto20up > 1 or sto10up > 1 or stodL10or20Lcon == 1) and sto10d > sto10d[1] and (boxshdownresist > 0 or box7shdownresist > 0) then {notsellcon = 223;} } if !(downlongtrend == 1 or lp023dr < -1) and lpshdownresist > 0 and (boxshdownresist > 0 or box7shdownresist > 0) and C >= daylow(1) - 0.3 and C >= daylow(0)[1] - Faddbox and lp123or4convercon == 1 then {notsellcon = 231;} if C >= daylow(1) and downV <= depvaluemin1 and downV <= downupV + Faddbox and (lpcrdownresist > 0 or lpshdownresist > 0 or lpcrdowncon == 1) and (boxshdownresist > 0 or box7shdownresist > 0) and !(entbartrend < 0 or bgstvolcon == 1 or bgstdownVcon == 1) then {notsellcon = 232;} if !(downlonglpdr == 1 or lp0123dr < -1) and lp3 > lp3[1] and lp1 > lp3 and lp2 > lp3 and lp3 > lp4 and lp123or4convercon == 1 and stodL10n20upcon == 1 and sto65k > sto65d then {notsellcon = 233;} if lp1234dr == 2 and C > lp1 - Faddbox and sp > lp1 and lp > lp1 and C >= daylow(1) then {notsellcon = 234;} } // ---------- 중간정도및 최대배팅 포지션 매도진입 금지 조건결정 루틴 ---------- // {notsellregcon = 0; notsellbetcon = 0;} if notsellcon > 0 and !(entbartrend < 0) then {notsellregcon = 99; notsellbetcon = 99;} if !(entbartrend == -1 and (borbfdownbidaskcon == 1) and bgstdownVcon == 1) then if !(C < lp1 - Faddbox and dayhigh(0) < dayhigh(2) and dayhigh(0) < dayhigh(1) and downV > daybgstupV and sto65k[1] > stoh and sto65k < sto65d and sto20down > 1 and sto10down > 1 and V > V[1] and (sph1 < sph2 or mph1 < mph2 or lph1 < lph2)) then if !(sp < lp1 and lp < lp1 and (sto10down > 1 or sto20down > 1) and stodh10or20hcon == 1 and sto65dh1bar < sto65dL1bar and sto65dh1 > stoh and (entbartrend == -1 or clbartrend == -1 or clbartrend1 == 1)) then { if C < O and downV <= Faddbox and downV1 <= Faddbox and (sto10k < stoL or sto20k < stoL) then {notsellregcon = 01; notsellbetcon = 01;} if d2boxdep < Fdepvaluemax and C >= d2boxlow and sto65k[1] < stoh and sto65down < 2 and sto130down < 2 and !(downV > d2boxdep / 2 or (bgstvolcon == 1 and bgstdownVcon == 1 and downbidaskcon == 1) or C < d2boxlow - Faddbox) and !(lp0123dr < -2 or lp023dr < 0 or lp1234dr < 0 or (lp0123dr == -2 and contgapcnt < 0)) and !(spmpnlpdupcon == -1 and bgstvolcon == 1 and bgstdownVcon == 1 and sto20k < sto20d and C < lp1 and (sto10down > 1 or sto20down > 1) and contbidaskcnt < 0 and stodL10or20Lcon == 0) then {notsellregcon = 02; notsellbetcon = 02;} if yboxdep < Fdepvaluemid and C >= daylow(1) and sto65k[1] < stoh and sto65down < 2 and sto130down < 2 and !(lp0123dr < -2 or lp023dr < 0 or lp1234dr < 0 or (lp0123dr == -2 and contgapcnt < 0)) and !(spmpnlpdupcon == -1 and bgstvolcon == 1 and bgstdownVcon == 1 and sto20k < sto20d and C < lp1 and (sto10down > 1 or sto20down > 1)) then {notsellregcon = 03; notsellbetcon = 03;} if ((lp0123dr > 0 or uplongtrend > 0) and !(C < lp1 and lp1 < lp1[1]) and sto65down < 2 and sto130down < 2 and downV <= Faddbox) or boxupbetcnt > 0 then {notsellregcon = 04; notsellbetcon = 04;} if !(splp01dr < 0 or lp0123dr < 0 or downlongtrend > 0 or (boxdowncnt > 0 and (sto65k < sto65d or sto20down > 1 or sto10down > 1 or (Cnlp1234con == -2 and spmpnlpdupcon == -1))) or (entbartrend == -1 and (sto10down > 1 or sto20down > 1 or (Cnlp1234con == -2 and spmpnlpdupcon == -1)) and (sto65down == 2 or sto65k + 3 < sto65dh1)) or (boxdowncnt > 1 and contgapcnt < 0) or (sto65down == 2 or sto65down1 == 2) or (spmpnlpdupcon == -1 and mplpnlp12dupcon ==-1 and (bgstvolcon == 1 or bgstdownVcon == 1)) or (spmpnlpdupcon == -1 and bgstvolcon == 1 and bgstdownVcon == 1) ) then {notsellregcon = 05; notsellbetcon = 05;} if !(lp1 < lp1[1] or C < lp1 or contgapcnt < 0 or entbartrend < 0) and sto65down <> 2 and sto130down <> 2 and !(C < daylow(1) and downV > daybgstupV and downV > bfdaybgstupV and V > V * 1.5 and (sto10down > 1 or sto20down > 1)) then {notsellregcon = 06; notsellbetcon = 06;} if lp234dr > 0 and C > lp2 //and !(uplongtrend == 0 and C < d2boxlow - Faddbox) and !(entbartrend == -1 or downbidaskcon == 1 or sto65down == 2 or sto20down > 1 or contgapcnt < 0) then {notsellregcon = 07; notsellbetcon = 07;} if bflp1234dr > 0 and lp1234dr == 0 and !(downV > Faddbox or contgapcnt > 0) then {notsellregcon = 08; notsellbetcon = 08;} if dayindex() > 3 and tboxdep <= Fdepvaluemin and C >= daylow(0)[1] - Faddbox and downV <= 0.3 and !(contgapcnt < 0 and splpdupcon == -1 and splp1dupcon == -1 and (contbarcnt < 0 or contvolcnt > 0)) then {notsellregcon = 10; notsellbetcon = 10;} if (uplongtrend > 0 or sto65up1 == 2 or sto130up1 == 2) and !(C < lp1 - 0.3 and (C[1] < lp1[1] - Faddbox or downV >= 0.3)) and !((downlongtrend == 1 and lp1 < lp4 and (entbartrend == -1 or clbartrend == -1)) and (downV > depvaluemin or tboxdep > depvaluemin1)) then {notsellregcon = 11; notsellbetcon = 11;}// 07.7.1 수정(매도진입전체적용시 수익률 하락함) if C >= daylow(1) and stodL10n20Lcon == 1 and (downV < upV1 or downV < downV1) and !(lp1234dr < 0 and (borbfdownbidaskcon == 1) and contbarcnt < -1 and C < yboxmid and ((dayindex() == 0 and C < dayclose(1)) or C < daylow(0)[1]) ) and !(sto10k < sto10d and spmpnlpdupcon == -1 and mplpnlp12dupcon == -1 and bapdown == 2 and C < daylow(0)[1] - Faddbox) then {notsellregcon = 12; notsellbetcon = 12;} if lp1 > lp1[1] then { if !(lp0123dr < 0 or downlongtrend > 0) and contgapcnt < 0 and C > dayopen(0) and downV <= 0.3 then {notsellregcon = 21; notsellbetcon = 21;} if (sto20k < stoL or sto10k < stoL) and dayindex() == 11 then {notsellregcon = 22; notsellbetcon = 22;} if !(entbartrend == -1 or borbfdownbidaskcon == 1 or sto65k < sto65d or sto20down1 == 2 or sto10down1 == 2 or boxdowncnt > 1 or (boxdowncnt > 0 and C < lp1 - Faddbox and stok65n130hcon == 1 and downV > depvaluemin3)) then {notsellregcon = 23; notsellbetcon = 23;} if (!(uplongtrend == 0 and C < d2boxlow - Faddbox) and !(C < d3boxlow) and sto65k < stoh and stok10or20Lcon == 1) or (stok10n20Lcon == 1 and (C >= daylow(0)[1] - Faddbox or bidask > bidask[1])) and !(downlongtrend == 1 and sp < lp1 and (bgstvolcon == 1 or bgstdownVcon == 1 or entbartrend < 0)) then {notsellregcon = 24; notsellbetcon = 24;} } if sto65k < stoL and sto20k < stoL and sto20d > sto20dL1 and sto20dL1 < stoL and sto10k < stoL and sto10d > sto10dL1 and sto10dL1 < stoL then {notsellregcon = 31; notsellbetcon = 31;} if lp1234dr == 2 and !(contgapcnt < 0 or sp < lp1 ) and dayindex() > 3 and !((downV > daybgstdownV and downV > daybgstupV) or C < daylow(0)[1] - Faddbox or entbartrend == -1) then {notsellregcon = 32; notsellbetcon = 32;} if sto65k > sto65d then { if !(lp0123dr < 0 or lp1234dr < 0) and C >= L[1] and downV < 0.3 then {notsellregcon = 41; notsellbetcon = 41;} if (dayindex() == 11 or stime == 143000) and lp123n4convercon == 1 and !((C < lp2 and C < lp3 and C < lp4 and lp2 < lp2[1] and lp3 < lp3[1] and lp4 < lp4[1])) then {notsellregcon = 42; notsellbetcon = 42;}// 이평선수렴시 } } // ---------- 과열권 또는 과냉권에서 위험관리을 위해 빨리 청산하는 조건 ---------- // {addbuyclcon = 0; addbuyclconcnt = 0;} //if notbuyclgrd < 3 then { { //if (C > dayclose(4) * 1.1 or C > dayclose(2) * 1.07 or C > dayclose(1) * 1.04) then // {addbuyclcon = 01; addbuyclconcnt = addbuyclconcnt + 1;} if sto10down > 1 or sto20down > 1 then {addbuyclcon = 02; addbuyclconcnt = addbuyclconcnt + 1;} if lpshupresist > 0 then {addbuyclcon = 03; addbuyclconcnt = addbuyclconcnt + 1;} if boxshupresist > 0 or box7shupresist > 0 then {addbuyclcon = 04; addbuyclconcnt = addbuyclconcnt + 1;} if entbartrend == -1 or clbartrend == -1 or clbartrend == -1 then {addbuyclcon = 05; addbuyclconcnt = addbuyclconcnt + 1;} if (borbfdownbidaskcon == 1 or (bidask < 0 and bapdown == 2 and contbidaskcnt < 0)) then {addbuyclcon = 06; addbuyclconcnt = addbuyclconcnt + 1;} if bgstvolcon == 1 or (dayindex() > 0 and ((V > V[1] * 1.5 and V > vp) or V > V[1] * 1.7)) then {addbuyclcon = 07; addbuyclconcnt = addbuyclconcnt + 1;} if bgstdownVcon == 1 or downV > depvaluemin1 then {addbuyclcon = 08; addbuyclconcnt = addbuyclconcnt + 1;} //if lp1234dr < 2 and (sto20k[1] > stoh or sto10k[1] > stoh) and stodh10or20hcon == 1 then // {addbuyclcon = 09; addbuyclconcnt = addbuyclconcnt + 1;} //if stok10n20hcon == 1 then // {addbuyclcon = 10;} } } {addsellclcon = 0; addsellclconcnt = 0; addsellclcon99 = 0; addsellclconcnt99 = 0;} //if notsellclgrd < 3 then { { if C < dayclose(1) * 0.96 or C < dayclose(2) * 0.96 or C < dayclose(3) * 0.94 or C < dayclose(4) * 0.92 then {addsellclcon99 = 01; addsellclconcnt99 = addsellclconcnt99 + 1;} if sto10up > 1 or sto20up > 1 then {addsellclcon = 02; addsellclconcnt = addsellclconcnt + 1; addsellclcon99 = 02; addsellclconcnt99 = addsellclconcnt99 + 1;} if lpshdownresist > 0 then {addsellclcon = 03; addsellclconcnt = addsellclconcnt + 1; addsellclcon99 = 03; addsellclconcnt99 = addsellclconcnt99 + 1;} if boxshdownresist > 0 or box7shdownresist > 0 then {addsellclcon = 04; addsellclconcnt = addsellclconcnt + 1; addsellclcon99 = 04; addsellclconcnt99 = addsellclconcnt99 + 1;} if entbartrend == 1 or clbartrend == 1 or clbartrend1 == 1 then {addsellclcon = 05; addsellclconcnt = addsellclconcnt + 1; addsellclcon99 = 05; addsellclconcnt99 = addsellclconcnt99 + 1;} if (borbfupbidaskcon == 1 or (bidask > 0 and bapup == 2 and contbidaskcnt > 0)) then {addsellclcon = 06; addsellclconcnt = addsellclconcnt + 1; addsellclcon99 = 06; addsellclconcnt99 = addsellclconcnt99 + 1;} if bgstvolcon == 1 or (dayindex() > 0 and V > V[1] * 1.5 and V > vp) then {addsellclcon = 07; addsellclconcnt = addsellclconcnt + 1; addsellclcon99 = 07; addsellclconcnt99 = addsellclconcnt99 + 1;} if bgstupVcon== 1 or upV > depvaluemin1 then {addsellclcon = 08; addsellclconcnt = addsellclconcnt + 1; addsellclcon99 = 08; addsellclconcnt99 = addsellclconcnt99 + 1;} if C < dayclose(1) * 0.98 and (lp1234dr > -1 or contbidaskcnt > 0 or displp3con > 0) then {addsellclcon99 = 10; addsellclconcnt99 = addsellclconcnt99 + 1;} if stodL10or20Lcon == 1 and (lp1234dr > -2 or displp3con > 0) then {addsellclcon99 = 51; addsellclconcnt99 = addsellclconcnt99 + 1;} } } // ---------- 거래금지 조건 판단(매수청산 금지 조건) ---------- // {notbuyclgrd = 0; notbuyclcon = 0;} if !(contgapcnt > 0 and tboxdep <= Fdepvaluemin2 and dayindex() > 3 and C >= daylow(0)[1] and C >= dayopen(0) and sto65k > stoh and sto20k > stoh and sto10k > stoh) and !(C < d2boxlow - Faddbox) and !(bgstvolcon == 1 and downV > daybgstupV and downV > bfdaybgstupV and downV >= depvaluemin1 and C < daylow(1) - Faddbox) then if C > lp1 - Faddbox then { if !( ((sto65down == 2 or (sto65dh1 > stoh and sto65k < sto65d and sto65k < sto65k[1])) and sto65k < stoh) or ((sto130down == 2 or (sto130dh1 > stoh and sto130k < sto130d and sto130k < sto130k[1])) and sto130k < stoh) ) and !(sto65k < stoh and sto130k < stoh and sto20down == 3) then { if !(sto65k[1] > stoh and sto65k < sto65d and (downV > daybgstupV and V > V[1])) or !(sto65k < sto65dh1 and sto65dh1 > stoh and sto65k < sto65d and sto65dh1bar < sto65dL1bar) then { if lp1dupcon == 1 then {notbuyclgrd = 1; notbuyclcon = 01;} //if (sto65up == 2 or sto130up == 2) and lp123n4convercon == 0 then // {notbuyclgrd = 1; notbuyclcon = 02;} if lp234dr == 1 then {notbuyclgrd = 1; notbuyclcon = 11;}// 삭제시 수익률 감소 if lp124dr == 1 then {notbuyclgrd = 1; notbuyclcon = 12;} if lp134dr == 1 then {notbuyclgrd = 1; notbuyclcon = 13;} if lp0123dr == 2 then {notbuyclgrd = 1; notbuyclcon = 14;} if lp0123dr == 3 then { if lp3 > lp4 then {notbuyclgrd = 2; notbuyclcon = 21;} else if notbuyclgrd < 2 then {notbuyclgrd = 1; notbuyclcon = 15;} } if lp1234dr == 1 then { if lp1 > lp4 and lp2 > lp4 and lp4 > lp4[1] then {notbuyclgrd = 2; notbuyclcon = 22;} if lp1 > lp4 and lp0123dr == 3 then {notbuyclgrd = 2; notbuyclcon = 23;} if lp3 > lp4 then {notbuyclgrd = 2; notbuyclcon = 24;}// 09.01.06 작성 else if notbuyclgrd < 2 then {notbuyclgrd = 1; notbuyclcon = 16;} } if lp1234dr == 2 then {notbuyclgrd = 2; notbuyclcon = 25;} } } if yboxdep < Fdepvaluemin and C <= dayhigh(1) and C >= daylow(1) and C > lp1 - Faddbox and sp > lp1 and (lp0123dr > 1 or uplonglpdr == 1) and !(lp1234dr < 2 and sto65k > stoh and sto10down > 1 and sto20down > 1 and C < lp) then {notbuyclgrd = 3; notbuyclcon = 91;}// 삭제시 수익률 감소 if dayindex() > 1 and tboxdep <= Fdepvaluemin and C >= daylow(0)[1] and sp > lp1 and (lp0123dr > 1 or uplonglpdr == 1 or contgapcnt > 0) and !(stok65n130hcon == 1 and displp3 > disph and sto65k < sto65d and sto20k < sto20d and C < lp and (downhb5con == 1 or downhb10con == 1)) and !(dayhigh(0) <= d4boxhigh + Faddbox and stok65n130hcon == 1 and stodh10or20hcon == 1 and C < lp and (borbfdownbidaskcon == 1) and ( (Crossdown(displp3,disph) or (dayhighdisplp3 > disph and displp3 < disph)) or (Crossdown(simri,69) or (dayhighsimri >= simh and simri < simh)) )) then {notbuyclgrd = 3; notbuyclcon = 92;} if yboxdep <= depvaluemin3 and tboxdep <= depvaluemin3 and yboxdep <= Fdepvaluemin2 and tboxdep <= Fdepvaluemin2 and C <= dayhigh(1) and C >= daylow(1) and C >= daylow(0)[1] and sp > lp1 and lp > lp1 and lp1 > lp2 and lp1 > lp1[1] and sto65k > sto65d and !(bgstvolcon == 1 and bgstdownVcon == 1) then {notbuyclgrd = 3; notbuyclcon = 93;} if bar6dep <= depvaluemin and !(stok10n20hcon == 1 or stodh10or20hcon == 1 or (V > V[1] * 1.5 and V > vp) or (sto65up <> 2 and sto130up <> 2 and lp1 < lp2 and lp2 < lp3 and lp3 < lp4)) then {notbuyclgrd = 3; notbuyclcon = 94;} if bar6dep <= depvaluemin and tboxdep < depvaluemin1 and sp > lp and lp > lp1 and lp1234dr > 0 and lp1 > lp4 and lp2 > lp4 and sto65k > sto65d and sto65k > sto65k[1] and sto130k > sto130d and sto130k > sto130k[1] then {notbuyclgrd = 3; notbuyclcon = 95;} } // ---------- 거래금지 조건 판단(매도청산 금지 조건) ---------- // {notsellclgrd = 0; notsellclcon = 0;} if !(bgstvolcon == 1 and bgstupVcon == 1 and upV >= depvaluemin1 and C > dayhigh(1) + Faddbox) then if C < lp1 + Faddbox then { if !( ((sto65up == 2 or (sto65dL1 < stoL and sto65k > sto65d and sto65k > sto65k[1])) and sto65k > stoL) or ((sto130up == 2 or (sto130dL1 < stoL and sto130k > sto130d and sto130k > sto130k[1])) and sto130k > stoL) ) then { if !(sto65k < stoL and sto65k > sto65d and upV > daybgstdownV and V > V[1]) then { if lp1dupcon == -1 then {notsellclgrd = 1; notsellclcon = 01;} //if (sto65down == 2 or sto130down == 2) and lp123n4convercon == 0 then // {notsellclgrd = 1; notsellclcon = 02;} if lp234dr == -1 then {notsellclgrd = 1; notsellclcon = 11;} if lp124dr == -1 then {notsellclgrd = 1; notsellclcon = 12;} if lp134dr == -1 then {notsellclgrd = 1; notsellclcon = 13;} if lp0123dr == -2 then {notsellclgrd = 1; notsellclcon = 14;} if lp0123dr == -3 then { if lp3 < lp4 then {notsellclgrd = 2; notsellclcon = 21;} else if notsellclgrd < 2 then {notsellclgrd = 1; notsellclcon = 15;} } if lp1234dr == -1 then { if lp < lp4 and clbartrend < 1 and upbidaskcon == 0 then {notsellclgrd = 2; notsellclcon = 22;} else if lp3 < lp4 then {notsellclgrd = 2; notsellclcon = 23;} else if notsellclgrd < 2 then {notsellclgrd = 1; notsellclcon = 16;} } if lp1234dr == -2 then { if clbartrend < 1 and upbidaskcon == 0 then {notsellclgrd = 2; notsellclcon = 24;} else if notsellclgrd < 2 then {notsellclgrd = 1; notsellclcon = 17;} } } } if lp1234dr == -2 and C < lp1 + Faddbox and !(C > dayhigh(1) + Faddbox or C > dayhigh(2) + Faddbox or C > dayhigh(3) + Faddbox or C > dayhigh(4) + Faddbox or (boxshdownresist > 0 and box7shdownresist > 0)) and !(daylow(0) >= daylow(1) and stok65n130Lcon == 1 and stodL10n20Lcon == 1) then { if !(sto65k < stoL and ((displp3 < dispL and stok10n20Lcon == 1 and sto10d > sto10dL1 and sto20d > sto20dL1) or (displp3 < 91 and stok10or20Lcon == 1) or (!(displp3 < dispL and simri <= simL) and stok10n20Lcon == 1 and (bapup == 2 or borbfupbidaskcon == 1)))) then {notsellclgrd = 3; notsellclcon = 81;} if !((sto65k > sto65d and sto130k < stoL) and (displp3 < dispL and sto10k[1] < stoL and sto20d > sto20dL1)) then {notsellclgrd = 3; notsellclcon = 82;} if !(stok65or130Lcon == 1 and sto65d > sto65dL1 and sto130d > sto130dL1 and !(displp3 < dispL and simri <= simL)) then {notsellclgrd = 3; notsellclcon = 83;} if !(stok65or130Lcon == 0 and sto65d > sto65dL1 and sto130d > sto130dL1 and stok10n20Lcon == 1 and C > d4boxlow and !(displp3 < dispL and simri <= simL)) then {notsellclgrd = 3; notsellclcon = 84;} } if downlongtrend > 0 and lp1 < lp4 and lp2 < lp4 and lp3 < lp4 and C < d7boxlow - depvaluemin and C < lp1 + Faddbox then {notsellclgrd = 3; notsellclcon = 90;} if dayindex() > 1 and tboxdep <= Fdepvaluemin and C <= dayhigh(0)[1] and sp < lp1 and (lp1234dr < 0 or lp0123dr < -1 or contgapcnt < 0) and !(entbartrend == 1 or clbartrend == 1 or borbfupbidaskcon == 1) then {notsellclgrd = 3; notsellclcon = 91;} if (bar6dep <= depvaluemin or bar12dep <= depvaluemin1 or (bar6dep <= depvaluemin1 and bar6highavg < lp1 and C < dayhigh(0)[1] and boxdowncnt > 1 and !(lpshdownresist > 0 and (boxshdownresist > 0 or box7shdownresist > 0)))) and !(stok10n20Lcon == 1 or stodL10or20Lcon == 1 or (V > V[1] * 1.5 and V > vp) or (sto65down <> 2 and sto130down <> 2 and lp1 > lp2 and lp2 > lp3 and lp3 > lp4)) then {notsellclgrd = 3; notsellclcon = 92;} if dayindex() < 11 and (sto65k < sto65d and sto130k < sto130d and sto65k < stoh and sto130k < stoh and ((sto65dh1 > stoh and sto65dh1bar < 25) or (sto130dh1 > stoh and sto130dh1bar < 25))) and !(upbidaskcon == 1 or upbidaskcon == 1 or (bgstvolcon == 1 and bgstupVcon == 1) or lp123or4convercon == 1 or C > daylow(1) - Faddbox or lpcrdownresist > 0 or lpshdownresist > 0) then {notsellclgrd = 3; notsellclcon = 93;} } // ---------- 위의 매수청산및 매도청산 금지 조건에도 불구하고 청산하는 조건 ---------- // forcedbuyclcon = 0; if notbuyclgrd < 3 then { if clbartrend == -1 and dayindex() > 0 then {forcedbuyclcon = 01;} if (notbuyclgrd < 2 or (sto20k < stoh and sto10k < stoh)) and downbidaskcon == 1 then {forcedbuyclcon = 02;} if sto65k < sto65d then {forcedbuyclcon = 03;} //if sto65k < stoh then // {forcedbuyclcon = 04;} if displp3 < disph and simri < simh and sto65k > stoh and sto65d < sto65dh1 and sto20k < sto20dh1 and sto20dh1 > stoh and sto10k < sto10d and sto20k < sto20k[1] and (sto65up <> 2 or sto130up <> 2) then {forcedbuyclcon = 05;} if sto65k < sto65dh1 and (sto65up <> 2 or sto65k > stoh or (lp1234dr > 1 and (boxcrupresist > 0 or boxshupresist > 0 or C < dayhigh(1)) )) then {forcedbuyclcon = 06;} if sto20down > 1 and sto20d < stoh and sto20k[1] < sto20d[1] then {forcedbuyclcon = 07;} if sto10down > 1 and sto10d < stoh and sto10k[1] < sto10d[1] then {forcedbuyclcon = 08;} if ( (contgapcnt > 0 or (upgapcon == 1 and Crossdown(C,upgaplow))) and sto65k > stoh and ( (sto20k[1] > stoh and sto20k[1] < sto20d[1]) or (sto10k[1] > stoh and sto10k[1] < sto10d[1]) ) ) then {forcedbuyclcon = 09;} if sto65k < sto65dh1 and (sto20k[1] > stoh or sto10k[1] > stoh) and downbidaskcon == 1 then {forcedbuyclcon = 10;} if boxdowncnt > 1 and C < O and downV > daybgstupV and downV > daybgstdownV then {forcedbuyclcon = 11;} if lpshupresist > 0 or boxshupresist > 0 then {forcedbuyclcon = 12;} if lp1234dr < 2 and sto65k > stoh and sto130k > stoh and sto20k[1] > stoh and sto10k[1] > stoh and (entbartrend == -1 or clbartrend == -1 or clbartrend == -1 or bapdown == 2 or borbfdownbidaskcon == 1) then {forcedbuyclcon = 13;} if spmpnlpdupcon == -1 then {forcedbuyclcon = 14;} if dayhigh(0) <= d4boxhigh + Faddbox and stok65n130hcon == 1 //and (entbartrend < 0 or clbartrend < 0) and stodh10or20hcon == 1 and C < lp and (borbfdownbidaskcon == 1) and ( (Crossdown(displp3,disph) or (dayhighdisplp3 > disph and displp3 < disph)) or (Crossdown(simri,69) or (dayhighsimri >= simh and simri < simh)) ) then {forcedbuyclcon = 51;} } forcedsellclcon = 0; if notsellclgrd < 3 then { if clbartrend == 1 and dayindex() > 0 then {forcedsellclcon = 01;} if (notsellclgrd < 2 or (sto20k > stoL and sto10k > stoL)) and upbidaskcon == 1 then {forcedsellclcon = 02;} if sto65k > sto65d then {forcedsellclcon = 03;} //if sto65k > stoL then // {forcedsellclcon = 04;} if sto65k > sto65dL1 and ( sto65down <> 2 or (lp1234dr < -1 and C > d4boxlow) or (lp1234dr < -1 and C > d3boxlow) or (lp1234dr < -1 and C > d2boxlow) or (lp1234dr < -1 and C > daylow(1)) ) then {forcedsellclcon = 05;} if sto20up > 1 and sto20d > stoL and sto20k[1] > sto20d[1] then {forcedsellclcon = 06;} if sto10up > 1 and sto10d > stoL and sto10k[1] > sto10d[1] then {forcedsellclcon = 07;} if ( (contgapcnt < 0 or (downgapcon == 1 and Crossup(C,downgaphigh))) and sto65k < stoL and ( (sto20k[1] < stoL and sto20k[1] > sto20d[1]) or (sto10k[1] < stoL and sto10k[1] > sto10d[1]) ) ) then {forcedsellclcon = 08;} if lpshdownresist > 0 or boxshdownresist > 0 then {forcedsellclcon = 09;} if spmpnlpdupcon == 1 then {forcedsellclcon = 10;} if bgstvolcon == 1 and bgstupVcon == 1 then {forcedsellclcon = 21;} } // ---------- 스토 쌍바닥, 쌍봉 강제 청산 루틴 ---------- // forcedstoupcon = 0; if ( sto10up > 1 and sto20up > 1 and contbidaskcnt > 0 and ((sto65k < stoL and sto130k < stoL and displp3[1] < dispL and simri <= simL) or (sto65up == 2 and sto65d > stoL) or (sto130up == 2 and sto130d > stoL) or ((boxshdownresist > 0 or box7shdownresist > 0) and C > daylow(1) and ((sto65d > sto65dL1 and sto65d > stoL and sto65dL1 < stoL) or (sto130d > sto130dL1 and sto130d > stoL and sto130dL1 < stoL)))) ) then {forcedstoupcon = 11;} // ---------- 스토 쌍바닥, 쌍봉 청산 금지 루틴 ---------- // notstoupcon = 0; if forcedstoupcon == 0 then if !(sto10up > 1 and sto20up > 1 and sto65k < stoL and (sto130k < stoL or displp3[1] < dispL) and contbidaskcnt > 1) then { if !(notsellclgrd < 2 or (clbartrend == 1 and (tboxdep > Fdepvaluemid or C > dayhigh(0)[1])) or lp1234gapmincon == 1 or lp123n4convercon== 1) then {notstoupcon = 01;} if dayindex() > 3 and !(C > daylow(2) - Faddbox and lp123convercon == 1) then { if tboxdep <= Fdepvaluemin and C <= dayhigh(0)[1] then {notstoupcon = 02;} if tboxdep <= Fdepvaluemin2 and C <= dayhigh(0)[1] and (lp1234dr < -1 or (lp1234dr == -1 and C < lp4)) then {notstoupcon = 03;} } if downbidaskcon == 1 then {notstoupcon = 04;} } notstodowncon = 0; { if !((notbuyclgrd < 2 and (sto65up < 2 or sto65up1 < 2)) or sto65down1 == 2 or (sto65k > stoh and sto65k < sto65d and downbidaskcon == 1)) and !(bgstvolcon == 1 and downV > daybgstupV and downV > daybgstdownV and downV >= 0.5) and !((boxshupresist > 1 or box7shupresist > 1) and lp1234dr < 1) then {notstodowncon = 01;} if sto65k > stoh and d2boxdep <= depvaluemin3 and C >= d2boxlow and C > lp1 - Faddbox and !(clbartrend == -1 or clbartrend1 == -1) then {notstodowncon = 02;} if upbidaskcon == 1 then {notstodowncon = 03;} if d2boxdep < depvaluemin3 and C >= d2boxlow - Faddbox and C > lp1 - Faddbox and (sto65up == 2 and !(sto65down == 2 or sto65k < sto65d or (sto65dh1 > stoh and sto65k < sto65dh1))) then {notstodowncon = 04;} if sp > lp1 and uplongtrend > 0 and C > yboxmid and !(entbartrend == -1 or bgstvolcon == 1 or bgstdownVcon == 1 or borbfdownbidaskcon == 1 or (sto65k < sto65d or (sto65k > stoh and sto65k < sto65k[1])) or (boxshupresist > 0 and box7shupresist > 0 and ((sto10down > 1 and sto10dh2 > stoh) or (sto20down > 1 and sto20dh2 > stoh))) ) then {notstodowncon = 05;} if sp > lp1 and lp > lp1 and lp > lp[1] and lp1 > lp1[1] and !(dayindex() > 0 or C < daylow(1) or (bgstvolcon == 1 and bgstdownVcon == 1) or boxshupresist + box7shupresist > 3) then {notstodowncon = 06;} if lp1234dr > 1 and lp > lp1 and C > lp1 and yboxdep < depvaluemid and bar6dep < depvaluemin3 and sto65d > stoh and C >= yboxmid then {notstodowncon = 07;} if uplongtrend > 0 and lp > lp1 and lp1 > lp2 and lp1 > lp1[1] and lp2 > lp2[1] and dayhigh(0) <= dayhigh(1) and daylow(0) >= daylow(1) and tboxdep < depvaluemin3 and bar6dep < depvaluemin then {notstodowncon = 08;} if lp > lp1 and lp > lp[1] and lp1 > lp1[1] and C > lp and stodL65n130Lcon == 1 then {notstodowncon = 11;} if lp1234dr > 0 and lp3 > lp4 and stok65n130hcon == 1 and sto65k > sto65d and C > daylow(1) and C > daylow(0)[1] and C > lp1 then {notstodowncon = 21;}// 08.12.12 작성 } // ---------- 스토 쌍바닥, 쌍봉 청산 판단 보조 루틴 ---------- // {stoupcon = 0; stodowncon = 0;} if dayindex() < 12 then // 스토 쌍바닥으로 매도 청산 { if C > O and C > C[1] then { if !(sp < lp1 and lp1 < lp1[1] and lp1[1] < lp1[2] and (lp0123dr < -1 or downlonglpdr == 1 or sto65down == 2 or (lp0123dr < 0 and sp < lp3 and sp < lp4))) and !((sto65down == 2 or sto130down == 2 or sto65down1 == 2 or sto130down1 == 2) and sto65k > stoL and displp3[1] > dispL) then {stoupcon = 01;} if ( (C > lp + Faddbox or (upV >= Faddbox and (C > lp or boxshdownresist > 0 or C >= daylow(1)))) and dayindex() > 0 and (V > V[1] or lp > lp[1]) and ( !(sp < lp1 and lp1 < lp1[1] and lp1[1] < lp1[2] and downlonglpdr == 1 ) or lp0123dr > -3 or (lp0123dr > -2 and sto65k < stoL) ) ) then {stoupcon = 02;} if ( !(sp < lp1 and lp1 < lp1[1] and lp1[1] < lp1[2] and (lp0123dr < -2 or downlonglpdr == 1)) and (displp3[1] < dispL or sto65k > sto65d) and (sto20k[1] < stoL or sto10k[1] < stoL) ) then {stoupcon = 03;} if (C > lp + Faddbox or (C > lp and upV >= Faddbox) or (boxcrdownresist > 0 and upV >= Faddbox)) and dayindex() > 0 and (V > V[1] or lp > lp[1]) and sto65k < stoL and (sto20k[1] < stoL or sto10k[1] < stoL) then {stoupcon = 04;} if !(lp1234dr < -1 and C < dayhigh(1) and C < dayhigh(0)[1] and upbidaskcon == 0 and bfupbidaskcon == 0) then { if clbartrend == 1 then {stoupcon = 05;} if clbartrend1 == 1 and (sto20k < stoL or sto10k < stoL) then {stoupcon = 06;} } if !(sp < lp1 and lp1 < lp1[1] and lp1[1] < lp1[2] and ((lp1234dr < 0 and lp < lp[1]) or (lp134dr < 0 and C < lp))) and (sto10up == 3 or sto20up == 3) then {stoupcon = 07;} if (d2boxdep <= Fdepvaluemid or d4boxdep <= Fdepvaluemax) and tboxdep < Fdepvaluemid and C > d2boxlow - Faddbox and sto65k < stoL and (sto20dL2 < stoL or sto10dL2 < stoL) and lp1234gapmincon == 1 then {stoupcon = 08;} if C > d2boxlow - Faddbox and sto65k < stoL and (sto20dL2 < stoL or sto10dL2 < stoL) and (lp123convercon == 1 or lp1234gapmincon == 1) then {stoupcon = 09;} if (sto10up > 1 and sto20up > 1 and sto65k < stoL and (sto130k < stoL or displp3[1] < dispL) and contbidaskcnt > 1) then {stoupcon = 10;} /* if ( sto10up > 1 and sto20up > 1 and contbidaskcnt > 1 and ((sto65k < stoL and (sto130k < stoL or displp3[1] < dispL)) or sto65up == 2 or sto130up == 2 or ((boxshdownresist > 0 or box7shdownresist > 0) and V > V[1] and C > daylow(1) and ((sto65d > sto65dL1 and sto65dL1 < stoL) or (sto130d > sto130dL1 and sto130dL1 < stoL)))) ) then {stoupcon = 51;} */ } if C < O and C < C[1] then // 스토 쌍봉으로 매수 청산 { if dayindex() > 0 and !(sp > lp1 and lp1 > lp1[1] and (lp0123dr > 1 or uplongtrend > 0 or sto65up == 2 or stodL65n130Lcon == 1)) and !(sp > lp1 and lp > lp1 and lp > lp[1] and lp1 > lp2 and lp234dr > 0) then {stodowncon = 01;} if (sto20k[1] > stoh or sto10k[1] > stoh or sto10dh2 > stoh or sto20dh2 > stoh or lpcrupresist > 0 or ((borbfdownbidaskcon == 1) and contbidaskcnt < 0)) and !(lp0123dr > 1 or uplongtrend > 0 or sto65up == 2 or stodL65n130Lcon == 1) then {stodowncon = 02;} if ( (C < lp - Faddbox or (C < lp and downV >= Faddbox) or (boxcrupresist > 0 and downV >= Faddbox)) and dayindex() > 0 and (V > V[1] or lp < lp[1]) and ( !(sp > lp1 and uplongtrend > 0) or lp0123dr < 3 or (lp0123dr < 2 and sto65k > stoh) ) ) and !(sto65up1 == 2 and sto130up1 == 2 and C >= lp1 and C >= yboxmid - Faddbox and downbidaskcon == 0 and bfdownbidaskcon == 0) and !(lp1234dr > 0 and bflp1234dr > 0 and lp3 > lp4 and sp > lp1 and lp > lp1 and C > daylow(1) - depvaluemin1 and C > lp1 and (bar6dep < depvaluemin1 or bar6dep < Fdepvaluemin or bar12dep < depvaluemin3 or bar12dep < Fdepvaluemin1)) then {stodowncon = 03;} if ( !(sp > lp1 and lp1 > lp1[1] and (lp0123dr > 2 or uplongtrend > 0)) and (displp3[1] > disph or sto65k < sto65d) and (sto20k[1] > stoh or sto10k[1] > stoh) ) then {stodowncon = 04;} if (C < lp - Faddbox or (C < lp and downV >= Faddbox) or (boxcrupresist > 0 and downV >= Faddbox)) and dayindex() > 0 and (V > V[1] or lp < lp[1]) and sto65k > stoh and (sto20k[1] > stoh or sto10k[1] > stoh) then {stodowncon = 05;} if C < lp and downbidaskcon == 1 and sto65k > stoh and sto20dh1 > stoh and sto10dh1 > stoh then {stodowncon = 06;} if !(sp > lp1 and lp1 > lp1[1] and ((lp1234dr > 0 and lp > lp[1]) or (lp134dr > 0 and C > lp))) and (sto10down == 3 or sto20down == 3) then {stodowncon = 07;} if dayindex() > 3 and (C < lp or (boxcrupresist > 0 and downV >= Faddbox)) and lp < lp[1] and tboxdep > Fdepvaluemin2 and ( (sto65k < sto65d or downbidaskcon == 1) and ((downV >= daybgstupV and downV >= daybgstdownV) or (downV1 >= daybgstupV and downV1 >= daybgstdownV)) ) then {stodowncon = 08;} if clbartrend == -1 and dayindex() > 0 then {stodowncon = 21;} if clbartrend1 == -1 and dayindex() > 0 and (sto20k > stoh or sto10k > stoh) then {stodowncon = 22;} if (borbfdownbidaskcon == 1) and bgstvolcon == 1 and bgstdownVcon == 1 and sto65k > stoh then {stodowncon = 23;} if lp123convercon == 1 and C < dayhigh(1) and C < lp and sto65k > stoh and sto65k < sto65k[1] then {stodowncon = 24;} } } //########## ---------- 매수 ---------- ##########// // 매도 Routine과 다른 부분이 있으나 이는 자연원리(중력의 법칙)상 당연한 것임 // marketposition() == [1 = 매수, 0 = 무 포지션, -1 = 매도] if notbuycon == 0 or (entbartrend == 1 and sp > lp1 and lpshupresist < 2) then { if (C > O and C > sp and sp > sp[1] and C > C[1] and (L > L[1] or C > H[1])) and upV > 0.1 then { if dayindex() < 12 then { { if lp > lp[1] then { if lp1L1 > lp1L2 and lp1 > lp1[1] and lpL1 > lpL2 and lpL1 >= lp1 and lp > lp1 and lp > lp[1] and (lp[1] > lp[2] or entbartrend > 0) and C > lp then {savelp = lp; savesp = sp; savec = C; if lp1dupcon == 1 and notbuybetcon == 0 and via < 3 then {Buy("일봉5선쌍바닥2060복합상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if (sto65up1 == 2 or sto130up1 == 2) and notbuybetcon == 0 and via < 3 then {Buy("일봉스토쌍바닥2060복합상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp1234dr > 1 and C > lp1 and notbuybetcon == 0 and via < 3 then {Buy("일봉4선정배열2060복합상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp1234dr > 0 and C > lp1 and notbuybetcon == 0 and via < 3 then {Buy("일봉3선정배열2060복합상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp0123dr > 1 and notbuybetcon == 0 and via < 3 then {Buy("일봉2선정배열2060복합상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if notbuybetcon == 0 and via < 3 then {Buy("2060복합상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} } else if lp1L1 > lp1L2 and lp1 > lp1[1] and spL1 > spL2 and spL1 > lp1L1 and sp > lp1 and sp > lp and lp > lp[1] and (lp[1] > lp[2] or entbartrend > 0) then {savelp = lp; savesp = sp; savec = C; if lp1dupcon == 1 and notbuybetcon == 0 and via < 3 then {Buy("일봉5선쌍바닥560복합상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if (sto65up1 == 2 or sto130up1 == 2) and notbuybetcon == 0 and via < 3 then {Buy("일봉스토쌍바닥560복합상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp1234dr > 1 and C > lp1 and notbuybetcon == 0 and via < 3 then {Buy("일봉4선정배열560복합상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp1234dr > 0 and C > lp1 and notbuybetcon == 0 and via < 3 then {Buy("일봉3선정배열560복합상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp0123dr > 1 and notbuybetcon == 0 and via < 3 then {Buy("일봉2선정배열560복합상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if notbuybetcon == 0 and via < 3 then {Buy("560복합상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} } else if lpL1 > lpL2 and lp > lp[1] and (lp[1] > lp[2] or entbartrend > 0) and spL1 > spL2 and spL1 > lpL1 and sp > lp then {savelp = lp; savesp = sp; savec = C; if lp1dupcon == 1 and notbuybetcon == 0 and via < 3 then {Buy("일봉5선쌍바닥520복합상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if (sto65up1 == 2 or sto130up1 == 2) and notbuybetcon == 0 and via < 3 then {Buy("일봉스토쌍바닥520복합상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp1234dr > 1 and C > lp1 and notbuybetcon == 0 and via < 3 then {Buy("일봉4선정배열520복합상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp1234dr > 0 and C > lp1 and notbuybetcon == 0 and via < 3 then {Buy("일봉3선정배열520복합상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp0123dr > 1 and notbuybetcon == 0 and via < 3 then {Buy("일봉2선정배열520복합상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if notbuybetcon == 0 and via < 3 then {Buy("520복합상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} } else if mpL1 > mpL2 and mp > mp[1] and spL1 > spL2 and spL1 > mpL1 and sp > mp and sp > lp and lp > lp[1] and (lp[1] > lp[2] or entbartrend > 0) then {savelp = lp; savesp = sp; savec = C; if lp1dupcon == 1 and notbuybetcon == 0 and via < 3 then {Buy("일봉5선쌍바닥510복합상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if (sto65up1 == 2 or sto130up1 == 2) and notbuybetcon == 0 and via < 3 then {Buy("일봉스토쌍바닥510복합상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp1234dr > 1 and C > lp1 and notbuybetcon == 0 and via < 3 then {Buy("일봉4선정배열510복합상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp1234dr > 0 and C > lp1 and notbuybetcon == 0 and via < 3 then {Buy("일봉3선정배열510복합상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp0123dr > 1 and notbuybetcon == 0 and via < 3 then {Buy("일봉2선정배열510복합상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if notbuybetcon == 0 and via < 3 then {Buy("510복합상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} } else if lpL1 > lpL2 and lpL1 >= lp1 and lp1 > lp1[1] and lp > lp1 and lp > lp[1] and (lp[1] > lp[2] or entbartrend > 0) and C > lp then {savelp = lp; savesp = sp; savec = C; if lp1dupcon == 1 and notbuybetcon == 0 and via < 3 then {Buy("일봉5선쌍바닥2060상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if (sto65up1 == 2 or sto130up1 == 2) and notbuybetcon == 0 and via < 3 then {Buy("일봉스토쌍바닥2060상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp1234dr > 1 and C > lp1 and notbuybetcon == 0 and via < 3 then {Buy("일봉4선정배열2060상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp1234dr > 0 and C > lp1 and notbuybetcon == 0 and via < 3 then {Buy("일봉3선정배열2060상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp0123dr > 1 and notbuybetcon == 0 and via < 3 then {Buy("일봉2선정배열2060상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if notbuybetcon == 0 and via < 3 then {Buy("2060상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} } else if uphb20con == 1 and lp[3] >= lp1 and lp1 > lp1[1] and lp > lp1 and lp > lp[1] and (lp[1] > lp[2] or entbartrend > 0) and C > lp then {savelp = lp; savesp = sp; savec = C; if lp1dupcon == 1 and notbuybetcon == 0 and via < 3 then {Buy("일봉5선쌍바닥2060상승횡보-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if (sto65up1 == 2 or sto130up1 == 2) and notbuybetcon == 0 and via < 3 then {Buy("일봉스토쌍바닥2060상승횡보-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp1234dr > 1 and C > lp1 and notbuybetcon == 0 and via < 3 then {Buy("일봉4선정배열2060상승횡보-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp1234dr > 0 and C > lp1 and notbuybetcon == 0 and via < 3 then {Buy("일봉3선정배열2060상승횡보-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp0123dr > 1 and notbuybetcon == 0 and via < 3 then {Buy("일봉2선정배열2060상승횡보-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if notbuybetcon == 0 and via < 3 then {Buy("2060상승횡보-최대배팅",OnClose, DEF, Bcontby2); via = 3;} } else if lpL1 > lpL2 and lpL1 >= lp2 and lp2 > lp2[1] and lp > lp2 and lp > lp[1] and (lp[1] > lp[2] or entbartrend > 0) and C > lp then {savelp = lp; savesp = sp; savec = C; if lp1dupcon == 1 and notbuybetcon == 0 and via < 3 then {Buy("일봉5선쌍바닥20120상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if (sto65up1 == 2 or sto130up1 == 2) and notbuybetcon == 0 and via < 3 then {Buy("일봉스토쌍바닥20120상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp1234dr > 1 and C > lp1 and notbuybetcon == 0 and via < 3 then {Buy("일봉4선정배열20120상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp1234dr > 0 and C > lp1 and notbuybetcon == 0 and via < 3 then {Buy("일봉3선정배열20120상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp0123dr > 1 and notbuybetcon == 0 and via < 3 then {Buy("일봉2선정배열20120상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if notbuybetcon == 0 and via < 3 then {Buy("20120상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} } else if uphb20con == 1 and lp[3] >= lp2 and lp2 > lp2[1] and lp > lp2 and lp > lp[1] and (lp[1] > lp[2] or entbartrend > 0) and C > lp then {savelp = lp; savesp = sp; savec = C; if lp1dupcon == 1 and notbuybetcon == 0 and via < 3 then {Buy("일봉5선쌍바닥20120상승횡보-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if (sto65up1 == 2 or sto130up1 == 2) and notbuybetcon == 0 and via < 3 then {Buy("일봉스토쌍바닥20120상승횡보-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp1234dr > 1 and C > lp1 and notbuybetcon == 0 and via < 3 then {Buy("일봉4선정배열20120상승횡보-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp1234dr > 0 and C > lp1 and notbuybetcon == 0 and via < 3 then {Buy("일봉3선정배열20120상승횡보-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp0123dr > 1 and notbuybetcon == 0 and via < 3 then {Buy("일봉2선정배열20120상승횡보-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if notbuybetcon == 0 and via < 3 then {Buy("20120상승횡보-최대배팅",OnClose, DEF, Bcontby2); via = 3;} } else if mpL1 > mpL2 and mpL1 >= lp and lp > lp[1] and (lp[1] > lp[2] or entbartrend > 0) and mp > lp and mp > mp[1] and mp[1] > mp[2] and C > lp and C > mp then {savelp = lp; savesp = sp; savec = C; if lp1dupcon == 1 and notbuybetcon == 0 and via < 3 then {Buy("일봉5선쌍바닥1020상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if (sto65up1 == 2 or sto130up1 == 2) and notbuybetcon == 0 and via < 3 then {Buy("일봉스토쌍바닥1020상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp1234dr > 1 and C > lp1 and notbuybetcon == 0 and via < 3 then {Buy("일봉4선정배열1020상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp1234dr > 0 and C > lp1 and notbuybetcon == 0 and via < 3 then {Buy("일봉3선정배열1020상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp0123dr > 1 and notbuybetcon == 0 and via < 3 then {Buy("일봉2선정배열1020상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if notbuybetcon == 0 and via < 3 then {Buy("1020상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} } else if uphb10con == 1 and mp[3] >= lp and lp > lp[1] and (lp[1] > lp[2] or entbartrend > 0) and mp > lp and mp > mp[1] and C > lp and C > mp then {savelp = lp; savesp = sp; savec = C; if lp1dupcon == 1 and notbuybetcon == 0 and via < 3 then {Buy("일봉5선쌍바닥1020상승횡보-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if (sto65up1 == 2 or sto130up1 == 2) and notbuybetcon == 0 and via < 3 then {Buy("일봉스토쌍바닥1020상승횡보-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp1234dr > 1 and C > lp1 and notbuybetcon == 0 and via < 3 then {Buy("일봉4선정배열1020상승횡보-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp1234dr > 0 and C > lp1 and notbuybetcon == 0 and via < 3 then {Buy("일봉3선정배열1020상승횡보-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp0123dr > 1 and notbuybetcon == 0 and via < 3 then {Buy("일봉2선정배열1020상승횡보-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if notbuybetcon == 0 and via < 3 then {Buy("1020상승횡보-최대배팅",OnClose, DEF, Bcontby2); via = 3;} } else if mpL1 > mpL2 and mpL1 >= lp1 and lp1 > lp1[1] and mp > lp1 and mp > mp[1] and C > lp and C > mp then {savelp = lp; savesp = sp; savec = C; if lp1dupcon == 1 and notbuybetcon == 0 and via < 3 then {Buy("일봉5선쌍바닥1060상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if (sto65up1 == 2 or sto130up1 == 2) and notbuybetcon == 0 and via < 3 then {Buy("일봉스토쌍바닥1060상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp1234dr > 1 and C > lp1 and notbuybetcon == 0 and via < 3 then {Buy("일봉4선정배열1060상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp1234dr > 0 and C > lp1 and notbuybetcon == 0 and via < 3 then {Buy("일봉3선정배열1060상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp0123dr > 1 and notbuybetcon == 0 and via < 3 then {Buy("일봉2선정배열1060상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if notbuybetcon == 0 and via < 3 then {Buy("1060상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} } else if uphb10con == 1 and mp[3] >= lp1 and mp > mp[1] and lp1 > lp1[1] and C > lp and C > mp and mp > lp1 then {savelp = lp; savesp = sp; savec = C; if lp1dupcon == 1 and notbuybetcon == 0 and via < 3 then {Buy("일봉5선쌍바닥1060상승횡보-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if (sto65up1 == 2 or sto130up1 == 2) and notbuybetcon == 0 and via < 3 then {Buy("일봉스토쌍바닥1060상승횡보-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp1234dr > 1 and C > lp1 and notbuybetcon == 0 and via < 3 then {Buy("일봉4선정배열1060상승횡보-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp1234dr > 0 and C > lp1 and notbuybetcon == 0 and via < 3 then {Buy("일봉3선정배열1060상승횡보-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp0123dr > 1 and notbuybetcon == 0 and via < 3 then {Buy("일봉2선정배열1060상승횡보-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if notbuybetcon == 0 and via < 3 then {Buy("1060상승횡보-최대배팅",OnClose, DEF, Bcontby2); via = 3;} } else if spL1 > spL2 and spL1 > lp and lp > lp[1] and (lp[1] > lp[2] or entbartrend > 0) and sp > lp then {savelp = lp; savesp = sp; savec = C; if lp1dupcon == 1 and notbuybetcon == 0 and via < 3 then {Buy("일봉5선쌍바닥520상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if (sto65up1 == 2 or sto130up1 == 2) and notbuybetcon == 0 and via < 3 then {Buy("일봉스토쌍바닥520상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp1234dr > 1 and C > lp1 and notbuybetcon == 0 and via < 3 then {Buy("일봉4선정배열520상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp1234dr > 0 and C > lp1 and notbuybetcon == 0 and via < 3 then {Buy("일봉3선정배열520상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp0123dr > 1 and notbuybetcon == 0 and via < 3 then {Buy("일봉2선정배열520상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if notbuybetcon == 0 and via < 3 then {Buy("520상승N-최대배팅",OnClose, DEF, Bcontby2); via = 3;} } else if uphb5con == 1 and sp[3] >= lp and lp > lp[1] and (lp[1] > lp[2] or entbartrend > 0) and sp > lp then {savelp = lp; savesp = sp; savec = C; if lp1dupcon == 1 and notbuybetcon == 0 and via < 3 then {Buy("일봉5선쌍바닥520상승횡보-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if (sto65up1 == 2 or sto130up1 == 2) and notbuybetcon == 0 and via < 3 then {Buy("일봉스토쌍바닥520상승횡보-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp1234dr > 1 and C > lp1 and notbuybetcon == 0 and via < 3 then {Buy("일봉4선정배열520상승횡보-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp1234dr > 0 and C > lp1 and notbuybetcon == 0 and via < 3 then {Buy("일봉3선정배열520상승횡보-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp0123dr > 1 and notbuybetcon == 0 and via < 3 then {Buy("일봉2선정배열520상승횡보-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if notbuybetcon == 0 and via < 3 then {Buy("520상승횡보-최대배팅",OnClose, DEF, Bcontby2); via = 3;} } else if lpL1 > lpL2 and lp > lp[1] and (lp[1] > lp[2] or entbartrend > 0) and C > lp then {savelp = lp; savesp = sp; savec = C; if lp1dupcon == 1 and notbuybetcon == 0 and buybetcon > 0 and via < 3 then {Buy("일봉5선쌍바닥20쌍바닥-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if (sto65up1 == 2 or sto130up1 == 2) and notbuybetcon == 0 and buybetcon > 0 and via < 3 then {Buy("일봉스토쌍바닥20쌍바닥-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp1234dr > 1 and C > lp1 and notbuybetcon == 0 and buybetcon > 0 and via < 3 then {Buy("일봉4선정배열20쌍바닥-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp1234dr > 0 and C > lp1 and notbuybetcon == 0 and buybetcon > 0 and via < 3 then {Buy("일봉3선정배열20쌍바닥-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp0123dr > 1 and notbuybetcon == 0 and buybetcon > 0 and via < 3 then {Buy("일봉2선정배열20쌍바닥-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if notbuyregcon == 0 and buyregcon > 0 and via < 2 then {Buy("20쌍바닥-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if notbuyregcon == 0 and buyregcon > 0 and via < 2 then {Buy("20쌍바닥-최소배팅1",OnClose, DEF, Bcontreg); via = 2;} else if buymincon > 0 and via < 1 then {Buy("20쌍바닥-최소배팅",OnClose, DEF, Bcont5min); via = 1;} } else if mpL1 > mpL2 and mp > mp[1] and C > lp then {savelp = lp; savesp = sp; savec = C; if lp1dupcon == 1 and notbuybetcon == 0 and buybetcon > 0 and via < 3 then {Buy("일봉5선쌍바닥10쌍바닥-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if (sto65up1 == 2 or sto130up1 == 2) and notbuybetcon == 0 and buybetcon > 0 and via < 3 then {Buy("일봉스토쌍바닥10쌍바닥-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp1234dr > 1 and C > lp1 and notbuybetcon == 0 and buybetcon > 0 and via < 3 then {Buy("일봉4선정배열10쌍바닥-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp1234dr > 0 and C > lp1 and notbuybetcon == 0 and buybetcon > 0 and via < 3 then {Buy("일봉3선정배열10쌍바닥-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp0123dr > 1 and notbuybetcon == 0 and buybetcon > 0 and via < 3 then {Buy("일봉2선정배열10쌍바닥-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if notbuybetcon == 0 and buybetcon > 0 and via < 3 then {Buy("10쌍바닥-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if notbuyregcon == 0 and buyregcon > 0 and via < 2 then {Buy("10쌍바닥-최소배팅1",OnClose, DEF, Bcontreg); via = 2;} else if buymincon > 0 and via < 1 then {Buy("10쌍바닥-최소배팅",OnClose, DEF, Bcont5min); via = 1;} } else if spL1 > spL2 and (sp > lp or (C > lp and C > lp1)) then// 이 루틴 제거시 수익이 줄어듬 {savelp = lp; savesp = sp; savec = C; if lp1dupcon == 1 and notbuybetcon == 0 and buybetcon > 0 and via < 3 then {Buy("일봉5선쌍바닥5쌍바닥-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if (sto65up1 == 2 or sto130up1 == 2) and notbuybetcon == 0 and buybetcon > 0 and via < 3 then {Buy("일봉스토쌍바닥5쌍바닥-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp1234dr > 1 and C > lp1 and notbuybetcon == 0 and buybetcon > 0 and via < 3 then {Buy("일봉4선정배열5쌍바닥-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp1234dr > 0 and C > lp1 and notbuybetcon == 0 and buybetcon > 0 and via < 3 then {Buy("일봉3선정배열5쌍바닥-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp0123dr > 1 and notbuybetcon == 0 and buybetcon > 0 and via < 3 then {Buy("일봉2선정배열5쌍바닥-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if notbuybetcon == 0 and buybetcon > 0 and via < 3 then {Buy("5쌍바닥-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if notbuyregcon == 0 and buyregcon > 0 and via < 2 then {Buy("5쌍바닥-최소배팅1",OnClose, DEF, Bcontreg); via = 2;} else if buymincon > 0 and via < 1 then {Buy("5쌍바닥-최소배팅",OnClose, DEF, Bcont5min); via = 1;} } } if L > mp and C > lp and upV >= Faddbox then { {savelp = lp; savesp = sp; savec = C;} if sp > mp and (sp > lp1 or (C > dayhigh(0)[1] + 0.4 and upV > 0.6 and C > daylow(0) * 1.04 and entbartrend == 1 and dayindex() < 10) or (C > lp1 and ((lp1 > lp1[1] and lp1[1] > lp1[2]) or contgapcnt > 0 or dayopen(0) <= dayclose(1)))) then {savelp = lp; savesp = sp; savec = C; if lp1dupcon == 1 and notbuybetcon == 0 and buybetcon > 0 and via < 3 then {Buy("일봉5선쌍바닥10이평위-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if (sto65up1 == 2 or sto130up1 == 2) and notbuybetcon == 0 and buybetcon > 0 and via < 3 then {Buy("일봉스토쌍바닥10이평위-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp1234dr > 1 and C > lp1 and notbuybetcon == 0 and buybetcon > 0 and via < 3 then {Buy("일봉4선정배열10이평위-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp1234dr > 0 and C > lp1 and notbuybetcon == 0 and buybetcon > 0 and via < 3 then {Buy("일봉3선정배열10이평위-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if lp0123dr > 1 and notbuybetcon == 0 and buybetcon > 0 and via < 3 then {Buy("일봉2선정배열10이평위-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if notbuybetcon == 0 and buybetcon > 0 and via < 3 then {Buy("10이평위-최대배팅",OnClose, DEF, Bcontby2); via = 3;} else if notbuyregcon == 0 and buyregcon > 0 and via < 2 then {Buy("10이평위-최소배팅1",OnClose, DEF, Bcontreg); via = 2;} else if buymincon > 0 and via < 1 then {Buy("10이평위-최소배팅",OnClose, DEF, Bcont5min); via = 1;} } } } } } } //########## ---------- 매도 ---------- ##########// // 매수 Routine과 다른 부분이 있으나 이는 자연원리(중력의 법칙)상 당연한 것임 // marketposition() == [1 = 매수, 0 = 무 포지션, -1 = 매도] if notsellcon == 0 then { if (C < O and C < sp and sp < sp[1] and C < C[1] and (H < H[1] or C < L[1])) and downV >= 0.1 then { if dayindex() < 12 then { { if !(dayindex() == 0 and (C >= dayclose(1) or (lp1 >= lp1[1] and sto65down == 0 and sto130down == 0))) then { if lp1h1 < lp1h2 and lp1 < lp1[1] and lph1 < lph2 and lph1 < lp1h1 and lp < lp1 and lp < lp[1] and (lp[1] < lp[2] or entbartrend < 0) and C < lp then {savelp = lp; savesp = sp; savec = C; if lp1dupcon == -1 and notsellbetcon == 0 and via > -3 then {Sell("일봉5선쌍봉2060복합하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if (sto65down1 == 2 or sto130down1 == 2) and notsellbetcon == 0 and via > -3 then {Sell("일봉스토쌍봉2060복합하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp1234dr < -1 and C < lp1 and notsellbetcon == 0 and via > -3 then {Sell("일봉4선역배열2060복합하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp1234dr < 0 and C < lp1 and notsellbetcon == 0 and via > -3 then {Sell("일봉3선역배열2060복합하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp0123dr < -1 and notsellbetcon == 0 and via > -3 then {Sell("일봉2선역배열2060복합하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if notsellbetcon == 0 and via > -3 then {Sell("2060복합하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} } else if lp1h1 < lp1h2 and lp1 < lp1[1] and sph1 < sph2 and sph1 < lp1h1 and sp < lp1 then {savelp = lp; savesp = sp; savec = C; if lp1dupcon == -1 and notsellbetcon == 0 and via > -3 then {Sell("일봉5선쌍봉560복합하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if (sto65down1 == 2 or sto130down1 == 2) and notsellbetcon == 0 and via > -3 then {Sell("일봉스토쌍봉560복합하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp1234dr < -1 and C < lp1 and notsellbetcon == 0 and via > -3 then {Sell("일봉4선역배열560복합하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp1234dr < 0 and C < lp1 and notsellbetcon == 0 and via > -3 then {Sell("일봉3선역배열560복합하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp0123dr < -1 and notsellbetcon == 0 and via > -3 then {Sell("일봉2선역배열560복합하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if notsellbetcon == 0 and via > -3 then {Sell("560복합하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} } else if lph1 < lph2 and lp < lp[1] and (lp[1] < lp[2] or entbartrend < 0) and sph1 < sph2 and sph1 < lph1 and sp < lp then {savelp = lp; savesp = sp; savec = C; if lp1dupcon == -1 and notsellbetcon == 0 and via > -3 then {Sell("일봉5선쌍봉520복합하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if (sto65down1 == 2 or sto130down1 == 2) and notsellbetcon == 0 and via > -3 then {Sell("일봉스토쌍봉520복합하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp1234dr < -1 and C < lp1 and notsellbetcon == 0 and via > -3 then {Sell("일봉4선역배열520복합하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp1234dr < 0 and C < lp1 and notsellbetcon == 0 and via > -3 then {Sell("일봉3선역배열520복합하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp0123dr < -1 and notsellbetcon == 0 and via > -3 then {Sell("일봉2선역배열520복합하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if notsellbetcon == 0 and via > -3 then {Sell("520복합하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} } else if mph1 < mph2 and mp < mp[1] and sph1 < sph2 and sph1 < mph1 and sp < mp then {savelp = lp; savesp = sp; savec = C; if lp1dupcon == -1 and notsellbetcon == 0 and via > -3 then {Sell("일봉5선쌍봉510복합하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if (sto65down1 == 2 or sto130down1 == 2) and notsellbetcon == 0 and via > -3 then {Sell("일봉스토쌍봉510복합하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp1234dr < -1 and C < lp1 and notsellbetcon == 0 and via > -3 then {Sell("일봉4선역배열510복합하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp1234dr < 0 and C < lp1 and notsellbetcon == 0 and via > -3 then {Sell("일봉3선역배열510복합하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp0123dr < -1 and notsellbetcon == 0 and via > -3 then {Sell("일봉2선역배열510복합하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if notsellbetcon == 0 and via > -3 then {Sell("510복합하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} } else if lph1 < lph2 and lp < lp[1] and (lp[1] < lp[2] or entbartrend < 0) and lph1 <= lp1 and lp1 < lp1[1] and sp < lp and lp < lp1 then {savelp = lp; savesp = sp; savec = C; if lp1dupcon == -1 and notsellbetcon == 0 and via > -3 then {Sell("일봉5선쌍봉2060하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if (sto65down1 == 2 or sto130down1 == 2) and notsellbetcon == 0 and via > -3 then {Sell("일봉스토쌍봉2060하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp1234dr < -1 and C < lp1 and notsellbetcon == 0 and via > -3 then {Sell("일봉4선역배열2060하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp1234dr < 0 and C < lp1 and notsellbetcon == 0 and via > -3 then {Sell("일봉3선역배열2060하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp0123dr < -1 and notsellbetcon == 0 and via > -3 then {Sell("일봉2선역배열2060하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if notsellbetcon == 0 and via > -3 then {Sell("2060하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} } else if downhb20con == 1 and lp[3] <= lp1 and lp < lp[1] and (lp[1] < lp[2] or entbartrend < 0) and lp1 < lp1[1] and sp < lp and lp < lp1 then {savelp = lp; savesp = sp; savec = C; if lp1dupcon == -1 and notsellbetcon == 0 and via > -3 then {Sell("일봉5선쌍봉2060하락횡보-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if (sto65down1 == 2 or sto130down1 == 2) and notsellbetcon == 0 and via > -3 then {Sell("일봉스토쌍봉2060하락횡보-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp1234dr < -1 and C < lp1 and notsellbetcon == 0 and via > -3 then {Sell("일봉4선역배열2060하락횡보-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp1234dr < 0 and C < lp1 and notsellbetcon == 0 and via > -3 then {Sell("일봉3선역배열2060하락횡보-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp0123dr < -1 and notsellbetcon == 0 and via > -3 then {Sell("일봉2선역배열2060하락횡보-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if notsellbetcon == 0 and via > -3 then {Sell("2060하락횡보-최대배팅",OnClose, DEF, Scontby2); via = -3;} } else if lph1 < lph2 and C < lp and lp < lp[1] and (lp[1] < lp[2] or entbartrend < 0) and lph1 <= lp2 and lp2 < lp2[1] and sp < lp and lp < lp2 then {savelp = lp; savesp = sp; savec = C; if lp1dupcon == -1 and notsellbetcon == 0 and via > -3 then {Sell("일봉5선쌍봉20120하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if (sto65down1 == 2 or sto130down1 == 2) and notsellbetcon == 0 and via > -3 then {Sell("일봉스토쌍봉20120하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp1234dr < -1 and C < lp1 and notsellbetcon == 0 and via > -3 then {Sell("일봉4선역배열20120하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp1234dr < 0 and C < lp1 and notsellbetcon == 0 and via > -3 then {Sell("일봉3선역배열20120하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp0123dr < -1 and notsellbetcon == 0 and via > -3 then {Sell("일봉2선역배열20120하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if notsellbetcon == 0 and via > -3 then {Sell("20120하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} } else if downhb20con == 1 and lp[3] <= lp2 and lp < lp[1] and (lp[1] < lp[2] or entbartrend < 0) and lp2 < lp2[1] and sp < lp and lp < lp2 then {savelp = lp; savesp = sp; savec = C; if lp1dupcon == -1 and notsellbetcon == 0 and via > -3 then {Sell("일봉5선쌍봉20120하락횡보-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if (sto65down1 == 2 or sto130down1 == 2) and notsellbetcon == 0 and via > -3 then {Sell("일봉스토쌍봉20120하락횡보-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp1234dr < -1 and C < lp1 and notsellbetcon == 0 and via > -3 then {Sell("일봉4선역배열20120하락횡보-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp1234dr < 0 and C < lp1 and notsellbetcon == 0 and via > -3 then {Sell("일봉3선역배열20120하락횡보-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp0123dr < -1 and notsellbetcon == 0 and via > -3 then {Sell("일봉2선역배열20120하락횡보-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if notsellbetcon == 0 and via > -3 then {Sell("20120하락횡보-최대배팅",OnClose, DEF, Scontby2); via = -3;} } else if mph1 < mph2 and mp < mp[1] and mph1 <= lp and lp < lp[1] and (lp[1] < lp[2] or entbartrend < 0) and C < lp and C < mp and mp < lp then {savelp = lp; savesp = sp; savec = C; if lp1dupcon == -1 and notsellbetcon == 0 and via > -3 then {Sell("일봉5선쌍봉1020하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if (sto65down1 == 2 or sto130down1 == 2) and notsellbetcon == 0 and via > -3 then {Sell("일봉스토쌍봉1020하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp1234dr < -1 and C < lp1 and notsellbetcon == 0 and via > -3 then {Sell("일봉4선역배열1020하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp1234dr < 0 and C < lp1 and notsellbetcon == 0 and via > -3 then {Sell("일봉3선역배열1020하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp0123dr < -1 and notsellbetcon == 0 and via > -3 then {Sell("일봉2선역배열1020하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if notsellbetcon == 0 and via > -3 then {Sell("1020하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} } else if downhb10con == 1 and mp[3] <= lp and mp < mp[1] and lp < lp[1] and (lp[1] < lp[2] or entbartrend < 0) and C < lp and C < mp and mp < lp then {savelp = lp; savesp = sp; savec = C; if lp1dupcon == -1 and notsellbetcon == 0 and via > -3 then {Sell("일봉5선쌍봉1020하락횡보-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if (sto65down1 == 2 or sto130down1 == 2) and notsellbetcon == 0 and via > -3 then {Sell("일봉스토쌍봉1020하락횡보-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp1234dr < -1 and C < lp1 and notsellbetcon == 0 and via > -3 then {Sell("일봉4선역배열1020하락횡보-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp1234dr < 0 and C < lp1 and notsellbetcon == 0 and via > -3 then {Sell("일봉3선역배열1020하락횡보-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp0123dr < -1 and notsellbetcon == 0 and via > -3 then {Sell("일봉2선역배열1020하락횡보-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if notsellbetcon == 0 and via > -3 then {Sell("1020하락횡보-최대배팅",OnClose, DEF, Scontby2); via = -3;} } else if mph1 < mph2 and mp < mp[1] and (lp[1] < lp[2] or entbartrend < 0) and mph1 <= lp1 and lp1 < lp1[1] and C < lp and C < mp and mp < lp1 then {savelp = lp; savesp = sp; savec = C; if lp1dupcon == -1 and notsellbetcon == 0 and via > -3 then {Sell("일봉5선쌍봉1060하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if (sto65down1 == 2 or sto130down1 == 2) and notsellbetcon == 0 and via > -3 then {Sell("일봉스토쌍봉1060하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp1234dr < -1 and C < lp1 and notsellbetcon == 0 and via > -3 then {Sell("일봉4선역배열1060하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp1234dr < 0 and C < lp1 and notsellbetcon == 0 and via > -3 then {Sell("일봉3선역배열1060하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp0123dr < -1 and notsellbetcon == 0 and via > -3 then {Sell("일봉2선역배열1060하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if notsellbetcon == 0 and via > -3 then {Sell("1060하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} } else if downhb10con == 1 and mp[3] <= lp1 and mp < mp[1] and (lp[1] < lp[2] or entbartrend < 0) and lp1 < lp1[1] and C < lp and C < mp and mp < lp1 then {savelp = lp; savesp = sp; savec = C; if lp1dupcon == -1 and notsellbetcon == 0 and via > -3 then {Sell("일봉5선쌍봉1060하락횡보-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if (sto65down1 == 2 or sto130down1 == 2) and notsellbetcon == 0 and via > -3 then {Sell("일봉스토쌍봉1060하락횡보-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp1234dr < -1 and C < lp1 and notsellbetcon == 0 and via > -3 then {Sell("일봉4선역배열1060하락횡보-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp1234dr < 0 and C < lp1 and notsellbetcon == 0 and via > -3 then {Sell("일봉3선역배열1060하락횡보-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp0123dr < -1 and notsellbetcon == 0 and via > -3 then {Sell("일봉2선역배열1060하락횡보-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if notsellbetcon == 0 and via > -3 then {Sell("1060하락횡보-최대배팅",OnClose, DEF, Scontby2); via = -3;} } else if sph1 < sph2 and sph1 < lp and lp < lp[1] and (lp[1] < lp[2] or entbartrend < 0) and sp < lp then {savelp = lp; savesp = sp; savec = C; if lp1dupcon == -1 and notsellbetcon == 0 and via > -3 then {Sell("일봉5선쌍봉520하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if (sto65down1 == 2 or sto130down1 == 2) and notsellbetcon == 0 and via > -3 then {Sell("일봉스토쌍봉520하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp1234dr < -1 and C < lp1 and notsellbetcon == 0 and via > -3 then {Sell("일봉4선역배열520하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp1234dr < 0 and C < lp1 and notsellbetcon == 0 and via > -3 then {Sell("일봉3선역배열520하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp0123dr < -1 and notsellbetcon == 0 and via > -3 then {Sell("일봉2선역배열520하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if notsellbetcon == 0 and via > -3 then {Sell("520하락N-최대배팅",OnClose, DEF, Scontby2); via = -3;} } else if downhb5con == 1 and sp[3] <= lp and lp < lp[1] and (lp[1] < lp[2] or entbartrend < 0) and sp < lp then {savelp = lp; savesp = sp; savec = C; if lp1dupcon == -1 and notsellbetcon == 0 and via > -3 then {Sell("일봉5선쌍봉520하락횡보-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if (sto65down1 == 2 or sto130down1 == 2) and notsellbetcon == 0 and via > -3 then {Sell("일봉스토쌍봉520하락횡보-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp1234dr < -1 and C < lp1 and notsellbetcon == 0 and via > -3 then {Sell("일봉4선역배열520하락횡보-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp1234dr < 0 and C < lp1 and notsellbetcon == 0 and via > -3 then {Sell("일봉3선역배열520하락횡보-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp0123dr < -1 and notsellbetcon == 0 and via > -3 then {Sell("일봉2선역배열520하락횡보-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if notsellbetcon == 0 and via > -3 then {Sell("520하락횡보-최대배팅",OnClose, DEF, Scontby2); via = -3;} } else if lph1 < lph2 and lp < lp[1] and (lp[1] < lp[2] or entbartrend < 0) and C < lp then {savelp = lp; savesp = sp; savec = C; if lp1dupcon == -1 and notsellbetcon == 0 and sellbetcon > 0 and via > -3 then {Sell("일봉5선쌍봉20쌍봉-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if (sto65down1 == 2 or sto130down1 == 2) and notsellbetcon == 0 and sellbetcon > 0 and via > -3 then {Sell("일봉스토쌍봉20쌍봉-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp1234dr < -1 and C < lp1 and notsellbetcon == 0 and sellbetcon > 0 and via > -3 then {Sell("일봉4선역배열20쌍봉-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp1234dr < 0 and C < lp1 and notsellbetcon == 0 and sellbetcon > 0 and via > -3 then {Sell("일봉3선역배열20쌍봉-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp0123dr < -1 and notsellbetcon == 0 and sellbetcon > 0 and via > -3 then {Sell("일봉2선역배열20쌍봉-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if notsellbetcon == 0 and sellbetcon > 0 and via > -3 then {Sell("20쌍봉-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if notsellregcon == 0 and sellregcon > 0 and via > -2 then {Sell("20쌍봉-최소배팅1",OnClose, DEF, Scontreg); via = -2;} else if sellmincon > 0 and via > -1 then {Sell("20쌍봉-최소배팅",OnClose, DEF, Scont5min); via = -1;} } else if mph1 < mph2 and mp < mp[1] and mp[1] < mp[2] and C < lp then {savelp = lp; savesp = sp; savec = C; if lp1dupcon == -1 and notsellbetcon == 0 and sellbetcon > 0 and via > -3 then {Sell("일봉5선쌍봉10쌍봉-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if (sto65down1 == 2 or sto130down1 == 2) and notsellbetcon == 0 and sellbetcon > 0 and via > -3 then {Sell("일봉스토쌍봉10쌍봉-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp1234dr < -1 and C < lp1 and notsellbetcon == 0 and sellbetcon > 0 and via > -3 then {Sell("일봉4선역배열10쌍봉-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp1234dr < 0 and C < lp1 and notsellbetcon == 0 and sellbetcon > 0 and via > -3 then {Sell("일봉3선역배열10쌍봉-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp0123dr < -1 and notsellbetcon == 0 and sellbetcon > 0 and via > -3 then {Sell("일봉2선역배열10쌍봉-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if notsellbetcon == 0 and sellbetcon > 0 and via > -3 then {Sell("10쌍봉-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if notsellregcon == 0 and sellregcon > 0 and via > -2 then {Sell("10쌍봉-최소배팅1",OnClose, DEF, Scontreg); via = -2;} else if sellmincon > 0 and via > -1 then {Sell("10쌍봉-최소배팅",OnClose, DEF, Scont5min); via = -1;} } else if sph1 < sph2 and C < lp then// 이 루틴 제거시 수익이 줄어듬 {savelp = lp; savesp = sp; savec = C; if lp1dupcon == -1 and notsellbetcon == 0 and sellbetcon > 0 and via > -3 then {Sell("일봉5선쌍봉5쌍봉-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if (sto65down1 == 2 or sto130down1 == 2) and notsellbetcon == 0 and sellbetcon > 0 and via > -3 then {Sell("일봉스토쌍봉5쌍봉-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp1234dr < -1 and C < lp1 and notsellbetcon == 0 and sellbetcon > 0 and via > -3 then {Sell("일봉4선역배열5쌍봉-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp1234dr < 0 and C < lp1 and notsellbetcon == 0 and sellbetcon > 0 and via > -3 then {Sell("일봉3선역배열5쌍봉-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp0123dr < -1 and notsellbetcon == 0 and sellbetcon > 0 and via > -3 then {Sell("일봉2선역배열5쌍봉-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if notsellbetcon == 0 and sellbetcon > 0 and via > -3 then {Sell("5쌍봉-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if notsellregcon == 0 and sellregcon > 0 and via > -2 then {Sell("5쌍봉-최소배팅1",OnClose, DEF, Scontreg); via = -2;} else if sellmincon > 0 and via > -1 then {Sell("5쌍봉-최소배팅",OnClose, DEF, Scont5min); via = -1;} } else if downhb5con == 1 and ( (lp1234dr == -2 and downV > depvaluemid and C < mp and C < lp2 and sto130k < stoL and displp3 < dispL) or ( (sp < lp or sp < mp) and C < lp and ((lp < lp[1] and C < lp1 and C < daylow(0)[1] and (entbartrend == -1 or (bgstvolcon == 1 and bgstdownVcon == 1))) or (lp1234dr < 0 and lp1 < lp4 and tboxdep > depvaluemin1 and (entbartrend == -1 or clbartrend == -1 or (bgstvolcon == 1 and bgstdownVcon == 1)))) ) ) and downV >= 0.5 and (downV1 >= 0.5 or (contbarcnt < -1 and contbidaskcnt < -1)) then {savelp = lp; savesp = sp; savec = C; if lp1dupcon == -1 and notsellbetcon == 0 and (sellbetcon > 0 or entbartrend == -1) and via > -3 then {Sell("일봉5선쌍봉5하락횡보-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if sto65down == 2 and notsellbetcon == 0 and (sellbetcon > 0 or entbartrend == -1) and via > -3 then {Sell("일봉스토쌍봉5하락횡보-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp1234dr < -1 and C < lp1 and notsellbetcon == 0 and (sellbetcon > 0 or entbartrend == -1) and via > -3 then {Sell("일봉4선역배열5하락횡보-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp1234dr < 0 and C < lp1 and notsellbetcon == 0 and (sellbetcon > 0 or entbartrend == -1) and via > -3 then {Sell("일봉3선역배열5하락횡보-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp0123dr < -1 and notsellbetcon == 0 and (sellbetcon > 0 or entbartrend == -1) and via > -3 then {Sell("일봉2선역배열5하락횡보-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if notsellbetcon == 0 and (sellbetcon > 0 or entbartrend == -1 or (bgstvolcon == 1 and bgstdownVcon == 1)) and via > -3 then {Sell("5하락횡보-최대배팅",OnClose, DEF, Scontby2); via = -3;} } } if (via > -1 or (sp < lp and lp < lp1)) and H < mp and C < lp and downV >= Faddbox then { if (lp < lp[1] or (dayopen(0) < daylow(1) and C < daylow(1)) or (C < daylow(0)[1] - 0.4 and downV > 0.6 and C < dayhigh(0) * 0.96 and entbartrend == -1 and dayindex() < 10)) and !(lp1234dr == 2 and upgapcon == 1 and C > lp2 and C >= upgaplow) and !(sto65k > sto65d and sto65k > sto65k[1]) then {savelp = lp; savesp = sp; savec = C; if lp1dupcon == -1 and notsellbetcon == 0 and sellbetcon > 0 and via > -3 then {Sell("일봉5선쌍봉10이평밑-최대배팅",OnClose, DEF, Scontby2); via = -3 ;} else if (sto65down1 == 2 or sto130down1 == 2) and notsellbetcon == 0 and sellbetcon > 0 and via > -3 then {Sell("일봉스토쌍봉10이평밑-최대배팅",OnClose, DEF, Scontby2); via = -3 ;} else if lp1234dr < -1 and C < lp1 and notsellbetcon == 0 and sellbetcon > 0 and via > -3 then {Sell("일봉4선역배열10이평밑-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp1234dr < 0 and C < lp1 and notsellbetcon == 0 and sellbetcon > 0 and via > -3 then {Sell("일봉3선역배열10이평밑-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp0123dr < -1 and notsellbetcon == 0 and sellbetcon > 0 and via > -3 then {Sell("일봉2선역배열10이평밑-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if notsellbetcon == 0 and sellbetcon > 0 and via > -3 then {Sell("10이평밑-최대배팅",OnClose, DEF, Scontby2); via = -3 ;} else if notsellregcon == 0 and sellregcon > 0 and via > -2 then {Sell("10이평밑-최소배팅1",OnClose, DEF, Scontreg); via = -2;} else if sellmincon > 0 and via > -1 then {Sell("10이평밑-최소배팅",OnClose, DEF, Scont5min); via = -1;} } } } } } } if notsellcon == 0 then { if via > -1 then { if C < O and C < L[1] and O >= sp and O >= lp and C < sp and C < lp and H - L > H[1] - L[1] then { if downV >= 0.5 and sto10k < sto10d and !(lp > lp[1] and lp1 > lp1[1] and lp > lp1) then { if lp < lp[1] or entbartrend == -1 or (C < daylow(0)[1] - 0.4 and downV > 0.6 and C < dayhigh(0) * 0.96 and entbartrend == -1 and dayindex() < 10) or (bgstvolcon == 1 and (C < d4boxlow or (crossdown520con == 1 and bgstdownVcon == 1))) then { if dayindex() < 12 Then { if dayhigh(0) < daylow(1) or (bidask < 0 and bidask < bidask[1]) or (boxdowncnt > 1 or (boxdowncnt > 0 and lp0123dr < -1 and C < daylow(0)[1])) or (dayindex() == 0 and (bidask < 0 or C < daylow(1))) then if upbidaskcon == 0 or dayindex() == 0 then {savelp = lp; savesp = sp; savec = C; if lp1dupcon == -1 and notsellbetcon == 0 and sellbetcon > 0 and via > -3 then {Sell("일봉5선쌍봉장음봉-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if (sto65down1 == 2 or sto130down1 == 2) and notsellbetcon == 0 and sellbetcon > 0 and via > -3 then {Sell("일봉스토쌍봉장음봉-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp1234dr < -1 and C < lp1 and notsellbetcon == 0 and sellbetcon > 0 and via > -3 then {Sell("일봉4선역배열장음봉-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp1234dr < 0 and C < lp1 and notsellbetcon == 0 and sellbetcon > 0 and via > -3 then {Sell("일봉3선역배열장음봉-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if lp0123dr < -1 and notsellbetcon == 0 and sellbetcon > 0 and via > -3 then {Sell("일봉2선역배열장음봉-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if notsellbetcon == 0 and sellbetcon > 0 and via > -3 then {Sell("장음봉-최대배팅",OnClose, DEF, Scontby2); via = -3;} else if notsellregcon == 0 and sellregcon > 0 and via > -2 then {Sell("장음봉-최소배팅1",OnClose, DEF, Scontreg); via = -2;} else if sellmincon > 0 and via > -1 then {Sell("장음봉-최소배팅",OnClose, DEF, Scont5min); via = -1;} } } } } } } } //########## ---------- 매도청산 ---------- ##########// // 매도 Routine과 다른 부분이 있으나 이는 자연원리(중력의 법칙)상 당연한 것임 // marketposition() == [1 = 매수, 0 = 무 포지션, -1 = 매도] if marketposition() == -1 then if notsellclcon < 81 and (notsellclgrd == 0 or (C > dayhigh(1) + Faddbox and C > dayhigh(0)[1]) or (dayindex() > 0 and V > V[1] and upV >= 0.3 and upbidaskcon == 1 and C > dayhigh(0)[1])) then { if C > O and C > sp and sp > sp[1] and C > C[1] and (L > L[1] or C > H[1]) then if (C[1] >= O[1] and C > H[1]) or (C > O[1] and C > O[2] and (upV >= Faddbox or C >= C[1] + Faddbox)) then if dayindex() < 12 then if downbidaskcon == 0 or dayindex() == 0 then { { if sto10k > sto10k[1] then if (sto20k > sto20d or lp > lp[1]) then { if !(dayindex() == 0 and (C <= dayclose(1) or lp1 <= lp1[1])) then { if lpL1 > lpL2 and lp > lp[1] and spL1 > spL2 and spL1 > lpL1 and sp > lp then { {Exitshort("+520복합상승N");} } if mpL1 > mpL2 and mp > mp[1] and spL1 > spL2 and spL1 > mpL1 and sp > mp then { {Exitshort("+510복합상승N");} } if spL1 > spL2 and spL1 > lp and lp > lp[1] and sp > lp then { {Exitshort("+520상승N");} } if uphb5con == 1 and sp[3] >= lp and sp > spL1 and lp > lp[1] and sp > lp then { {Exitshort("+520상승횡보");} } if lpL1 > lpL2 and lp > lp[1] and lpL1 >= lp1 and lp1 > lp1[1] and C > lp and lp > lp1 then { {Exitshort("+2060상승N");} } if uphb20con == 1 and lp[3] >= lp1 and lp > lpL1 and lp > lp[1] and lp1 > lp1[1] and C > lp and lp > lp1 then { {Exitshort("+2060상승횡보");} } if lpL1 > lpL2 and lp > lp[1] and lpL1 >= lp2 and lp2 > lp2[1] and C > lp and lp > lp2 then { {Exitshort("+20120상승N");} } if uphb20con == 1 and lp[3] >= lp2 and lp > lpL1 and lp > lp[1] and lp2 > lp2[1] and C > lp and lp > lp2 then { {Exitshort("+20120상승횡보");} } if mpL1 > mpL2 and mp > mp[1] and mpL1 >= lp and lp > lp[1] and C > lp and C > mp and mp > lp then { {Exitshort("+1020상승N");} } if uphb10con == 1 and mp[3] >= lp and mp > mpL1 and mp > mp[1] and lp > lp[1] and C > lp and C > mp and mp > lp then { {Exitshort("+1020상승횡보");} } if mpL1 > mpL2 and mp > mp[1] and mpL1 >= lp1 and lp1 > lp1[1] and C > lp and C > mp and mp > lp1 then { {Exitshort("+1060상승N");} } if uphb10con == 1 and mp[3] >= lp1 and mp > mpL1 and mp > mp[1] and lp1 > lp1[1] and C > lp and C > mp and mp > lp1 then { {Exitshort("+1060상승횡보");} } //if mpL1 > mpL2 and C > lp then // { // {Exitshort("+10쌍바닥");} // } if spL1 > spL2 - 0.1 and C > lp then// 이 루틴 제거시 수익이 줄어듬 { {Exitshort("+5쌍바닥");} } } if L > mp and C > lp and upV >= Faddbox then if !(lp1234dr < 0 and downgapcon == 1 and C < downgaphigh and C < lp1 and V < bfdaybgstvol and upV < bfdaybgstdownV and (dayindex() == 0 or C <= dayhigh(0)[1])) then { if sp > mp and C > (dayhigh(1) + daylow(1))/2 and (lp > lp[1] or C > dayhigh(1) or lp > lp1 or (lp < lp1 and C > lp1) or (lp < lp2 and C > lp2)) then { {Exitshort("+10이평위");} } } } } } } // ---------- 스토 쌍바닥시 매도 청산 루틴 ---------- // //if notsellclgrd < 2 or (clbartrend == 1 and (tboxdep > Fboxdepmid or C > dayhigh(0)[1])) // or lp1234gapmincon == -1 then if marketposition() == -1 then if dayindex() < 12 and C > O and C > C[1] then if notstoupcon == 0 and (stoupcon > 0 or forcedstoupcon > 0) then { if dayindex() > 0 and sto20k > sto20d + 0.5 and sto20k > sto20k[1] and (sto10k > sto10d or (V > V[1] and V[1] > V[2])) and (notsellclcon < 81 or forcedstoupcon > 0 or sto20up == 3 or (contbarcnt > 0 and V > V[1] * 1.2 and V[1] > V[2])) then { if sto20index + 5 >= index or stime >= 140000 then { if (sto20dL1 > stoL and sto20dL1 > sto20dL2 + 3 and stok20L1 > stok20L2 + 3) or (sto10up > 1 and sto20up > 1 and sto65k < stoL and (sto130k < stoL or displp3[1] < dispL) and contbidaskcnt > 1) then { if stoupcon > 0 then {Exitshort("+sto20d+");} else {Exitshort("+sto20d+99");} } { if stok20L1 > stok20L2 and stod20L1 > stod20L2 + 2 then { if stoupcon > 0 then {Exitshort("+sto20d박스권+");} else {Exitshort("+sto20d박스권+99");} } } } if sto20kL1 > sto20kL2 + 3 and sto20kL1 > sto20d[sto20kL1bar] and sto20kL1bar < 5 and !(sto65k < stoL and sto20d < stoL) then { if stoupcon > 0 then {Exitshort("+sto20k+");} else {Exitshort("+sto20k+99");} } } if sto10k > sto10d + 0.5 and sto10k > sto10k[1] and (sto20k > stoL or lp0123dr > -1 or clbartrend == 1) and (notsellclcon < 81 or forcedstoupcon > 0 or sto10up == 3) then { if sto10index + 5 >= index or stime >= 140000 then { if sto10dL1 > stoL and sto10dL1 > sto10dL2 + 3 and stok10L1 > stok10L2 + 3 then { if stoupcon > 0 then {Exitshort("+sto10d+");} else {Exitshort("+sto10d+99");} } { if stok10L1 > stok10L2 and stod10L1 > stod10L2 + 2 then { if stoupcon > 0 then {Exitshort("+sto10d박스권+");} else {Exitshort("+sto10d박스권+99");} } } } } } // ---------- 마감 시간에 매도오버 또는 청산여부 결정 루틴 ---------- // if marketposition() == -1 then if dayindex() == 11 Then { if (C <= dayclose(1) * 0.903 or L <= dayclose(1) * 0.903) and (dayclose(1) < dayclose(2) * 0.95 or (lp > lp1 and (lp > lp[1] or stodL10or20Lcon == 1))) then {Exitshort("+마감-하한가청산01");} else if !(C < dayclose(1) * 0.92 and dayclose(1) > dayclose(2) * 0.92) or sto65k > sto65d or C > lp1 or (((sto20up > 2 and (sto10up > 1 or sto10d > sto10dL1)) or (sto10up > 2 and (sto20up > 1 or sto20d > sto20dL1))) and ((sto65down < 2 and sto130down < 2) or sto65k < stoL or sto130k < stoL)) then { if contgapcnt < -2 then {Exitshort("+마감-쓰리갭하락청산02");} if contgapcnt < -1 and (C < dayclose(4) * 0.92 or C < dayclose(2) * 0.96) and ((sto65k < stoL and stok10n20Lcon == 1) or (sto20k[1] < stoL and stodL10n20Lcon == 1)) then {Exitshort("+마감-투갭하락4%이상급락03");} if contgapcnt < 0 and (C < dayclose(4) * 0.92 or C < dayclose(2) * 0.96) and sto65k < stoL and stok10n20Lcon == 1 and downlongtrend == 0 then {Exitshort("+마감-무추세갭하락4%이상급락05");} //if addsellclconcnt > 4 then // {Exitshort("+마감-상승조건5이상발생청산07");} if //(V > V[1] * 1.5 or (V > V[1] and contbidaskcnt > 0 and C > O and C[1] > O[1])) addsellclconcnt > 0 and sto65d > sto65dL1 and sto65dL1 < stoL and sto130d > sto130dL1 and sto130dL1 < stoL and ( (Crossup(displp3,dispL) or (daylowdisplp3 < dispL and displp3 > dispL)) or (Crossup(simri,31) or (daylowsimri <= simL and simri > simL)) ) and sto10k > sto10d and sto20k > sto20k[1] then {Exitshort("+마감-과냉이투스토상승09");} if dayhigh(0) < dayhigh(1) and daylow(0) > daylow(1) and dayhigh(0) < d2boxhigh and daylow(0) > d2boxlow and dayhigh(0) < d3boxhigh and daylow(0) > d3boxlow and dayhigh(0) < d4boxhigh and daylow(0) > d4boxlow and ((dayhigh(7) + Faddbox >= d4boxhigh and daylow(6) - Faddbox <= d4boxlow) or (dayhigh(6) + Faddbox >= d4boxhigh and daylow(7) - Faddbox <= d4boxlow)) and d4boxdep < depvaluemax and tboxdep < depvaluemid then {Exitshort("+마감-박스권수렴형주의11");} /* if displp3[1] < dispL and sto65k < stoL and sto130k < stoL and sto20k > sto20dL1 and sto20d > sto20dL1 and sto20dL1 < stoL and sto20k > stoL and C < dayclose(1) * 0.98 and sto10k[1] > sto10d[1] then {Exitshort("+마감-이격과냉스토상승12");} if stodL65or130Lcon == 1 and C > d7boxlow - depvaluemin and C < dayclose(1) * 0.96 and (Crossup(displp3,dispL) or (daylowdisplp3 < dispL and displp3 > dispL)) then {Exitshort("+마감-과냉이격스토상승13");} if V > V[1] and clbartrend == 1 and !(sp < lp1 and lp1234dr < -1) then {Exitshort("+마감-상승전환14");} if V > V[1] and C > O and stok10n20Lcon == 1 and !(sto65down == 2 or sto130down == 2) and (!(sto65dh1 > stoh or sto65dh2 > stoh) or Crossup(displp3, dispL)) and ( ((daylow(0)[1] < d4boxlow or daylow(0) < d4boxlow) and C > d4boxlow) or ((daylow(0)[1] < d3boxlow or daylow(0) < d3boxlow) and C > d3boxlow) or ((daylow(0)[1] < d2boxlow or daylow(0) < d2boxlow) and C > d2boxlow)) then {Exitshort("+마감-박스권지지16");} if V > V[1] and ((stok10n20Lcon == 1 and C > daylow(0)[1]) or clbartrend == 1 or upbidaskcon == 1) and !(lp0123dr < -1 or lp1234dr < 0 or sto65down1 == 2 or sto130down1 == 2) and boxshdownresist > 0 and upV >= 0.5 and (downupV > updownV1 or downupV > downupV1) then {Exitshort("+마감-무추세박스권지지17");} if lp1234dr > -2 and !(sto65down == 2 or sto130down == 2) and ((sto10k[1] < stoL and sto20d > sto20dL1 and sto20dL1 < stoL) or clbartrend == 1 or upbidaskcon == 1) and boxcrdownresist > 0 then {Exitshort("+마감-박스권지지18");} if !(lp0123dr < -1 or lp1234dr < 0) and sto10k < stoL and sto65d < stoh and boxcrdownresist > 0 and (sto65dL1 > sto65dL2 or sto130dL1 > sto130dL2) and !(sto65dh1bar < sto65dL1bar and sto65dh1 > stoh) then {Exitshort("+마감-무추세박스권지지19");} if box7shdownresist > 0 and stodL10or20upcon == 1 and sto65d > sto65dL1 and sto65dL1 < stoL and C >= daylow(0)[1] and (sto10up > 1 or sto20up > 1 or upbidaskcon == 1) and (sto10k > sto10d or (sto10k > sto10k[1] and C > O)) then {Exitshort("+마감-3~7일이전박스권지지20");} if box7shdownresist > 0 and !(spnlp1234con < 0 and contgapcnt < 0) and !(downlongtrend == 1 and (borbfdownbidaskcon == 1 or entbartrend == -1 or clbartrend == -1)) then { if stodL65or130Lcon == 1 and sto65down1 <> 2 and stodh65or130hcon == 0 and (sto10up > 1 or sto20up > 1 or sto65up > 1 or stodL10n20upcon == 1) then {Exitshort("+마감-3~7일이전박스권지지21");} } if C >= daylow(1) and stok65or130Lcon == 1 and stodL10n20Lcon == 1 and sto65d > sto65dL1 and sto65dL1 < stoL and (sto10up > 1 or sto20up > 1) and (borbfupbidaskcon == 1) then {Exitshort("+마감-스토쌍바닥및호잔상승반전22");} if contdowncnt == 3 and sto65k < stoL and stok10or20Lcon == 1 and C < dayclose(3) * 0.92 and !(C < dayclose(3) * 0.85 or C < dayclose(2) * 0.9 or C < dayclose(1) * 0.92) then {Exitshort("+마감-8%이상급락흑삼병과냉24");} if (lp1234dr > -1 or sto65k < stoL or lp123convercon == 1) and (!(sto65down == 2 or sto130down == 2) or (boxshdownresist + box7shdownresist > 4)) and !(bapdown == 2 and contbidaskcnt < 0) and stok10n20Lcon == 1 and C > d2boxlow - Faddbox and ((sto10k > sto10d or (sto10k > sto10k[1] and C > O)) or lp123convercon == 1) then {Exitshort("+마감-박스권지지25");} if sto65k < stoL and stok10or20Lcon == 1 and stodL10or20upcon == 1 and ((sto10d > stoL and sto20d > stoL) or (sto65d > stoL and sto130d > stoL)) and ((sto20d > sto20dL1 or sto10d > sto10dL1) or sto20up1 > 1 or sto10up1 > 1) and yboxmid < dayopen(0) and dayhigh(1) >= dayhigh(0) and C >= daylow(1) - 1 and (!((V > daybgstvol and C < O) or ((V[1] > daybgstvol or V[1] > dayopenvol) and C[1] < O[1])) or (V > daybgstvol and C > O)) then {Exitshort("+마감-박스권지지26");} if lp1234dr > -1 and dayhigh(0) < dayhigh(1) and daylow(0) > daylow(1) and stok10or20Lcon == 1 and lp123convercon == 1 then {Exitshort("+마감-박스권지지27");} if sto65k > sto65d and boxshdownresist > 0 and box7shdownresist > 0 and d4boxdep < depvaluemax and C >= d4boxlow and stok10or20Lcon == 1 and stodL10or20Lcon == 1 and !((bidask < 0 and contbidaskcnt < 0) or dayclose(1) - C > depvaluemid) then {Exitshort("+마감-박스권지지28");} if C >= d4boxlow and boxshdownresist > 0 and box7shdownresist > 1 and stok10n20Lcon == 1 and (lp123convercon == 1 and lp123gapmincon == 1) then {Exitshort("+마감-박스권지지및이평혼조29");}// 08.10.20 작성 if (dayhigh(0) < d2boxhigh and daylow(0) > d2boxlow) and (dayhigh(0) < d3boxhigh and daylow(0) > d3boxlow) and (dayhigh(0) < d4boxhigh and daylow(0) > d4boxlow) then// 2008.1.28 추가라인-1/29후 적용검토 { if sto65up2 == 2 and sto65k > sto65d and stok10or20Lcon == 1 then {Exitshort("+마감-수렴형주의청산31");} if lp3 > lp3[1] and lp3[1] > lp3[2] and lp4 > lp4[1] and lp4[1] > lp4[2] and sto65k > sto65d then {Exitshort("+마감-수렴형주의청산32");} } if !(downlongtrend == 1) and sto65k > sto65d then { if (dayhigh(0) < d2boxhigh and daylow(0) > d2boxlow) or (dayhigh(0) < d3boxhigh and daylow(0) > d3boxlow) or (dayhigh(0) < d4boxhigh and daylow(0) > d4boxlow) then// 2008.1.28 추가라인-1/29후 적용검토 { if sto65up2 == 2 and stok10or20Lcon == 1 and !(sto65k > stoh or sto130k > stoh or displp3 > disph or simri >= simh) then {Exitshort("+마감-무추세일봉스토쌍바닥주의33");} } if lp123convercon == 1 and !(spmpnlpdupcon == -1 and mplpnlp12dupcon == -1 and contbidaskcnt < 0) then { if !((C < lp1 and C < lp2 and C < lp3 and lp1 < lp1[1] and lp2 < lp2[1] and lp3 < lp3[1]) or (C < lp1 and C < lp2 and C < lp3 and C < lp4 and lp2 < lp2[1] and lp3 < lp3[1] and lp4 < lp4[1])) then {Exitshort("+마감-무추세이평선수렴주의34");} } } if lp123convercon == 1 and !(spmpnlpdupcon == -1 and contbidaskcnt < 0) then { if stok10n20Lcon == 1 and C >= d2boxlow - 0.5 and !(sto65k < sto65d and index < sto65index + 24) and (sto65k > sto65d or lpshdownresist > 0 or boxshdownresist > 0 or box7shdownresist > 0) then {Exitshort("+마감-이평선수렴주의35");} } if C > O and daylow(0) >= daylow(1) and stok65n130Lcon == 1 and stodL10n20Lcon == 1 and spdupcon == 1 and contbidaskcnt > 0 then {Exitshort("+마감-스토과냉권5쌍바닥36");} if sto65k < stoL and sto130k < stoL and displp3 < dispL and simri <= simL and stodL10n20Lcon == 1 and sto10k > stoL and sto20k > stoL and sto20k > sto20d and (sto65up == 2 or sto130up == 2 or sto65d > sto65dL1 or sto130d > sto130dL1) and !(sto65down2 == 2 or sto130down2 == 2 or borbfdownbidaskcon == 1 or bgstvolcon == 1 or bgstdownVcon == 1)then {Exitshort("+마감-이투과냉권스토상승37");} if ( sto65k < stoL and ((displp3 < 90 and stok10or20Lcon == 1) or (displp3 < dispL and stok10n20Lcon == 1 and ((sto65down1 <> 2 and sto130down1 <> 2) or sto65k < stoL or sto130k < stoL))) ) or (sto65k > stoL and stok10n20Lcon == 1 and contgapcnt < 0) and !(C < dayclose(3) * 0.85 or C < dayclose(2) * 0.9 or C < dayclose(1) * 0.92) then { if (lp1234dr > -1 or boxshdownresist > 0 or box7shdownresist > 0 or (stok10n20Lcon == 1 and displp3 < dispL and simri < simL and sto65k > stoL and sto130k > stoL)) and !(dayhigh(0) < d5boxlow + Faddbox) then { if downlongtrend > 0 then { if C < dayclose(4) * 0.92 then {Exitshort("+마감-4일전비8%이상급락42");} if C < dayclose(3) * 0.94 then {Exitshort("+마감-3일전비6%이상급락42");} if C < dayclose(2) * 0.96 then {Exitshort("+마감-2일전비4%이상급락42");} if C < dayclose(1) * 0.96 then {Exitshort("+마감-전일비4%이상급락42");} } else if !(downlongtrend == 1) then { if C < dayclose(4) * 0.92 then {Exitshort("+마감-무추세4일전비8%이상급락42");} if C < dayclose(3) * 0.94 then {Exitshort("+마감-무추세3일전비6%이상급락42");} if C < dayclose(2) * 0.96 then {Exitshort("+마감-무추세2일전비4%이상급락42");} if C < dayclose(1) * 0.96 then {Exitshort("+마감-무추세전일비4%이상급락42");} } } else if sto65k < stoL and sto130k < stoL and !(bar6dep < depvaluemin1 and bar6dep < Fdepvaluemin) then { if C < dayclose(4) * 0.90 then {Exitshort("+마감-4일전비10%이상급락43");} if C < dayclose(3) * 0.91 then {Exitshort("+마감-3일전비9%이상급락43");} if C < dayclose(2) * 0.92 then {Exitshort("+마감-2일전비8%이상급락43");} if C < dayclose(1) * 0.94 then {Exitshort("+마감-전일비6%이상급락43");} } } if !(lp0123dr < 0 or lp1234dr < 0) and lp1crdownresist== 1 and upV >= 0.4 and upV > downV1 and upV > upV1 then {Exitshort("+마감-무추세5일선지지44");} if V > V[1] and ((stok10or20Lcon == 1 and C > daylow(0)[1]) or clbartrend1 == 1 or upbidaskcon == 1) and !(lp0123dr < -1 or lp1234dr < 0 or sto65down1 == 2 or sto130down1 == 2) and upV >= 0.5 and (upV > daybgstupV and upV > daybgstdownV) then { if lp2shdownresist == 1 then {Exitshort("+마감-무추세10일선지지45");} if lp3shdownresist == 1 then {Exitshort("+마감-무추세20일선지지45");} if lp4shdownresist == 1 then {Exitshort("+마감-무추세60일선지지45");} } if !(downlongtrend == 1 or lp0123dr < -1) and lpshdownresist > 0 and daylow(1) - C < depvaluemin and C >= daylow(0)[1] and (sto10up > 1 or sto20up > 1 or stodL10n20Lcon == 1) then {Exitshort("+마감-무추세이평선지지46");} if (C > d2boxlow or sto65k > sto65d or (V > V[1] and (lp1234dr > -2 or stodL10or20Lcon == 1)) or (sto65d > sto65dL1 and sto65dL1 < stoL)) and displp3[1] < dispL and simri <= simL and ( (sto65k < stoL and (stok10n20Lcon == 1 or (sto65k > sto65k[1] and stok10or20Lcon == 1))) or (sto65k > sto65d and (sto10k[1] < stoL or sto10k < stoL)) ) and bar6dep > depvaluemin1 and (sto10k > sto10d or (sto10k > sto10k[1] and C > O)) and addsellclconcnt99 > 0 then {Exitshort("+마감-이투과냉스토상승55");} if V > V[1] and displp3[1] < 90 and sto65k < stoL and stok10or20Lcon == 1 and upV >= 1 and upV > downV1 and upV > upV1 and (sto10k > sto10d or (sto10k > sto10k[1] and C > O)) and addsellclconcnt99 > 0 then {Exitshort("+마감-이격과냉스토상승56");} if daylow(0) >= d4boxlow and dayhigh(0) <= d4boxhigh and (boxshdownresist > 0 and box7shdownresist > 0) and (sto20k[1] < stoL or sto10k[1] < stoL) and stodL10or20Lcon == 1 and (sto65d[1] < stoL or sto130d[1] < stoL or displp3[1] < stoL) and dayhigh(0) > yboxmid and addsellclconcnt99 > 0 then {Exitshort("+마감-과냉스토상승78");} if ((sto65k > sto65d and sto65dL1 < stoL) or (sto130k > sto130d and sto130dL1 < stoL) or displp3[1] < stoL) and daylow(0) >= d4boxlow - depvaluemin and dayhigh(0) <= d4boxhigh and !((downlongtrend == 1 and sp < lp1 and bar6dep <= depvaluemin1) or (lp1234dr < 0 and sp < lp1)) and addsellclconcnt99 > 0 then { if ((boxshdownresist > 1 or box7shdownresist > 1) and stodL10or20upcon == 1) or ((boxshdownresist > 0 or box7shdownresist > 0) and stok10n20Lcon == 1 and stodL10or20Lcon == 1) then {Exitshort("+마감-과냉스토상승79");} } if lp1234dr > -2 and !(lp1 <= lp4 and lp4 <= lp4[1]) and (V > dayopenvol or V[1] > dayopenvol) and addsellclconcnt99 > 0 then { if lp1234dr > -1 and lp0123dr < -1 and sto20k[1] < stoL and ((sto65k < stoL and (sto10k[1] < stoL and sto10k > sto10d)) or (!(sp < lp3 and sp < lp4) and sto10k > sto10dL1 and sto10dL1 < stoL)) and !(dayhigh(0) < daylow(1) and C <= dayopen(0) and (sto65down == 2 or sto130down == 2 or sto65down1 == 2 or sto130down1 == 2) and sto65k > stoL) then {Exitshort("+마감-무추세과냉스토상승96");} } //if ((C - entryprice(0) > entryprice(0) * Flosscutrate) // or (C - dayclose(1) > dayclose(1) * Flosscutrate and lp1234dr > -1)) and C > O then // {Exitshort("+마감-손절매청산99");} if notsellclgrd < 3 then { { if lp1234dr > 0 and C >= d4boxlow - Faddbox and C > lp2 and (sto65up2 == 2 or sto130up2 == 2) and displp3 > disph then {Exitshort("+마감-역추세박스권지지41");} if downlongtrend == 0 and lpshdownresist > 0 and (boxshdownresist > 1 or box7shdownresist > 1) and (sto10d > sto10dL1 or sto20d > sto20dL1) and !(sto65down == 2 or sto130down == 2 or stodh65or130hcon == 1) then {Exitshort("+마감-무추세이평선및박스권지지42");} if sto65k < stoL and sto130k < stoL and sto20k[1] < stoL and addsellclconcnt > 1 and contbidaskcnt > 1 then { if lp2shdownresist == 1 then {Exitshort("+마감-10일선지지43");} if lp3shdownresist == 1 then {Exitshort("+마감-20일선지지43");} if lp4shdownresist == 1 then {Exitshort("+마감-60일선지지43");} } if !(downlongtrend == 1 and lp4 > lp3) and !(lp1 < lp4 and lp2 < lp4 and lp3 < lp4) and V > V[1] and C > O and stok10n20Lcon == 1 and lp123convercon == 1 and (boxshdownresist > 0 or box7shdownresist > 0) and sto10k > sto10d then {Exitshort("+마감-무추세박스권지지이평선혼조45");} if lp1234dr > -1 and stok10n20Lcon == 1 and V > V[1] and C > O and sto10k > sto10d and ((C[1] > O[1] and V[1] > V[2]) or downlongtrend == 0) and ((boxshdownresist > 0 and box7shdownresist > 0) or (sto20k > sto20d and addsellclconcnt > 2)) and addsellclconcnt99 > 0 then {Exitshort("+마감-과냉스토상승46");} } if (lp1234dr > -2 or C > d2boxlow or sto65k > sto65d or stodL10or20Lcon == 1 or sto65d > sto65dL1) and displp3[1] < dispL and sto65k < stoL and stok10or20Lcon == 1 and sto20k > sto20d and (sto10k > sto10d or (sto10k > sto10k[1] and C > O)) and sto10d > sto10dL1 and sto10dL1 < stoL and addsellclconcnt99 > 0 then {Exitshort("+마감-이격과냉스토상승58");} if lp1234dr > -2 and !(lp1 <= lp4 and lp4 <= lp4[1]) and addsellclconcnt99 > 0 then { if lp1234dr == -1 and sto65k < stoL and sto20k[1] < stoL //and sto10k > sto10d and (sto10k[1] < stoL or sto10up1) and !(contgapcnt < 0 and dayopen(0) < d4boxlow) //and (lp1234gapmidcon == 1 or (lp1 > lp4 and lp > lp4 and lp4 > lp4[1])) and ((dayopen(0) > daylow(1) and dayopen(0) > daylow(2)) or (dayopen(0) > daylow(2) and dayopen(0) > daylow(3))) then {Exitshort("+마감-과냉스토상승59");} if (displp3[1] < dispL or simri <= simL) and sto20k[1] < stoL and sto10k > stoL and sto10k > sto10dL1 and sto10dL1 < stoL and sto65k > sto65dL1 and contgapcnt < 0 then {Exitshort("+마감-과냉스토상승60");} if !(lp1234dr < 0 or lp0123dr < -2) and !(lp1234dr > 0 or lp0123dr > 2) and bfdayuplpcnt > 5 and bfdayuplp4cnt > 5 and stok10n20Lcon == 1 and sto10k > sto10k[1] and contgapcnt < 0 //and bar6dep > Fdepvaluemin and (addsellclcon > 0 or C < dayclose(1) * 0.98) and !(sto65k[1] > stoh or sto130k[1] > stoh) then {Exitshort("+마감-무추세과냉스토상승61");} } if V > V[1] and sto65k < stoL and sto20k[1] < stoL and ((sto10k[1] < stoL and sto10k > sto10d) or sto10up1 > 1) and sp > sp[1] and ((upV >= 0.5 and upV > downV1 and upV > upV1 and V[1] > V[2]) or (upV >= 0.3 and upbidaskcon == 1) or (V > V[1] * 1.5 and upV >= 0.5 and upV > downV1 and upV > upV1 and C > lp)) and addsellclconcnt99 > 0 then {Exitshort("+마감-과냉스토상승62");} if V > V[1] and sto65k < stoL and stok10n20Lcon == 1 and sto10k > sto10k[1] and !(C < lp3 and C < lp4) and ((C[1] >= O[1] and V[1] > V[2] and upV >= Faddbox) or (sp > sp[1] and upV >= 0.3) or (upV >= 0.3 and V > V[1]*1.2) or (C[1] < O[1] and V[1] > V[2]*1.2 and V > vp and upV >= 0.5)) and addsellclconcnt99 > 0 then {Exitshort("+마감-과냉스토상승64");} } */ } } //########## ---------- 매수청산 ---------- ##########// // 매수 Routine과 다른 부분이 있으나 이는 자연원리(중력의 법칙)상 당연한 것임 // marketposition() == [1 = 매수, 0 = 무 포지션, -1 = 매도] if marketposition() == 1 then if notbuyclgrd == 0 or (C < daylow(1) - Faddbox and !(lp0123dr > 0 or uplongtrend > 0)) then if (sto65k > sto65d and (C < lp1 or lp1234dr < 1)) or (sto65k < sto65d and ((C < lp1 and lp1234dr < 1) or (contbidaskcnt < -1 and bidask[3] < 0 and bgstvolcon == 1 and bgstdownVcon == 1 and downV > depvaluemin1))) or ((sto65down == 2 or sto130down == 2) and (C < lp1 or C < daylow(1))) then if !(((sto65up == 2 and sto130up1 == 2) or (sto65up1 == 2 and sto130up == 2)) and C > lp1 and C >= daylow(0)[1] and (sto10down < 2 and sto20down < 2) and C >= yboxmid and tboxdep < depvaluemin1) then { if C < O and C < sp and sp < sp[1] and C < C[1] and (H < H[1] or C < L[1]) then if (C[1] <= O[1] or (C < O[1] and C < O[2] and (downV >= Faddbox or C <= C[1] - Faddbox))) then if dayindex() < 12 then if upbidaskcon == 0 or dayindex() == 0 then { { if sto10k < sto10k[1] then { if !(dayindex() == 0 and (C >= dayclose(1) or lp1 >= lp1[1])) then { if lph1 < lph2 and lp < lp[1] and sph1 < sph2 and sph1 < lph1 and sp < lp then { {Exitlong("-520복합하락N");} } if mph1 < mph2 and mp < mp[1] and sph1 < sph2 and sph1 < mph1 and sp < mp then { {Exitlong("-510복합하락N");} } if sph1 < sph2 and sph1 < lp and lp < lp[1] and sp < lp then { {Exitlong("-520하락N");} } if downhb5con == 1 and sp[3] <= lp and sp < sph1 and lp < lp[1] and sp < lp then { {Exitlong("-520하락횡보");} } if lph1 < lph2 and lp < lp[1] and lph1 <= lp1 and lp1 < lp1[1] and C < lp and lp < lp1 then { {Exitlong("-2060하락N");} } if downhb20con == 1 and lp[3] <= lp1 and lp < lph1 and lp < lp[1] and lp1 < lp1[1] and C < lp and lp < lp1 then { {Exitlong("-2060하락횡보");} } if lph1 < lph2 and C < lp and lp < lp[1] and lph1 <= lp2 and lp2 < lp2[1] and C < lp and lp < lp2 then { {Exitlong("-20120하락N");} } if downhb20con == 1 and lp[3] <= lp2 and lp < lph1 and lp < lp[1] and lp2 < lp2[1] and C < lp and lp < lp2 then { {Exitlong("-20120하락횡보");} } if mph1 < mph2 and mp < mp[1] and mph1 <= lp and lp < lp[1] and C < lp and C < mp and mp < lp then { {Exitlong("-1020하락N");} } if downhb10con == 1 and mp[3] <= lp and mp < mph1 and mp < mp[1] and lp < lp[1] and C < lp and C < mp and mp < lp then { {Exitlong("-1020하락횡보");} } if mph1 < mph2 and mp < mp[1] and mph1 <= lp1 and lp1 < lp1[1] and C < lp and C < mp and mp < lp1 then { {Exitlong("-1060하락N");} } if downhb10con == 1 and mp[3] <= lp1 and mp < mph1 and mp < mp[1] and lp1 < lp1[1] and C < lp and C < mp and mp < lp1 then { {Exitlong("-1060하락횡보");} } //if lp1h1 - 0.1 < lph2 and C < lp then // { // {Exitlong("-20쌍봉");} // } //if mph1 < mph2 and C < lp then // { // {Exitlong("-10쌍봉");} // } if (((lp0123dr > 1 or lp1234dr > 0) and sph1 < sph2 + 0.1) or (!(lp0123dr > 1 or lp1234dr > 0) and sph1 < sph2 + Faddbox)) and C < lp then { {Exitlong("-5쌍봉");} } if !(lp0123dr > 1 or lp1234dr > 0) and downhb5con == 1 and downV > 0.5 and V > V[1] and C < lp and (downV > daybgstupV or downV > daybgstdownV or clbartrend == -1 or downbidaskcon == 1) then {Exitlong("-5하락횡보");} if downhb5con == 1 and (sp < lp or sp < mp) and lp < lp[1] and C < lp and C < lp1 and clbartrend == -1 and downV >= 0.4 and downV1 >= 0.4 and C < daylow(0)[1] then {Exitlong("-5하락횡보1");} } if H < mp and C < lp and downV >= Faddbox then { if (lp < lp[1] or (dayopen(0) < daylow(1) and C < daylow(1))) Then { {Exitlong("-10이평밑");} } } } } } } if marketposition() == 1 then if notbuyclgrd == 0 then if !(lp1234dr == 2 and C > lp1 - Faddbox and d2boxdep <= depvaluemin3 and C >= d2boxlow) then { if C < O and C < L[1] and O >= sp and O >= lp and C < sp and C < lp and H - L > H[1] - L[1] then { if downV >= 0.5 and sto10k < sto10d and !(lp > lp[1] and lp1 > lp1[1] and lp > lp1) then { if dayindex() < 12 Then { if upbidaskcon == 0 or dayindex() == 0 then { {Exitlong("-장음봉");} } } } } } // ---------- 스토 쌍봉시 매수 청산 루틴 ---------- // if marketposition() == 1 then if dayindex() < 12 and C < O and C < C[1] then if notstodowncon == 0 and stodowncon > 0 then { if dayindex() > 0 and sto20k < sto20d - 0.5 and sto20k < sto20k[1] and (lp1234dr < 2 or sto20k[1] < sto20k[2]) and (sto10k < sto10d or (V > V[1] and V[1] > V[2])) then { if sto20index + 5 >= index or stime >= 140000 then { if sto20dh1 < stoh and sto20dh1 + 3 < sto20dh2 and stok20h1 + 3 < stok20h2 then { if stodowncon > 0 then {Exitlong("-sto20d-");} else {Exitlong("-sto20d-99");} } { if stok20h1 < stok20h2 and stod20h1 + 3 < stod20h2 and notbuyclgrd < 2 then { if stodowncon > 0 then {Exitlong("-sto20d-박스권-");} else {Exitlong("-sto20d-박스권-99");} } } } if sto20kh1 + 3 < sto20kh2 and sto20kh1 < sto20d[sto20kh1bar] and sto20kh1bar < 5 and sto20k < stoh then { if stodowncon > 0 then {Exitlong("-sto20k-");} else {Exitlong("-sto20k-99");} } } if sto10k < sto10d - 0.5 and sto10k < sto10k[1] and (sto20k < stoh or lp0123dr < 1 or clbartrend == -1) and (lp1234dr < 2 or sto10k[1] < sto10k[2])then { if sto10index + 5 >= index or stime >= 140000 then { if sto10dh1 < stoh and sto10dh1 + 3 < sto10dh2 and stok10h1 + 3 < stok10h2 then { if stodowncon > 0 then {Exitlong("-sto10d-");} else {Exitlong("-sto10d-99");} } { if stok10h1 < stok10h2 and stod10h1 + 3 < stod10h2 and notbuyclgrd < 2 then { if stodowncon > 0 then {Exitlong("-sto10d-박스권-");} else {Exitlong("-sto10d-박스권-99");} } } } } } /* // ---------- 마감 시간에 봉파동에 따른 매수오버 또는 청산여부 결정 루틴 ---------- // if marketposition() == 1 then if dayindex() == 11 Then { if (C >= dayclose(1) * 1.097 or H >= dayclose(1) * 1.097) and (dayclose(1) > dayclose(2) * 1.05 or (lp < lp1 and (lp < lp[1] or stodh10or20hcon == 1))) then {Exitlong("-마감-상한가청산01");} else if !(C > dayclose(1) * 1.08 and dayclose(1) < dayclose(2) * 1.08) or sto65k < sto65d or C < lp1 or (((sto20down > 2 and (sto10down > 1 or sto10d < sto10dh1)) or (sto10down > 2 and (sto20down > 1 or sto20d < sto20dh1))) and ((sto65up < 2 and sto130up < 2) or sto65k > stoh or sto130k > stoh)) then { if contgapcnt > 2 then {Exitlong("-마감-쓰리갭상승청산02");} if contgapcnt > 1 and (C > dayclose(4) * 1.08 or C > dayclose(2) * 1.04) and sto65k > stoh and stok10n20hcon == 1 then {Exitlong("-마감-투갭상승4%이상급등03");} if C < O and contbidaskcnt < 0 and contgapcnt > 0 and (C > dayclose(4) * 1.08 or C > dayclose(2) * 1.04) and sto65k > stoh and stok10n20hcon == 1 and uplongtrend == 0 then {Exitlong("-마감-무추세갭상승4%이상급등05");} if (uplongtrend == 0 or lp1234dr < 1) and C > daylow(0) * 1.06 and !(sto65k < stoL and sto65d < stoL and sto130k < stoL and sto130d < stoL) then {Exitlong("-마감-무추세일중저점대비6%이상급등07");} if lp1234dr < 1 and stok10n20hcon == 1 and (boxshupresist > 0 or box7shupresist > 1) and lp123convercon == 1 and (sto65k < sto65d or sto130k < sto130d) and C < d7boxhigh and (sto65down2 == 2 or sto130down2 == 2) and (C > dayclose(1) * 1.04 or C <= d4boxhigh) and !(borbfupbidaskcon == 1) then {Exitlong("-마감-무추세일봉스토하락이평혼조09");} if stok10n20hcon == 1 and lp1 < lp2 and lp1 < lp3 and lp1 < lp4 and !(sto65up == 2 or sto130up == 2) and (C > dayclose(4) * 1.1 or C > dayclose(2) * 1.07 or C > dayclose(1) * 1.05) then { if downlongtrend > 0 then {Exitlong("-마감-역추세5%이상급등스토과열10");} else if !(lp0123dr > 0 or lp1234dr > 0) then {Exitlong("-마감-무추세5%이상급등스토과열10");} else {Exitlong("-마감-5%이상급등스토과열10");} } if sto20k[1] > stoh and !(lp1234dr == 2 or (lp1234dr == 1 and lp3 > lp4)) and C < O and C[1] < O[1] and V > V[1] and downV > downV1 and dayhigh(0) > d7boxhigh and C <= d7boxhigh and (boxshupresist > 0 or box7shupresist > 0) and (bapdown == 2 or borbfdownbidaskcon == 1) and sto65d < sto65dh1 then {Exitlong("-마감-박스권저항및호잔하락반전11");} if contupcnt == 3 and upgapcon == 1 and C > dayclose(3) * 1.07 and displp3 > disph and simri >= simh and sto65k > stoh and stok10n20hcon == 1 then {Exitlong("-마감-7%이상급등적삼병과열21");} if V > V[1] and sto65k < stoh and sto20k[1] > stoh and sto10k[1] > stoh and sto10k < sto10k[1] and (sto20d < sto20dh1 or sto10d < sto10dh1) and C < O and C < C[1] and boxcrupresist > 0 and bfdaydownlpcnt > 4 and (contgapcnt == 0 or dayopen(0) < d2boxhigh) and displp3 < disph and simri < simh then {Exitlong("-마감-박스권저항22");} if lp1234dr < 2 and V > V[1] and C < O and C < C[1] and (sto65k > stoh or sto130k > stoh) and (sto10d < sto10dh1 and sto20d < sto20dh1) and C <= dayhigh(1) and yboxmid - tboxmid < depvaluemin and tboxdep > depvaluemin and downV > daybgstupV and contbidaskcnt < 0 then {Exitlong("-마감-박스권저항23");} if downlongtrend > 0 and stok10or20hcon == 1 and stodh10or20downcon == 1 and ((lpshupresist > 0 and (boxshupresist > 0 or box7shupresist > 0)) or (boxshupresist > 1 and box7shupresist > 1)) and !(sto65up == 2 or sto130up == 2 or stodL65n130Lcon == 1) then {Exitlong("-마감-역추세이평및박스권저항24");} if sto65k < sto65d and sto130k < sto130d and displp3 > disph and !(sto65up2 == 2 or sto130up2 == 2) then { if boxshupresist > 0 and box7shupresist > 0 and d4boxdep < depvaluemax and C <= d4boxhigh and !((bidask > 0 and contbidaskcnt > 0) or C - dayclose(1) > depvaluemid) then {Exitlong("-마감-일봉스토하락중박스권저항33");} if (dayhigh(2) > dayhigh(1) and dayhigh(2) > dayhigh(0) and daylow(2) < daylow(1) and daylow(2) < daylow(0)) then {Exitlong("-마감-일봉스토하락중박스권수렴34");} { if (d3boxhigh >= dayhigh(1) and d3boxhigh >= dayhigh(0) and d3boxlow <= daylow(1) and d3boxlow <= daylow(0)) or (d4boxhigh >= dayhigh(1) and d4boxhigh >= dayhigh(0) and d4boxlow <= daylow(1) and d4boxlow <= daylow(0)) then {Exitlong("-마감-일봉스토하락중박스권수렴35");} } } if lp123convercon == 1 then { if stok10n20hcon == 1 and C <= d2boxlow + 0.5 then {Exitlong("-마감-이평선수렴주의36");} } if C < O and lp1234dr < 2 and C < lp4 and lp4 < lp4[1] and tboxmid - yboxmid < depvaluemin and (yboxmid - y2boxmid < depvaluemin or ((sto10down > 1 or sto20down > 1) and contbidaskcnt < 0)) and C <= dayhigh(1) and sto10d < sto10dh1 and sto20d < sto20dh1 and sto65d < sto65dh1 and tboxdep > 1 then {Exitlong("-마감-상승부진청산37");} if lp1 < lp1[1] and lp1[1] < lp1[2] and lp < lp1 and !(lp0123dr > 1 or uplongtrend > 0 or sto65up== 2 or sto130up == 2 or stodL65or130Lcon == 1) and (boxshupresist > 0 or box7shupresist > 0) and (bapdown == 2 or contbidaskcnt < 0) then {Exitlong("-마감-무추세호잔하락38");} if lp1234dr > 0 and stok65n130hcon == 1 and displp3 > stoh and simri >= simh and stodh10n20hcon== 1 and sto65d > stoh and sto130d > stoh and sto10k > 70 and sto20k > 70 and dayhigh(0)[1] <= dayhigh(1) and C[1] < dayhigh(0)[1] and C < dayhigh(1) + depvaluemin1 then {Exitlong("-마감-이투과열스토하락39");}// 08.12.02 작성 if lp123convercon == 1 and lp1234dr > 0 and simri >= simh and sto65k > stoh and stok10n20hcon == 1 and sto10k < sto10d then { if (C > dayclose(4) * 1.1 or C > dayclose(2) * 1.07 or C > dayclose(1) * 1.04) then {Exitlong("-마감-4%이상급등스토과열46");} if sto10down > 1 or sto20down > 1 then {Exitlong("-마감-스토과열권스토쌍봉46");} if (borbfdownbidaskcon == 1 or (bidask < 0 and bapdown == 2 and contbidaskcnt < 0)) then {Exitlong("-마감-스토과열권호잔하락46");} if lpshupresist > 0 then {Exitlong("-마감-스토과열권이평선저항46");} if boxshupresist > 0 or box7shupresist > 0 then {Exitlong("-마감-스토과열권박스권저항46");} if entbartrend == -1 or clbartrend == -1 or clbartrend == -1 then {Exitlong("-마감-스토과열권하락봉파동46");} if bgstvolcon == 1 or (dayindex() > 0 and V > V[1] * 1.5 and V > vp) then {Exitlong("-마감-스토과열권장대거래량46");} if bgstdownVcon == 1 or downV > depvaluemin1 then {Exitlong("-마감-스토과열권장대음봉46");} if lp1234dr < 2 and (sto20k[1] > stoh or sto10k[1] > stoh) and stodh10or20hcon == 1 then {Exitlong("-마감-과열스토하락46");} } if stok10n20hcon == 1 and lp1 < lp2 and lp1 < lp3 and lp1 < lp4 and !(sto65up == 2 or sto130up == 2) and ((C < lp2 and C < lp3 and C < lp4) or (lp1 < lp1[1] and lp1[1] < lp1[2] and sp < lp4 and lp4 < lp4[1])) then { if downlongtrend > 0 then { if (C > dayclose(4) * 1.1 or C > dayclose(2) * 1.07 or C > dayclose(1) * 1.04) then {Exitlong("-마감-역추세4%이상급등스토과열48");} if sto10down > 1 or sto20down > 1 then {Exitlong("-마감-역추세스토과열권스토쌍봉48");} if (borbfdownbidaskcon == 1 or (bidask < 0 and bapdown == 2 and contbidaskcnt < 0)) then {Exitlong("-마감-역추세스토과열권호잔하락48");} if lpshupresist > 0 then {Exitlong("-마감-역추세스토과열권이평선저항48");} if boxshupresist > 0 or box7shupresist > 0 then {Exitlong("-마감-역추세스토과열권박스권저항48");} if entbartrend == -1 or clbartrend == -1 or clbartrend == -1 then {Exitlong("-마감-역추세스토과열권하락봉파동48");} if bgstvolcon == 1 or (dayindex() > 0 and V > V[1] * 1.5 and V > vp) then {Exitlong("-마감-역추세스토과열권장대거래량48");} if bgstdownVcon == 1 or downV > depvaluemin1 then {Exitlong("-마감-역추세스토과열권장대음봉48");} if lp1234dr < 2 and (sto20k[1] > stoh or sto10k[1] > stoh) and stodh10or20hcon == 1 then {Exitlong("-마감-역추세과열스토하락48");} } else if !(lp0123dr > 0 or lp1234dr > 0) then { if (C > dayclose(4) * 1.1 or C > dayclose(2) * 1.07 or C > dayclose(1) * 1.04) then {Exitlong("-마감-무추세4%이상급등스토과열48");} if sto10down > 1 or sto20down > 1 then {Exitlong("-마감-무추세스토과열권스토쌍봉48");} if (borbfdownbidaskcon == 1 or (bidask < 0 and bapdown == 2 and contbidaskcnt < 0)) then {Exitlong("-마감-무추세스토과열권호잔하락48");} if lpshupresist > 0 then {Exitlong("-마감-무추세스토과열권이평선저항48");} if boxshupresist > 0 or box7shupresist > 0 then {Exitlong("-마감-무추세스토과열권박스권저항48");} if entbartrend == -1 or clbartrend == -1 or clbartrend == -1 then {Exitlong("-마감-무추세스토과열권하락봉파동48");} if bgstvolcon == 1 or (dayindex() > 0 and V > V[1] * 1.5 and V > vp) then {Exitlong("-마감-무추세스토과열권장대거래량48");} if bgstdownVcon == 1 or downV > depvaluemin1 then {Exitlong("-마감-무추세스토과열권장대음봉48");} if lp1234dr < 2 and (sto20k[1] > stoh or sto10k[1] > stoh) and stodh10or20hcon == 1 then {Exitlong("-마감-무추세과열스토하락48");} } } if !(lp0123dr > 1 or lp1234dr > 0) and stok10n20hcon == 1 and (boxshupresist > 1 and box7shupresist > 1 and lpshupresist > 0) and lp1 < lp2 and lp2 < lp3 and lp3 < lp4 //and !(sp > lp1 and lp1 > lp1[1] and lp1[1] > lp1[2]) and contgapcnt < 1 and sto65up1 <> 2 and sto130up1 <> 2 and sto20up1 < 3 then {Exitlong("-마감-무추세이평선및박스권저항70");} //if ((entryprice(0) - C > entryprice(0) * Flosscutrate) // or (dayclose(1) - C > dayclose(1) * Flosscutrate and lp1234dr < 1)) and C < O then // {Exitlong("-마감-손절매청산99");} if C <= O or buyclupdowncon == 1 or (bidask < bidask[1] and bidask[1] < bidask[2]) then { if notbuyclgrd < 2 or forcedbuyclcon > 0 then { if dayhigh(0) <= d4boxhigh + Faddbox and (entbartrend < 0 or clbartrend < 0) and stok65n130hcon == 1 and stodh10or20hcon == 1 and C < lp and (borbfdownbidaskcon == 1) and ( (Crossdown(displp3,disph) or (dayhighdisplp3 > disph and displp3 < disph)) or (Crossdown(simri,69) or (dayhighsimri >= simh and simri < simh)) ) then {Exitlong("-마감-이투과열권호잔하락반전23");}// 08. 12.08 작성 if (stok65n130hcon == 1 and displp3 > disph and sto65k < sto65d and sto20k < sto20d and C < lp and (downhb5con == 1 or downhb10con == 1 or downhb20con == 1) and C < yboxmid) then {Exitlong("-마감-과열이투스토하락24");}// 08. 12.07 작성 if !(lp0123dr > 1 or uplongtrend > 0) and lpshupresist > 0 and lpshupresist[1] > 0 and V > V[1] and C < O and C[1] < O[1] and stok10n20hcon == 1 then {Exitlong("-마감-무추세이평선저항25");}// 08. 10.17 작성 if V > V[1] and ((stok10or20hcon == 1 and C < dayhigh(0)[1]) or clbartrend1 == -1 or downbidaskcon == 1) and !(lp0123dr > 1 or lp1234dr > 0 or sto65up1 == 2 or sto130up1 == 2) and downV >= 0.5 and (downV > daybgstupV and downV > daybgstdownV) then { if lp2shupresist == 1 then {Exitlong("-마감-무추세10일선저항51");} else if lp3shupresist == 1 then {Exitlong("-마감-무추세20일선저항51");} else if lp4shupresist == 1 then {Exitlong("-마감-무추세60일선저항51");} } if (entbartrend == -1 or clbartrend == -1) and uplongtrend == 0 then {Exitlong("-마감-무추세하락봉파동53");} if (Crossdown(displp3,disph) or (displp3 < disph and dayhighdisplp3 > disph)) and sto65k > stoh and sp < sp[1] and (((sto20k[1] > stoh and (sto10k[1] > stoh or (contgapcnt > 0 and (lp1234dr < 2 or displp3 > disph or C < daylow(0)[1])))) and downV > daybgstupV) or (sto65k < sto65d and sto65k < sto65dh1 and sto65dh1 > stoh and sto10k[1] > stoh)) then { if (C > dayclose(4) * 1.1 or C > dayclose(2) * 1.07 or C > dayclose(1) * 1.04) then {Exitlong("-마감-4%이상급등이격스토과열54");} if sto10down > 1 or sto20down > 1 then {Exitlong("-마감-이격스토과열권스토쌍봉54");} if (borbfdownbidaskcon == 1 or (bidask < 0 and bapdown == 2 and contbidaskcnt < 0)) then {Exitlong("-마감-이격스토과열권호잔하락54");} if lpshupresist > 0 then {Exitlong("-마감-이격스토과열권이평선저항54");} if boxshupresist > 0 or box7shupresist > 0 then {Exitlong("-마감-이격스토과열권박스권저항54");} if entbartrend == -1 or clbartrend == -1 or clbartrend == -1 then {Exitlong("-마감-이격스토과열권하락봉파동54");} if bgstvolcon == 1 or (dayindex() > 0 and V > V[1] * 1.5 and V > vp) then {Exitlong("-마감-이격스토과열권장대거래량54");} if bgstdownVcon == 1 or downV > depvaluemin1 then {Exitlong("-마감-이격스토과열권장대음봉54");} if lp1234dr < 2 and (sto20k[1] > stoh or sto10k[1] > stoh) and stodh10or20hcon == 1 then {Exitlong("-마감-이격과열스토하락54");} } if V > V[1] and (sto65k > stoh or clbartrend == -1 or downbidaskcon == 1) and sto20k[1] > stoh and (sto10k[1] > stoh or sto10k[2] > stoh) and sp < sp[1] and downV >= 0.5 and downV > daybgstupV and downV > upV1 and V > V[1] and V[1] > V[2] then { if (C > dayclose(4) * 1.1 or C > dayclose(2) * 1.07 or C > dayclose(1) * 1.04) then {Exitlong("-마감-4%이상급등스토과열55");} if sto10down > 1 or sto20down > 1 then {Exitlong("-마감-스토과열권스토쌍봉55");} if (borbfdownbidaskcon == 1 or (bidask < 0 and bapdown == 2 and contbidaskcnt < 0)) then {Exitlong("-마감-스토과열권호잔하락55");} if lpshupresist > 0 then {Exitlong("-마감-스토과열권이평선저항55");} if boxshupresist > 0 or box7shupresist > 0 then {Exitlong("-마감-스토과열권박스권저항55");} if entbartrend == -1 or clbartrend == -1 or clbartrend == -1 then {Exitlong("-마감-스토과열권하락봉파동55");} if bgstvolcon == 1 or (dayindex() > 0 and V > V[1] * 1.5 and V > vp) then {Exitlong("-마감-스토과열권장대거래량55");} if bgstdownVcon == 1 or downV > depvaluemin1 then {Exitlong("-마감-스토과열권장대음봉55");} if lp1234dr < 2 and (sto20k[1] > stoh or sto10k[1] > stoh) and stodh10or20hcon == 1 then {Exitlong("-마감-과열스토하락55");} } if lp1234dr > 0 and displp3 > 104 and simri >= simh and sto65k > stoh and stok10n20hcon == 1 and sto20k < sto20k[1] and (sto10k < sto10d or (sto10k < sto10k[1] and C < O)) then { if (C > dayclose(4) * 1.1 or C > dayclose(2) * 1.07 or C > dayclose(1) * 1.04) then {Exitlong("-마감-4%이상급등이투스토과열56");} if sto10down > 1 or sto20down > 1 then {Exitlong("-마감-이투스토과열권스토쌍봉56");} if (borbfdownbidaskcon == 1 or (bidask < 0 and bapdown == 2 and contbidaskcnt < 0)) then {Exitlong("-마감-이투스토과열권호잔하락56");} if lpshupresist > 0 then {Exitlong("-마감-이투스토과열권이평선저항56");} if boxshupresist > 0 or box7shupresist > 0 then {Exitlong("-마감-이투스토과열권박스권저항56");} if entbartrend == -1 or clbartrend == -1 or clbartrend == -1 then {Exitlong("-마감-이투스토과열권하락봉파동56");} if bgstvolcon == 1 or (dayindex() > 0 and V > V[1] * 1.5 and V > vp) then {Exitlong("-마감-이투스토과열권장대거래량56");} if bgstdownVcon == 1 or downV > depvaluemin1 then {Exitlong("-마감-이투스토과열권장대음봉56");} if lp1234dr < 2 and (sto20k[1] > stoh or sto10k[1] > stoh) and stodh10or20hcon == 1 then {Exitlong("-마감-이투과열스토하락56");} } if V > V[1] and !(lp0123dr > 1 or lp1234dr > 0) and sto65k > stoh and stok10n20hcon == 1 and sto20k < sto20d and sto10k < sto10d and sp < sp[1] then { if (C > dayclose(4) * 1.1 or C > dayclose(2) * 1.07 or C > dayclose(1) * 1.04) then {Exitlong("-마감-4%이상급등스토과열57");} if sto10down > 1 or sto20down > 1 then {Exitlong("-마감-스토과열권스토쌍봉57");} if (borbfdownbidaskcon == 1 or (bidask < 0 and bapdown == 2 and contbidaskcnt < 0)) then {Exitlong("-마감-스토과열권호잔하락57");} if lpshupresist > 0 then {Exitlong("-마감-스토과열권이평선저항57");} if boxshupresist > 0 or box7shupresist > 0 then {Exitlong("-마감-스토과열권박스권저항57");} if entbartrend == -1 or clbartrend == -1 or clbartrend == -1 then {Exitlong("-마감-스토과열권하락봉파동57");} if bgstvolcon == 1 or (dayindex() > 0 and V > V[1] * 1.5 and V > vp) then {Exitlong("-마감-스토과열권장대거래량57");} if bgstdownVcon == 1 or downV > depvaluemin1 then {Exitlong("-마감-스토과열권장대음봉57");} if lp1234dr < 2 and (sto20k[1] > stoh or sto10k[1] > stoh) and stodh10or20hcon == 1 then {Exitlong("-마감-과열스토하락57");} } if V > V[1] and (lpshupresist > 0 or boxshupresist > 0 or box7shupresist > 0) and stok10n20hcon == 1 and sp < sp[1] then { if downlongtrend > 0 then { if (C > dayclose(4) * 1.1 or C > dayclose(2) * 1.07 or C > dayclose(1) * 1.04) then {Exitlong("-마감-역추세4%이상급등스토과열58");} if sto10down > 1 or sto20down > 1 then {Exitlong("-마감-역추세스토과열권스토쌍봉58");} if (borbfdownbidaskcon == 1 or (bidask < 0 and bapdown == 2 and contbidaskcnt < 0)) then {Exitlong("-마감-역추세스토과열권호잔하락58");} if lpshupresist > 0 then {Exitlong("-마감-역추세스토과열권이평선저항58");} if boxshupresist > 0 or box7shupresist > 0 then {Exitlong("-마감-역추세스토과열권박스권저항58");} if entbartrend == -1 or clbartrend == -1 or clbartrend == -1 then {Exitlong("-마감-역추세스토과열권하락봉파동58");} if bgstvolcon == 1 or (dayindex() > 0 and V > V[1] * 1.5 and V > vp) then {Exitlong("-마감-역추세스토과열권장대거래량58");} if bgstdownVcon == 1 or downV > depvaluemin1 then {Exitlong("-마감-역추세스토과열권장대음봉58");} if lp1234dr < 2 and (sto20k[1] > stoh or sto10k[1] > stoh) and stodh10or20hcon == 1 then {Exitlong("-마감-역추세과열스토하락58");} } if !(lp0123dr > 1 or uplongtrend > 0) then { if (C > dayclose(4) * 1.1 or C > dayclose(2) * 1.07 or C > dayclose(1) * 1.04) then {Exitlong("-마감-무추세4%이상급등스토과열58");} if sto10down > 1 or sto20down > 1 then {Exitlong("-마감-무추세스토과열권스토쌍봉58");} if (borbfdownbidaskcon == 1 or (bidask < 0 and bapdown == 2 and contbidaskcnt < 0)) then {Exitlong("-마감-무추세스토과열권호잔하락58");} if lpshupresist > 0 then {Exitlong("-마감-무추세스토과열권이평선저항58");} if boxshupresist > 0 or box7shupresist > 0 then {Exitlong("-마감-무추세스토과열권박스권저항58");} if entbartrend == -1 or clbartrend == -1 or clbartrend == -1 then {Exitlong("-마감-무추세스토과열권하락봉파동58");} if bgstvolcon == 1 or (dayindex() > 0 and V > V[1] * 1.5 and V > vp) then {Exitlong("-마감-무추세스토과열권장대거래량58");} if bgstdownVcon == 1 or downV > depvaluemin1 then {Exitlong("-마감-무추세스토과열권장대음봉58");} if lp1234dr < 2 and (sto20k[1] > stoh or sto10k[1] > stoh) and stodh10or20hcon == 1 then {Exitlong("-마감-무추세과열스토하락58");} } } if C < O and C < C[1] and sto65k < sto65dh1 and stok10n20hcon == 1 and (borbfdownbidaskcon == 1) and dayopen(0) < d4boxhigh and tboxmid < d4boxhigh then { if (C > dayclose(4) * 1.1 or C > dayclose(2) * 1.07 or C > dayclose(1) * 1.04) then {Exitlong("-마감-4%이상급등스토과열59");} if sto10down > 1 or sto20down > 1 then {Exitlong("-마감-스토과열권스토쌍봉59");} if (borbfdownbidaskcon == 1 or (bidask < 0 and bapdown == 2 and contbidaskcnt < 0)) then {Exitlong("-마감-스토과열권호잔하락59");} if lpshupresist > 0 then {Exitlong("-마감-스토과열권이평선저항59");} if boxshupresist > 0 or box7shupresist > 0 then {Exitlong("-마감-스토과열권박스권저항59");} if entbartrend == -1 or clbartrend == -1 or clbartrend == -1 then {Exitlong("-마감-스토과열권하락봉파동59");} if bgstvolcon == 1 or (dayindex() > 0 and V > V[1] * 1.5 and V > vp) then {Exitlong("-마감-스토과열권장대거래량59");} if bgstdownVcon == 1 or downV > depvaluemin1 then {Exitlong("-마감-스토과열권장대음봉59");} if lp1234dr < 2 and (sto20k[1] > stoh or sto10k[1] > stoh) and stodh10or20hcon == 1 then {Exitlong("-마감-과열스토하락59");} } if (lp1234dr < 2 or V > daybgstvol or sto65k < sto65d) and C < O and C < C[1] and sto65k > stoh and sto10k[1] > stoh and clbartrend == -1 and boxshupresist > 0 then { if (C > dayclose(4) * 1.1 or C > dayclose(2) * 1.07 or C > dayclose(1) * 1.04) then {Exitlong("-마감-4%이상급등스토과열60");} if sto10down > 1 or sto20down > 1 then {Exitlong("-마감-스토과열권스토쌍봉60");} if (borbfdownbidaskcon == 1 or (bidask < 0 and bapdown == 2 and contbidaskcnt < 0)) then {Exitlong("-마감-스토과열권호잔하락60");} if lpshupresist > 0 then {Exitlong("-마감-스토과열권이평선저항60");} if boxshupresist > 0 or box7shupresist > 0 then {Exitlong("-마감-스토과열권박스권저항60");} if entbartrend == -1 or clbartrend == -1 or clbartrend == -1 then {Exitlong("-마감-스토과열권하락봉파동60");} if bgstvolcon == 1 or (dayindex() > 0 and V > V[1] * 1.5 and V > vp) then {Exitlong("-마감-스토과열권장대거래량60");} if bgstdownVcon == 1 or downV > depvaluemin1 then {Exitlong("-마감-스토과열권장대음봉60");} if lp1234dr < 2 and (sto20k[1] > stoh or sto10k[1] > stoh) and stodh10or20hcon == 1 then {Exitlong("-마감-과열스토하락60");} } if V > V[1] and displp3 > disph and sto65k > stoh and boxcrupresist > 0 and downV > daybgstupV and downV >= 0.5 and sto10k < sto10d then { if (C > dayclose(4) * 1.1 or C > dayclose(2) * 1.07 or C > dayclose(1) * 1.04) then {Exitlong("-마감-4%이상급등스토과열62");} if sto10down > 1 or sto20down > 1 then {Exitlong("-마감-스토과열권스토쌍봉62");} if (borbfdownbidaskcon == 1 or (bidask < 0 and bapdown == 2 and contbidaskcnt < 0)) then {Exitlong("-마감-스토과열권호잔하락62");} if lpshupresist > 0 then {Exitlong("-마감-스토과열권이평선저항62");} if boxshupresist > 0 or box7shupresist > 0 then {Exitlong("-마감-스토과열권박스권저항62");} if entbartrend == -1 or clbartrend == -1 or clbartrend == -1 then {Exitlong("-마감-스토과열권하락봉파동62");} if bgstvolcon == 1 or (dayindex() > 0 and V > V[1] * 1.5 and V > vp) then {Exitlong("-마감-스토과열권장대거래량62");} if bgstdownVcon == 1 or downV > depvaluemin1 then {Exitlong("-마감-스토과열권장대음봉62");} if lp1234dr < 2 and (sto20k[1] > stoh or sto10k[1] > stoh) and stodh10or20hcon == 1 then {Exitlong("-마감-과열스토하락62");} } } if V > V[1] and displp3 > 106 and simri >= simh and sto65k > stoh and (stok10n20hcon == 1 or (stok10or20hcon == 1 and V > dayopenvol)) then { if (C > dayclose(4) * 1.1 or C > dayclose(2) * 1.07 or C > dayclose(1) * 1.04) then {Exitlong("-마감-4%이상급등이투스토과열63");} if sto10down > 1 or sto20down > 1 then {Exitlong("-마감-이투스토과열권스토쌍봉63");} if (borbfdownbidaskcon == 1 or (bidask < 0 and bapdown == 2 and contbidaskcnt < 0)) then {Exitlong("-마감-이투스토과열권호잔하락63");} if lpshupresist > 0 then {Exitlong("-마감-이투스토과열권이평선저항63");} if boxshupresist > 0 or box7shupresist > 0 then {Exitlong("-마감-이투스토과열권박스권저항63");} if entbartrend == -1 or clbartrend == -1 or clbartrend == -1 then {Exitlong("-마감-이투스토과열권하락봉파동63");} if bgstvolcon == 1 or (dayindex() > 0 and V > V[1] * 1.5 and V > vp) then {Exitlong("-마감-이투스토과열권장대거래량63");} if bgstdownVcon == 1 or downV > depvaluemin1 then {Exitlong("-마감-이투스토과열권장대음봉63");} if lp1234dr < 2 and (sto20k[1] > stoh or sto10k[1] > stoh) and stodh10or20hcon == 1 then {Exitlong("-마감-이투과열스토하락63");} } } } } */ // ----- 매수금지, 매도금지, 매수청산금지, 매도청산금지 루틴 검증 번호 로깅 ------// // ----- 실 적용은 차트상 문제가 있을 경우, 테스트할 경우만 하고 평소에는 막아둘 것 ------// //MessageLog("%.0f, %.0f, %.0f",notbuycon, notbuyregcon, notbuybetcon); //Alert("%.0f, %.0f, %.0f",notbuycon, notbuyregcon, notbuybetcon) /* if date < currentdate() or stime + 3000 < currenttime() or stime + 2999 == currenttime() or stime + 1000 == currenttime() or stime + 2000 == currenttime() then //if int(FracPortion(Time/10000)*100) == int(FracPortion(currentTime()/10000)*100) then { Print("30분-Tb.txt", ", 현재시간 %.0f, 봉시작시간 %.0f, 봉끝시간 %.0f, %.0f, %.0f, %.0f", Currenttime(), stime, time, Fline, Fline, Fline); Print("30분-Tb.txt", ", notbuy %.0f, reg %.0f, bet %.0f, buymin %.0f, buyreg %.0f, buybet %.0f", notbuycon, notbuyregcon, notbuybetcon, buymincon, buyregcon, buybetcon); Print("30분-Tb.txt", ", notsell %.0f, reg %.0f, bet %.0f, sellmin %.0f, sellreg %.0f, sellbet %.0f", notsellcon, notsellregcon, notsellbetcon, sellmincon, sellregcon, sellbetcon); Print("30분-Tb.txt", ", forcedbuy %.0f, sell %.0f, buycl %.0f, sellcl %.0f, notbuycl %.0f, sellcl %.0f", forcedbuycon, forcedsellcon, forcedbuyclcon, forcedsellclcon, notbuyclcon, notsellclcon); Print("30분-Tb.txt", ", entbartrend %.0f, cL %.0f, cL1 %.0f, lp1dupcon %.0f, addbuyclcnt %.0f, sell %.0f", entbartrend, clbartrend, clbartrend1, lp1dupcon, addbuyclconcnt, addsellclconcnt); Print("30분-Tb.txt", ", bgstvol %.0f, upV %.0f, downV %.0f, spmpdup %.0f, splpdup %.0f, mplpdup %.0f", bgstvolcon, bgstupVcon, bgstdownVcon, spmpdupcon, splpdupcon, mplpdupcon); Print("30분-Tb.txt", ", uplongtend %.0f, down %.0f, spnlp1234 %.0f, mplpnlp12dup %.0f, bapup %.0f, bapdown %.0f", uplongtrend, downlongtrend, spnlp1234con, mplpnlp12dupcon, bapup, bapdown); Print("30분-Tb.txt", ", lp1234dr %.0f, 123 %.0f, 0123 %.0f, 234 %.0f, 124 %.0f, 134 %.0f", lp1234dr, lp123dr, lp0123dr, lp234dr, lp124dr, lp134dr); Print("30분-Tb.txt", ", lp123conver %.0f, 1234 %.0f, box %.0f, lp1234gapmin %.0f, 123 %.0f, 234 %.0f", lp123convercon, lp1234convercon, boxconvercon, lp1234gapmincon, lp123gapmincon, lp234gapmincon); Print("30분-Tb.txt", ", lpcrup %.0f, down %.0f, shup %.0f, down %.0f, lpcrupcon %.0f, down %.0f", lpcrupresist, lpcrdownresist, lpshupresist, lpshdownresist, lpcrupcon, lpcrdowncon); Print("30분-Tb.txt", ", boxshup %.0f, down %.0f, box7shup %.0f, down %.0f, sellcldownup %.0f, buy %.0f", boxshupresist, boxshdownresist, box7shupresist, box7shdownresist, sellcldownupcon, buyclupdowncon); Print("30분-Tb.txt", ", depvaluemin %.2f, min1 %.2f, min3 %.2f, mid %.2f, mid1 %.2f, max %.2f", depvaluemin, depvaluemin1, depvaluemin3, depvaluemid, depvaluemid1, depvaluemax); Print("30분-Tb.txt", ", bar12dep %.2f, high %.2f, low %.2f, bar6dep %.2f, high %.2f, low %.2f", bar12dep, bar12high, bar12low, bar6dep, bar6high, bar6low); Print("30분-Tb.txt", ", bar12dep[1] %.2f, high %.2f, low %.2f, bar6dep[1] %.2f, high %.2f, low %.2f", bar12dep[1], bar12high[1], bar12low[1], bar6dep[1], bar6high[1], bar6low[1]); Print("30분-Tb.txt", ", dayupVcnt %.0f, sum %.2f, avg %.2f, daydownVcnt %.0f, sum %.2f, avg %.2f", dayupVcnt, dayupVsum, dayupVavg, daydownVcnt, daydownVsum, daydownVavg); Print("30분-Tb.txt", ", forcedstoup %.0f, not %.0f, stoup %.0f, forcedstodown %.0f, not %.0f, stodown %.0f", forcedstoupcon, notstoupcon, stoupcon, forcedstodowncon, notstodowncon, stodowncon); Print("30분-Tb.txt", ", sto10up %.0f, up1 %.0f, up2 %.0f, 10down %.0f, down1 %.0f, down2 %.0f", sto10up, sto10up1, sto10up2, sto10down, sto10down1, sto10down2); Print("30분-Tb.txt", ", sto20up %.0f, up1 %.0f, up2 %.0f, 20down %.0f, down1 %.0f, down2 %.0f", sto20up, sto20up1, sto20up2, sto20down, sto20down1, sto20down2); Print("30분-Tb.txt", ", sto65up %.0f, up1 %.0f, up2 %.0f, 65down %.0f, down1 %.0f, down2 %.0f", sto65up, sto65up1, sto65up2, sto65down, sto65down1, sto65down2); Print("30분-Tb.txt", ", sto130up %.0f, up1 %.0f, up2 %.0f, 130down %.0f, down1 %.0f, down2 %.0f", sto130up, sto130up1, sto130up2, sto130down, sto130down1, sto130down2); Print("30분-Tb.txt", ", stok10n20L %.0f, or %.0f, k10n20h %.0f, or %.0f, dL10n20L %.0f, or %.0f", stok10n20Lcon, stok10or20Lcon, stok10n20hcon, stok10or20hcon, stodL10n20Lcon , stodL10or20Lcon); Print("30분-Tb.txt", ", dL10n20up %.0f, or %.0f, dh10n20down %.0f, or %.0f, dh10n20h %.0f, or %.0f", stodL10n20upcon, stodL10or20upcon, stodh10n20downcon, stodh10or20downcon, stodh10n20hcon, stodh10or20hcon); Print("30분-Tb.txt", ", stok65n130L %.0f, or %.0f, k65n130h %.0f, or %.0f, dL65n130L %.0f, or %.0f", stok65n130Lcon, stok65or130Lcon, stok65n130hcon, stok65or130hcon, stodL65n130Lcon, stodL65or130Lcon); Print("30분-Tb.txt", ", dL65n130up %.0f, or %.0f, dh65n130down %.0f, or %.0f, dh65n130h %.0f, or %.0f", stodL65n130upcon, stodL65or130upcon, stodh65n130downcon, stodh65or130downcon, stodh65n130hcon, stodh65or130hcon); Print("30분-Tb.txt", ", sto10dL1 %.2f, dL2 %.2f, dL3 %.2f, 10dh1 %.2f, dh2 %.2f, dh3 %.2f", sto10dL1, sto10dL2, sto10dL3, sto10dh1, sto10dh2, sto10dh3); //Print("30분-Tb.txt", ", sto10kL1 %.2f, kL2 %.2f, kL3 %.2f, 10kh1 %.2f, kh2 %.2f, kh3 %.2f", //sto10kL1, sto10kL2, sto10kL3, sto10kh1, sto10kh2, sto10kh3); //Print("30분-Tb.txt", ", stod10L1 %.2f, L2 %.2f, L3 %.2f, 10h1 %.2f, h2 %.2f, h3 %.2f", //stod10L1, stod10L2, stod10L3, stod10h1, stod10h2, stod10h3); //Print("30분-Tb.txt", ", stok10L1 %.2f, L2 %.2f, L3 %.2f, 10h1 %.2f, h2 %.2f, h3 %.2f", //stok10L1, stok10L2, stok10L3, stok10h1, stok10h2, stok10h3); Print("30분-Tb.txt", ", sto20dL1 %.2f, dL2 %.2f, dL3 %.2f, 20dh1 %.2f, dh2 %.2f, dh3 %.2f", sto20dL1, sto20dL2, sto20dL3, sto20dh1, sto20dh2, sto20dh3); //Print("30분-Tb.txt", ", sto20kL1 %.2f, kL2 %.2f, kL3 %.2f, 20kh1 %.2f, kh2 %.2f, kh3 %.2f", //sto20kL1, sto20kL2, sto20kL3, sto20kh1, sto20kh2, sto20kh3); //Print("30분-Tb.txt", ", stod20L1 %.2f, L2 %.2f, L3 %.2f, 20h1 %.2f, h2 %.2f, h3 %.2f", //stod20L1, stod20L2, stod20L3, stod20h1, stod20h2, stod20h3); //Print("30분-Tb.txt", ", stok20L1 %.2f, L2 %.2f, L3 %.2f, 20h1 %.2f, h2 %.2f, h3 %.2f", //stok20L1, stok20L2, stok20L3, stok20h1, stok20h2, stok20h3); Print("30분-Tb.txt", ", lp1h1 %.2f, h2 %.2f, lp1L1 %.2f, L2 %.2f, sto130dh1 %.2f, dh2 %.2f", lp1h1, lp1h2, lp1L1, lp1L2, sto130dh1, sto130dh2); Print("30분-Tb.txt", ", sto65dL1 %.2f, dL2 %.2f, sto65dh1 %.2f, dh2 %.2f, sto130dL1 %.2f, dL2 %.2f", sto65dL1, sto65dL2, sto65dh1, sto65dh2, sto130dL1, sto130dL2); Print("30분-Tb.txt", ", tdep %.2f, ydep %.2f, tmid %.2f, ymid %.2f, dayhigh(0)[1] %.2f, low(0)[1] %.2f", tboxdep, yboxdep, tboxmid, yboxmid, dayhigh(0)[1], daylow(0)[1]); Print("30분-Tb.txt", ", d2boxdep %.2f, high %.2f, low %.2f, d3boxdep %.2f, high %.2f, low %.2f", d2boxdep, d2boxhigh, d2boxlow, d3boxdep, d3boxhigh, d3boxlow); Print("30분-Tb.txt", ", d4boxdep %.2f, high %.2f, low %.2f, d5boxdep %.2f, high %.2f, low %.2f", d4boxdep, d4boxhigh, d4boxlow, d5boxdep, d5boxhigh, d5boxlow); Print("30분-Tb.txt", ", d6boxdep %.2f, high %.2f, low %.2f, d7boxdep %.2f, high %.2f, low %.2f", d6boxdep, d6boxhigh, d6boxlow, d7boxdep, d7boxhigh, d7boxlow); Print("30분-Tb.txt", ", tupV %.2f, tdownV %.2f, downupV %.2f, updownV %.2f, Crossdown %.0f, upfailure10 %.0f", tupV, tdownV, downupV, updownV, Crossdown520con, upfailure10con); Print("30분-Tb.txt", ", sph1 %.2f, h2 %.2f, spL1 %.2f, L2 %.2f, mph1 %.2f, h2 %.2f", sph1, sph2, spL1, spL2, mph1, mph2); Print("30분-Tb.txt", ", mpL1 %.2f, L2 %.2f, lph1 %.2f, h2 %.2f, lpL1 %.2f, L2 %.2f", mpL1, mpL2, lph1, lph2, lpL1, lpL2); Print("30분-Tb.txt", ", uphb5con %.0f, 10 %.0f, 20 %.0f, downhb5con %.0f, 10 %.0f, 20 %.0f", uphb5con, uphb10con, uphb20con, downhb5con, downhb10con, downhb20con); Print("30분-Tb.txt", ", upbidask %.0f, bf %.0f, downbidask %.0f, bf %.0f, contbidaskcnt %.0f, barcnt %.0f", upbidaskcon, bfupbidaskcon, downbidaskcon, bfdownbidaskcon, contbidaskcnt, contbarcnt); //Print("30분-Tb.txt", ", sto10dL1 %.2f, dL2 %.2f, dL3 %.2f, sto10dh1 %.2f, dh2 %.2f, dh3 %.2f", //sto10dL1, sto10dL2, sto10dL3, sto10dh1, sto10dh2, sto10dh3); ///Print("30분-Tb.txt", ", sto20dL1 %.2f, dL2 %.2f, dL3 %.2f, sto20dh1 %.2f, dh2 %.2f, dh3 %.2f", //sto20dL1, sto20dL2, sto20dL3, sto20dh1, sto20dh2, sto20dh3); } */