// Downloaded From https://www.WiseStockTrader.com /* * indicator based *indicator based on search on historical data 2-3 years hardcoding current previous bar values. It finds unique buy/sell calls on DAILy intrday. We have to analyze results after exploring. compare relatively // decion based on relative 1_T 12_T 1Diff 12Diff ref(bf,+1) // decion based on relative SHOULD sort candles c_cond2 c_cond3 latest 1_T 12_T 1Diff 12Diff ref(bf,+1) // relative GAP bitween 1_T 12_T 1_d with relative to current bars iff 12_diff should same // more unique if include candles its already included // DAILy // EMA regret ROC LEMA regret 561010 past next day 6699 // HL HL past next day HL HL // candles not included yet to be // decion based on relative 1_T 12_T 1Diff 12Diff ref(bf,+1) sign // relative GAP bitween 1_T 12_T 1_diff 12_diff should same // more unique if include candles // more unique if include 44556677 D 4 5 // more unique if include AddColumn(str4_diff,"DSI(1)"); AddColumn(str5_diff,"DSI(12)"); AddColumn(str6_diff,"DSI_ROC_DIFF"); //more unique iif AddColumn(bodyfactor ,"bf",4.6); AddColumn( rangefactor,"rf",4.6); AddColumn(Ref(bodyfactor ,1),">>bf",4.6); // AddColumn( Ref(rangefactor ,1),">>rf",4.6); //HourLY(Sellsum,Buysum include) yet to be garden rose // include ref(close,+3) ************ // DAILY DAILY // EMA regret ROC LEMA regret 561010 past next day 6699 // HL HL past next day HL HL // candles not included yet to be // decion based on relative 1_T 12_T 1Diff 12Diff ref(bf,+1) sign // decion based on relative 1_T 12_T 1Diff 12Diff ref(bf,+1) sign // relative GAP bitween 1_T 12_T 1_diff 12_diff should same // more unique if include candles // more unique if include 44556677 D 4 5 // more unique if include AddColumn(str4_diff,"DSI(1)"); AddColumn(str5_diff,"DSI(12)"); AddColumn(str6_diff,"DSI_ROC_DIFF"); //more unique iif AddColumn(bodyfactor ,"bf",4.6); AddColumn( rangefactor,"rf",4.6); AddColumn(Ref(bodyfactor ,1),">>bf",4.6); AddColumn( Ref(rangefactor ,1),">>rf",4.6); //HourLY(Sellsum,Buysum include) yet to be garden rose include ref(close,+3) */ */ //////////////////////////////////////////// EMA_Type = Param("EMA-1, TEMA-2, JMA-3", 2, 1, 3, 1); EMA_prds = Param("EMA_periods", 7, 1, 30, 1); Std_MACD = Param("Standard MACD? No-0, Yes-1", 1, 0, 1, 1); Plot_fashion = Param("Bar+Arrows-1, Impulse Bars-2", 2, 1, 2, 1); // Allow user to define Weekly and Monthly Ribbon Location and Height WR_P1 = Param("Weekly Ribbon Location", -10.5, -1000, 1000, 0.1); WR_P2 = Param("Weekly Ribbon Height", 366.5, -0.001, 500, 0.1); MR_P1 = Param("Monthly Ribbon Location", 5.2, -1000, 1000, 0.1); MR_P2 = Param("Monthly Ribbon Height", 199, -0.001, 500, 0.1); // Compute EMA and MACD Histogram if(EMA_Type == 1) { DayEMA = EMA(Close, EMA_prds); } if (EMA_Type == 2) { DayEMA = TEMA(Close, EMA_prds); } if(EMA_Type == 3) { // Line below to be used with Jurik JMA // DayEMA = JurikJMA(C, EMA_Prds); } Histogram = MACD() - Signal(); // Determine if we have an Impulse UP, DOWN or None Impulse_Up = DayEMA > Ref(DayEMA, -1) AND Histogram > Ref(Histogram, -1); Impulse_Down = DayEMA < Ref(DayEMA, -1) AND Histogram < Ref(Histogram, -1); Impulse_None = (NOT Impulse_UP) AND (NOT Impulse_Down); // Compute Weekly MACD and determine whether rising or falling // Note: uses "non-standard" parameters! TimeFrameSet(inWeekly); if (Std_MACD == 0) { MACD_val = MACD(5, 8); Signal_val = Signal(5, 8, 5); } else { MACD_val = MACD(12, 26); Signal_val = Signal(12, 26, 9); } Hist_in_w = MACD_val - Signal_val; wh_rising = Hist_in_w > Ref(Hist_in_w, -1); wh_falling = Hist_in_w < Ref(Hist_in_w, -1); TimeFrameRestore(); // Now get Monthly MACD Histogram.... TimeFrameSet(inMonthly); MACD_val = MACD(5, 8); Signal_val = Signal(5, 8, 5); Hist_in_m = MACD_val - Signal_val; mh_rising = Hist_in_m > Ref(Hist_in_m, -1); mh_falling = Hist_in_m < Ref(Hist_in_m, -1); TimeFrameRestore(); wh_rising = TimeFrameExpand( wh_rising, inWeekly, expandLast ); wh_falling = TimeFrameExpand( wh_falling, inWeekly, expandLast); mh_rising = TimeFrameExpand(mh_rising, inMonthly, expandLast); mh_falling = TimeFrameExpand(mh_falling, inMonthly, expandLast); kol = IIf( wh_rising, colorGreen, IIf(wh_falling, colorRed, colorLightGrey)); mkol = IIf( mh_rising, colorBlue, IIf(mh_falling, colorYellow, colorLightGrey)); // Plot them all! if (Plot_fashion == 1) { //Plot(Close, "Close", colorTeal, styleBar); //PlotShapes(shapeUpArrow * Impulse_Up, colorBlue, 0, Low, -12); //PlotShapes(shapeDownArrow * Impulse_Down, colorRed, 0, High, -12); //PlotShapes(shapeSmallCircle * Impulse_None, colorWhite, 0, High, 5); } else { bar_kol = IIf(impulse_UP, colorBlue, IIf(impulse_Down, colorRed, colorWhite)); //Plot(C, "Close", bar_kol, styleBar); } //Plot(10, "ribbon", kol, styleOwnScale|styleArea|styleNoLabel, WR_P1, WR_P2); // //Weekly trend //Plot(10, "ribbon", mkol, styleOwnScale|styleArea|styleNoLabel, MR_P1, MR_P2); // //Monthly Trend // Explorer Section // Determine if Impulse status is bullish, neutral or bearish. Display as Text //Column. Impulse_State = WriteIf(Impulse_Up, "Bulllish", WriteIf(Impulse_Down, "Bearish", "Neutral")); // Set the background color for Impulse Status Column Impulse_Col = IIf(Impulse_Up, colorGreen, IIf(Impulse_Down, colorRed, colorLightGrey)); // Determine Weekly Trend. Display as Text Column Weekly_Trend = WriteIf(wh_rising, "Rising", WriteIf(wh_falling, "Falling", "Flat!")); Weekly_Col = IIf(wh_rising, colorGreen, IIf(wh_falling, colorRed, colorLightGrey)); // Determine Monthly Trend. Display as Text Column Monthly_Trend = WriteIf(mh_rising, "Rising", WriteIf(mh_falling, "Falling", "Flat!")); Monthly_Col = IIf(mh_rising, colorGreen, IIf(mh_falling, colorRed, colorLightGrey)); // Determine how many bars has the current state existed bars_in_bull = Min(BarsSince(impulse_none), BarsSince(impulse_down)); bars_in_bear = Min(BarsSince(impulse_up), BarsSince(impulse_none)); bars_in_neut = Min(BarsSince(impulse_down), BarsSince(impulse_up)); // Set a single variable to show number of bars in current state depending upon // actual Impulse Status - Bullish, Bearish or Neutral bars_in_state = IIf(Impulse_Up, bars_in_bull, IIf(Impulse_down, bars_in_bear, bars_in_neut)); // Columns for display in Explorer //AddTextColumn(Impulse_State, "Impulse Status", 1, colorWhite, Impulse_Col); //AddColumn(bars_in_state, "Bars in this state", 1, colorWhite, Impulse_col); //AddTextColumn(Weekly_Trend, "Weekly Trend", 1, colorWhite, Weekly_Col); //AddTextColumn(Monthly_Trend, "Monthly Trend", 1, colorWhite, Monthly_Col); impBuyCond1= Impulse_Col ==colorGreen AND Ref(Impulse_Col !=colorGreen ,-1); impShortCond1=Impulse_Col==colorRed AND Ref(Impulse_Col !=colorRed ,-1); Buysum=0; Sellsum=0; BuySum=impBuyCond1; Sellsum=impShortCond1; /* */ _SECTION_END(); ////////////////////////////// //non linear Price = (H+L)/2; CoefLookback = 5; Coef = (Price-Ref(Price, -1))^2+(Price-Ref(Price, -2))^2+(Price-Ref(Price, -3))^2+(Price-Ref(Price, -4))^2+(Price-Ref(Price, -5))^2; SumCoef=0; SumCoefPrice=0; for(i=0; i < CoefLookback; i++) { SumCoef = SumCoef + Ref(Coef, -i); SumCoefPrice = SumCoefPrice + (Ref(Coef, -i) * Ref(Price, -i)); } DCEF = SumCoefPrice / SumCoef; //Title = "nonlinear: " + IIf(Close>DCEF, colorGreen, colorRed)+ NumToStr( DCEF, 1.6 ); //Plot(Close, "Close", colorWhite, styleLine); //Plot(DCEF, "NonLinear Ehlers Filter", IIf(Close>DCEF, colorGreen, colorRed), styleLine); /////////////////////////////// //Swim /* SWIM INDEX coded by KAILASH K PAREEK - INDIA . As the name of indicator explains it self, It measures the swim of Price. Day Trader may find it very useful as it gives trend reversal in next 2-3 trading. INTERPATION: Expect trend reversal or at least consolidation when SI Spikes higher, (for Peak) OR lower, (for bottom), than Relative spikes and turns back. I have found couple of times The thing called "HING" which appears 1-2 day before the Price reversal and common in Stochastic Oscillator. */ C1 = Ref ( C , -1 ) ; O1 = Ref ( O, -1 ) ; K = HHV ( ( H - C1 ) OR ( L - C1 ) , 1 ) ; L = C1 * 0.20; R = ATR ( 1 ); SI = ( ( C-C1+0.5*(C-O)+0.25*(C1-O1))/R)*(K/L); //Graph0 = SI; //Plot(SI, "SWIM index",colorGreen , styleArea); //PlotOHLC( 1.1*SI, 1.1* SI, 1.1* SI, 1.1* SI, // "Price chart shifted 10% up", colorRed, styleGradient ); //Title = "SI: " +EncodeColor( colorRed ) + NumToStr( SI, 1.6 ); /* _N(Title = StrFormat("{{NAME}} - " +FullName() + " - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) SI " + WriteVal( SI, 1.6 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( SI,1,True )) )); */ Buy1=Cross(Close,DCEF) AND ( SI>0 AND Ref(SI,-1)<0 ) AND (ROC(SI)>0 AND ROC(Ref(SI,-1))<0 ); Sell1=Cross(DCEF,Close) AND ( SI<0 AND Ref(SI,-1)>0 ) AND (ROC(SI)<0 AND ROC(Ref(SI,-1))>0 ); BuySum=BuySum+Cross(Close,DCEF); Sellsum=Sellsum+Cross(DCEF,Close); BuySum=BuySum+(( SI>0 AND Ref(SI,-1)< 0.0 )); Sellsum=Sellsum+(( SI<0 AND Ref(SI,-1)> 0.0 )); //BuySum=BuySum +(( sign( ROC(SI,1) ) != sign( ROC(Ref(SI,-1),1)) )); //Sellsum=Sellsum+(( sign( ROC(SI,1)) != sign(ROC(Ref(SI,-1), 1)))); /* PlotShapes(Buy1*shapeUpArrow,colorGreen,0,DCEF); PlotShapes(Sell1*shapeDownArrow,colorRed,0,DCEF); */ /////////////////// //gmma /* ------------------------------------------------------------------------------------------------- GUPPY MULTIPLE MOVING AVEREGES ------------------ Guppy GMMA from AmiBroker Library, enhanced with "derived" Indicators ---------------------------------------------------------------------------*/ EnableTextOutput(False); GuppyGraphType = ParamList("Type of Guppy Graphic","Guppy GMMA,Guppy Compressions,Guppy Sonar",0); // Normalization = ParamToggle("Normalization Array","CLOSE,EMA30",0); LocalBuySignal = LocalSellSignal = 0; MinMaxPeriod = 20; // --- DEFINE/CALCULATE ALL DATA NEEDED FOR BUY & SELL COMPOSITE SIGNALS outside the IndicatorType IF --- EMA03 = EMA(Close,3); EMA15 = EMA(Close,15); EMA30 = EMA(Close,30); EMA60 = EMA(Close, 60); NormalizerArray = EMA30; // IIf(Normalization == 0, Close, EMA30); // GMMADeltaPerc = ((EMA(Close,9)- EMA(Close,35)) / EMA(Close,35)) * 100; //default 15,30 GMMAUP = GMMADeltaPerc > Ref(GMMADeltaPerc,-1); GMMADOWN = GMMADeltaPerc < Ref(GMMADeltaPerc,-1); BarColor = IIf(GMMAUP AND GMMADeltaPerc >= 0,colorBrightGreen, IIf(GMMADOWN AND GMMADeltaPerc > 0,colorGreen, IIf(GMMAUP AND GMMADeltaPerc < 0, colorRed, colorDarkRed))); // Plot(GMMADeltaPerc, "\\c16, % Gap \\c29T\\c16 - \\c32INV\\c16 vs EMA(30)", BarColor, styleHistogram | styleThick ); // Plot(GMMADeltaPerc ,"up",colorAqua); /* Title = "sonar: " + "UP "+NumToStr( GMMAUP, 1.2 )+ " DOWN "+NumToStr( GMMADOWN , 1.2 ); */ BuySum=BuySum+ ((GMMAUP==1)&& (Ref(GMMAUP,-1)==0)); Sellsum=Sellsum+((GMMADOWN==1)&& (Ref(GMMADOWN,-1)==0)); //AddColumn(Close,"close"); //AddColumn(BuySum,"BuyPoints"); //AddColumn(Sellsum,"SellPoints"); //AddColumn(ROC(SI,1),"rocSI"); period = 14; formula=100*( ( RSI( period ) - LLV( RSI( period ) , period ) ) / ( ( HHV( RSI( period ) , period ) ) - LLV(RSI( period ), period ) ) ); //AddColumn(ROC(formula,2),"ROCstck"); //AddColumn(formula,"stck"); //Filter=abs(ROC(SI,1))>200; //Filter=1; buysum_Cond1= (BuySum>=3 OR SellSum >=3 ); //Filter=Cond1; txt=WriteIf(BuySum>=3,NumToStr(BuySum), WriteIf(SellSum>=3,NumToStr(SellSum)," ") ); /////////////////////////////////////////// /* txtBuy=""; AddColumn(impBuyCond1,"imp Buy",1); AddColumn(Cross(Close,DCEF),"nl Buy"); AddColumn(( SI>0 AND Ref(SI,-1)< 0.0 ),"SIBuy" ); //AddColumn( sign(ROC(SI,1)) != sign(ROC(Ref(SI,-1),1)) ,"ROC(SI)Buy" ); AddColumn((GMMAUP==1)&& (Ref(GMMAUP,-1)==0),"GMMABuy"); txtBuy= WriteIf(Cross(Close,DCEF)," nl ",""); txtBuy=txtBuy+ WriteIf(impBuyCond1," elder ",""); txtBuy= txtBuy+WriteIf(( SI>0 AND Ref(SI,-1)< 0.0 )," si ",""); txtBuy= txtBuy+WriteIf(sign(ROC(SI,1)) != sign(ROC(Ref(SI,-1),1))," roc(si) ",""); txtSell=""; AddColumn(impShortCond1,"imp Sell",1); AddColumn(Cross(DCEF,Close),"nl Sell" ); AddColumn(( SI<0 AND Ref(SI,-1)> 0.0 ),"SISell"); AddColumn( sign(ROC(SI,1)) != sign(ROC(Ref(SI,-1),1)) ,"ROC(SI)" ); AddColumn((GMMADOWN==1)&& (Ref(GMMADOWN,-1)==0),"GyyMMASell" ); txtSell= WriteIf(Cross(DCEF,Close)," nl ",""); txtSell=txtSell+ WriteIf(impShortCond1," elder ",""); txtSell=txtSell+ WriteIf(( SI<0 AND Ref(SI,-1)> 0.0 )," si ",""); txtSell=txtSell+ WriteIf(sign(ROC(SI,1)) != sign(ROC(Ref(SI,-1),1))," roc(si) ",""); Plot(BuySum,"nl",colorGreen,styleArea); Plot(SellSum,"nl",colorRed,styleArea); Title="buySum: "+BuySum+" SellSum: "+SellSum+ " buy-> "+txtBuy+ " Sell->"+txtSell; SetSortColumns( -2 ) ; */ /* AlertIf( Cond1, "SOUND C:\\Windows\\Media\\Notify.WAV", "NL "+txt , 0 ,1+2+8,5); */ /////////////////////////////////// /* FirstTradeTime = 091500; // Earliest time to take a trade LastTradeTime = 151500; // Latest time to take new trades ExitAllPositionsTime = 151500; change = Param("% change",0.6,0.1,25,0.1); z = Zig(Close, change); Buy=(BuyCond) AND (TimeNum() >= FirstTradeTime AND TimeNum() <= LastTradeTime ); Sell = IIf(z < Ref(z, -1), 1, 0) ;//OR TimeNum() > ExitAllPositionsTime; Short=(ShortCond) AND (TimeNum() >= FirstTradeTime AND TimeNum() <= LastTradeTime ); Cover = IIf(z > Ref(z, -1), 1, 0);// OR TimeNum() > ExitAllPositionsTime; Buy=ExRem(Buy,Sell); Sell=ExRem(Sell,Buy); Short=ExRem(Short,Cover); Cover=ExRem(Cover,Short); */ ///////////// ///////////////////////////////////// EMASlope=(LinRegSlope(EMA(Close,9),5 )); LEMASlope=(LinRegSlope(EMA(Close,35),5)); rEmaSlope=ROC( EMASlope,1,True); rLemaSlope=ROC( LEMASlope,1,True); /* 8 rEmaSlope<0 4 rEmaSlope>0 2 rEmaSlope < Ref(rEmaSlope,-1) 1 rEmaSlope > Ref(rEmaSlope,-1) 0 rEmaSlope= Ref(rEmaSlope,-1) */ Odd_num=-999; MA_ROC_slope_code=0; MA_ROC_slope_code+= IIf(rEmaSlope>0,4,0); MA_ROC_slope_code+= IIf(rEmaSlope<0,8,0); MA_ROC_slope_code+= IIf(rEmaSlope < Ref(rEmaSlope,-1),2,0); MA_ROC_slope_code+= IIf(rEmaSlope > Ref(rEmaSlope,-1),1,0); MA_ROC_slope_code+= IIf(rEmaSlope == Ref(rEmaSlope,-1),0,0); txt1=""; txt1+=WriteIf(rEmaSlope>0,"+",""); txt1+=WriteIf(rEmaSlope<0,"-",""); txt1+=WriteIf(rEmaSlope < Ref(rEmaSlope,-1),"<",""); txt1+=WriteIf(rEmaSlope > Ref(rEmaSlope,-1),">",""); txt1+=WriteIf(rEmaSlope == Ref(rEmaSlope,-1),"=",""); /* 4 rLemaSlope>0 2 rLemaSlope< Ref(rLemaSlope,-1) 1 rLemaSlope> Ref(rLemaSlope,-1) 0 rLemaSlope = Ref(rLemaSlope,-1) */ Odd_num=0; LEMA_ROC_slope_code=0; LEMA_ROC_slope_code+= IIf(rLemaSlope>0,4,Odd_num); LEMA_ROC_slope_code+= IIf(rLemaSlope<0,8,Odd_num); LEMA_ROC_slope_code+= IIf( rLemaSlope< Ref(rLemaSlope,-1),2,Odd_num); LEMA_ROC_slope_code+= IIf(rLemaSlope> Ref(rLemaSlope,-1),1,Odd_num); LEMA_ROC_slope_code+= IIf(rLemaSlope == Ref(rLemaSlope,-1),0,Odd_num); txt12=""; txt12+=WriteIf(rLemaSlope>0,"+",""); txt12+=WriteIf(rLemaSlope<0,"-",""); txt12+=WriteIf(rLemaSlope< Ref(rLemaSlope,-1),"<",""); txt12+=WriteIf(rLemaSlope> Ref(rLemaSlope,-1),">",""); txt12+=WriteIf(rLemaSlope== Ref(rLemaSlope,-1),"=",""); ///////////////////EMA LEMA Not ROC NOT ROC////////// EMASlope=(LinRegSlope(EMA(Close,9),5 )); LEMASlope=(LinRegSlope(EMA(Close,35),5)); up=EMASlope*1000000; down=LEMASlope*1000000; bar_kolup = IIf(up> Ref(up,-1), colorAqua, IIf( up< Ref(up,-1), colorGreen,colorGrey40) ); /* 8 rEmaSlope<0 4 rEmaSlope>0 2 rEmaSlope < Ref(rEmaSlope,-1) 1 rEmaSlope > Ref(rEmaSlope,-1) 0 rEmaSlope= Ref(rEmaSlope,-1) */ Odd_num=0; MA_slope_code=0; MA_slope_code+= IIf(up>0,4,Odd_num); MA_slope_code+= IIf(up<0,8,Odd_num); MA_slope_code+= IIf(up< Ref(up,-1),2,Odd_num); MA_slope_code+= IIf(up> Ref(up,-1),1,Odd_num); MA_slope_code+= IIf(up== Ref(up,-1),0,Odd_num); txt21=""; txt21+=WriteIf(up>0,"+",""); txt21+=WriteIf(up<0,"-",""); txt21+=WriteIf(up< Ref(up,-1),"<",""); txt21+=WriteIf(up> Ref(up,-1),">",""); txt21+=WriteIf(up== Ref(up,-1),"=",""); /* 4 rLemaSlope>0 2 rLemaSlope< Ref(rLemaSlope,-1) 1 rLemaSlope> Ref(rLemaSlope,-1) 0 rLemaSlope = Ref(rLemaSlope,-1) */ Odd_num=0; LEMA_slope_code=0; LEMA_slope_code+= IIf(down>0,4,Odd_num); LEMA_slope_code+= IIf(down<0,8,Odd_num); LEMA_slope_code+= IIf( down< Ref(down,-1),2,Odd_num); LEMA_slope_code+= IIf(down> Ref(down,-1),1,Odd_num); LEMA_slope_code+= IIf(down== Ref(down,-1),0,Odd_num); txt22=""; txt22+=WriteIf(down>0,"+",""); txt22+=WriteIf(down<0,"-",""); txt22+=WriteIf(down< Ref(down,-1),"<",""); txt22+=WriteIf(down> Ref(down,-1),">",""); txt22+=WriteIf(down== Ref(down,-1),"=",""); Dtrend = IIf( EMA(Close,9)<= EMA(Close,21),1,0); Utrend = IIf( EMA(Close,9)>= EMA(Close,21),1,0); Title=EncodeColor(colorAqua)+ " EMAslopeReg "+NumToStr(up)+ EncodeColor(colorRed)+ " LEMAslopeReg "+NumToStr(down) + " Dtrend "+ NumToStr(Dtrend) + " Utrend "+ NumToStr(Utrend ) +"\n"+ EncodeColor(colorGreen)+ " EMAslopeROC "+NumToStr(MA_ROC_slope_code)+"\n" + " LEMAslopeROC "+NumToStr(LEMA_ROC_slope_code)+"\n" + " EMARegret "+NumToStr(MA_slope_code)+"\n" + " LEMARegret "+NumToStr(LEMA_slope_code) + EncodeColor(colorGreen)+ " EMAslopeROC "+txt1 + " LEMAslopeROC "+txt12+"\n" + " EMARegret "+txt21 + " LEMARegret "+txt22+"\n" ; expLinearSlopeHS_txt=""; expLinearSlopeHS_txt=txt1+txt12+ txt21+txt22; em_code_sum="ema1 " +NumToStr(MA_ROC_slope_code) +"ema12 "+ NumToStr(LEMA_ROC_slope_code) +"ema21 "+ NumToStr(MA_slope_code) +"ema22 "+ NumToStr(LEMA_slope_code); //_TRACE("em_code_sum "+em_code_sum); //_TRACE("expLinearSlopeHS_txt "+expLinearSlopeHS_txt); //expLinearSlopeHS_Cond= IIf( expLinearSlopeHS_txt == "+>+>->->",1,0); //_TRACE("expLinearSlopeHS_Cond "+expLinearSlopeHS_Cond); //expLinearSlopeHS_Cond_num= IIf( em_code_sum == "+>+>->->",1,0); //_TRACE("expLinearSlopeHS_Cond "+expLinearSlopeHS_Cond); expLinearSlopeHS_Cond_num= (MA_ROC_slope_code==10 AND LEMA_ROC_slope_code==6) AND (MA_slope_code==6 AND LEMA_slope_code==5) ; expLinearSlopeHS_Cond_num_prev= ( Ref(MA_ROC_slope_code,-1) ==6 AND Ref(LEMA_ROC_slope_code,-1)==6 AND Ref(MA_slope_code,-1)==5 AND Ref(LEMA_slope_code,-1)==5 ) ; _TRACE("expLinearSlopeHS_Cond_num "+expLinearSlopeHS_Cond_num); _TRACE("expLinearSlopeHS_Cond_num_prev "+expLinearSlopeHS_Cond_num_prev); ///////////////////// /* c_txt=WriteIf(Close< Ref(Close,1),"BUY", WriteIf(Close> Ref(Close,1),"SELL", "NEUTRAL")); trend=WriteIf(EMA(C,9)>EMA(C,21),"uptrend", WriteIf(EMA(C,9)MDI() AND MACD()>Signal(); downtrend=MDI()>PDI() AND Signal()>MACD(); */ //////////////////////////////////////////// ///////////// ROC HL rocSI 1 rocSI12 search ////myindicators/unique_SI_roc_search_pure100_working.afl C1 = Ref ( C , -1 ) ; O1 = Ref ( O, -1 ) ; K = HHV ( ( H - C1 ) OR ( L - C1 ) , 1 ) ; L = C1 * 0.20; R = ATR ( 1 ); SI = ( ( C-C1+0.5*(C-O)+0.25*(C1-O1))/R)*(K/L); Close_cond= IIf(Close> Ref(Close,-1) ,1, IIf(Close< Ref(Close,-1),-1,0)); _TRACE("Close_cond "+Close_cond); SI_sign_cond=Null; SI_sign_cond1= IIf(( Ref(SI,-1)<0 AND SI>0) ,1,Null); //+1 SI_sign_cond2= IIf(( Ref(SI,-1)>0 AND SI<0 ),-1,Null ); //-1 SI_sign_cond3=IIf( (Ref(SI,-1)>0 AND SI>0) AND (SI>Ref(SI,-1)) ,3,Null); // ++ 3 SI_sign_cond4= IIf( Ref(SI,-1)>0 AND SI>0 AND SIRef(SI,-1),-2,Null ); //-+ -2 SI_sign_cond=IIf(SI_sign_cond1==1 ,1,IIf( SI_sign_cond2==-1 ,-1, IIf(SI_sign_cond3==3,3,IIf(SI_sign_cond4==2 ,2, IIf(SI_sign_cond5==-3,-3,IIf( SI_sign_cond6==-2 ,-2, Null)))))) ; _TRACE("SI_sign_cond "+SI_sign_cond); //280.27 176.42 -280.27 -176.42 191.41 224.72 //179.58 106.81 -179.58 -106.81 22773.83 rocsi1_cond= ( ROC(SI,1,True)>-100 AND ROC(SI,1,True)<-70); rocsi12_cond=( ROC(SI,12,True) >220 AND ROC(SI,12,True)<290); //_TRACE("rocsi1_cond "+rocsi1_cond); //_TRACE("rocsi12_cond "+rocsi12_cond); //-1120.61 -17.99 -1120.61 17.99 -1099.7 -112.54 //////////////abs rocsi1_cond_reflect= (ROC(SI,1) == ROC(SI,1,True)) AND ROC(SI,1,True)<0; rocsi12_cond_reflect= (ROC(SI,12) == -ROC(SI,12,True) ) AND ROC(SI,12,True)<0; /* rocsi1_cond_false= ( ROC(SI,1)>216 AND ROC(SI,1)<320 ); rocsi12_cond_false=( ROC(SI,12) >-70 AND ROC(SI,12)<-15 ); */ _TRACE("rocsi1_cond_reflect"+rocsi1_cond_reflect); _TRACE("rocsi12_cond_reflect"+rocsi12_cond_reflect); //////////////// diff -868.35 3634.9 rrsi1_cond=ROC(ROC(SI,1,True),1,True)>0 AND ( ROC(ROC(SI,1,True),1,True) >100 AND ROC(ROC(SI,1,True),1,True) < 360) ; rrsi12_cond= ROC(ROC(SI,12,True),1,True) > 0 AND(ROC(ROC(SI,12,True),1,True) >500 AND ROC(ROC(SI,12,True),1,True)<900 ); //-1120.61 -17.99 -1120.61 17.99 -1099.7 -112.54 //HL sign HL_sign=0; HL_sign=IIf( ROC(SI,1,True) < ROC(SI,12,True),1,-1) ; //LH 1 HL_sign_abs=0; HL_sign_abs= IIf(ROC(SI,1) < ROC(SI,12),1,-1) ; //LH //HL No sign HL_nosign=0; HL_nosign_abs=0; HL_nosign=IIf( abs(ROC(SI,1,True) ) > abs(ROC(SI,12,True)) ,1,-1) ; //HH HL_nosign_abs= IIf( abs(ROC(SI,1)) > abs(ROC(SI,12)) ,1,-1) ; //HH _TRACE("HL num "+HL_sign+HL_sign_abs+HL_nosign+HL_nosign_abs); HL_txt=HL_sign+HL_sign_abs+HL_nosign+HL_nosign_abs; _TRACE("HL_txt "+HL_txt); ROC_HL_cond= (Close_cond==-1) AND (SI_sign_cond == -1 ) AND // rocsi1_cond AND rocsi12_cond //diff // AND rrsi1_cond AND rrsi12_cond rocsi1_cond_reflect AND rocsi12_cond_reflect AND HL_sign ==1 AND HL_sign_abs==1 AND HL_nosign==1 AND HL_nosign_abs==1 ; _TRACE("ROC_HL_cond "+ROC_HL_cond); /////////////// PAST PAST//////////////////// // past //-93.41 143.51 -93.41 -143.51 -67.79 -40.75 rocsi1_cond_reflect_past= ( Ref(ROC(SI,1) ,-1) == Ref( ROC(SI,1,True), -1) ) AND Ref( ROC(SI,1,True), -1)<0 AND Ref( ROC(SI,12,True), -1)>0 ; rocsi12_cond_reflect_past= ( Ref( ROC(SI,12) ,-1) == -Ref( ROC(SI,12,True) ,-1) ) ; //HL sign HL_sign=0; HL_sign=IIf( Ref( ROC(SI,1,True), -1) < Ref( ROC(SI,12,True) ,-1) ,1,-1) ; //LH 1 HL_sign_abs=0; HL_sign_abs= IIf( Ref(ROC(SI,1) ,-1) > Ref( ROC(SI,12) ,-1) ,1,-1) ; //LH //HL No sign HL_nosign=0; HL_nosign_abs=0; HL_nosign=IIf( Ref(abs(ROC(SI,1,True)),-1) < Ref(abs(ROC(SI,12,True)),-1) ,1,-1) ; //HH HL_nosign_abs= IIf( Ref(abs(ROC(SI,1)),-1) < Ref(abs(ROC(SI,12)),-1) ,1,-1) ; //HH /* ROC_HL_plain= ( Ref(HL_sign,-1) ==-1 AND Ref(HL_sign_abs,-1)==-1 AND Ref(HL_nosign,-1)==-1 AND Ref(HL_nosign_abs,-1)==-1 ); */ ROC_HL_plain= ( HL_sign ==1 AND HL_sign_abs==1 AND HL_nosign==1 AND HL_nosign_abs==1) ; _TRACE(" Ref(HL_sign,-1) "+HL_sign); _TRACE(" Ref(HL_sign_abs,-1) "+HL_sign_abs); _TRACE(" ROC_HL_plain "+ROC_HL_plain); _TRACE(" rocsi1_cond_reflect_past "+rocsi1_cond_reflect_past); _TRACE(" rocsi12_cond_reflect_past "+rocsi12_cond_reflect_past); ROC_HL_plain_past= (ROC_HL_plain) AND ( rocsi1_cond_reflect_past AND rocsi12_cond_reflect_past) ; _TRACE(" ROC_HL_plain_past "+ROC_HL_plain_past); Filter_pastDay= expLinearSlopeHS_Cond_num_prev AND ROC_HL_plain_past ; _TRACE("Filter_pastDay "+Filter_pastDay); /////////////////////garden rose//////// filter_buy=( (BuySum>=3 ) AND Ref(Close,3)>Close ) ; filter_sell= ( (SellSum>=3 ) AND Ref(Close,3)=O; blackBody=O>C; /*Body Size*/ smallBodyMaximum=0.0025;//less than 0.25% LargeBodyMinimum=0.01;//greater than 1.0% smallBody=(O>=C*(1-smallBodyMaximum) AND whiteBody) OR (C>=O*(1-smallBodyMaximum) AND blackBody); largeBody=(C>=O*(1+largeBodyMinimum) AND whiteBody) OR C<=O*(1-largeBodyMinimum) AND blackBody; mediumBody=NOT LargeBody AND NOT smallBody; identicalBodies=abs(abs(Ref(O,-1)-Ref(C,-1))-abs(O-C)) < abs(O-C)*smallBodyMaximum; realBodySize=abs(O-C); /*Shadows*/ smallUpperShadow=(whiteBody AND H<=C*(1+smallBodyMaximum)) OR (blackBody AND H<=O*(1+smallBodyMaximum)); smallLowerShadow=(whiteBody AND L>=O*(1-smallBodyMaximum)) OR (blackBody AND L>=C*(1-smallBodyMaximum)); largeUpperShadow=(whiteBody AND H>=C*(1+largeBodyMinimum)) OR (blackBody AND H>=O*(1+largeBodyMinimum)); largeLowerShadow=(whiteBody AND L<=O*(1-largeBodyMinimum)) OR (blackBody AND L<=C*(1-largeBodyMinimum)); /*Gaps*/ upGap= IIf(Ref(blackBody,-1)AND whiteBody AND O>Ref(O,-1),1, IIf(Ref(blackbody,-1) AND blackBody AND C>Ref(O,-1),1, IIf(Ref(whiteBody,-1) AND whiteBody AND O>Ref(C,-1),1, IIf(Ref(whiteBody,-1) AND blackBody AND C>Ref(C,-1),1,0)))); downGap=IIf(Ref(blackBody,-1)AND whiteBody AND CC); LongBlackCandle = (O>C AND (O-C)/(0.001+H-L)>0.6); SmallBlackCandle = ((O>C) AND ((H-L)>(3*(O-C)))); WhiteCandle = (C>O); LongWhiteCandle = ((C>O) AND ((C-O)/(0.001+H-L)>0.6)); SmallWhiteCandle = ((C>O) AND ((H-L)>(3*(C-O)))); BlackMaubozu = (O>C AND H==O AND C==L); WhiteMaubozu = (C>O AND H==C AND O==L); BlackClosingMarubozu = (O>C AND C==L); WhiteClosingMarubozu = (C>O AND C==H); BlackOpeningMarubozu = (O>C AND O==H); WhiteOpeningMarubozu = (C>O AND O==L); HangingMan = (((H-L)>4*(O-C)) AND ((C-L)/(0.001+H-L)>= 0.75) AND ((O-L)/(0.001+H-L)>= 0.75)); Hammer = (((H-L)>3*(O-C)) AND ((C-L)/(0.001+H-L)>0.6) AND ((O-L)/(0.001+H-L)>0.6)); InvertedHammer = (((H-L)>3*(O-C)) AND ((H-C)/(0.001+H-L)>0.6) AND ((H-O)/(0.001+H-L)>0.6)); ShootingStar = (((H-L)>4*(O-C)) AND ((H-C)/(0.001+H-L)>= 0.75) AND ((H-O)/(0.001+H-L)>= 0.75)); BlackSpinningTop = ((O>C) AND ((H-L)>(3*(O-C))) AND (((H-O)/(0.001+H-L))<0.4) AND (((C-L)/(0.001+H-L))<0.4)); WhiteSpinningTop = ((C>O) AND ((H-L)>(3*(C-O))) AND (((H-C)/(0.001+H-L))<0.4) AND (((O-L)/(0.001+H-L))<0.4)); BearishAbandonedBaby = ((C1 == O1) AND (C2>O2) AND (O>C) AND (L1>H2) AND (L1>H)); BearishEveningDojiStar = ((C2>O2) AND ((C2-O2)/(0.001+H2-L2)>0.6) AND (C2O1) AND ((H1-L1)>(3*(C1-O1))) AND (O>C) AND (OO1 AND ((C1+O1)/2)>C AND O>C AND O>C1 AND C>O1 AND (O-C)/(0.001+(H-L)>0.6)); BearishEngulfing = ((C1>O1) AND (O>C) AND (O>= C1) AND (O1>= C) AND ((O-C)>(C1-O1))); ThreeOutsideDownPattern = ((C2>O2) AND (O1>C1) AND (O1>= C2) AND (O2>= C1) AND ((O1-C1)>(C2-O2)) AND (O>C) AND (CC2) AND (C>O) AND (L2>H1) AND (L>H1)); BullishMorningDojiStar = ((O2>C2) AND ((O2-C2)/(0.001+H2-L2)>0.6) AND (C2>O1) AND (O1>C1) AND ((H1-L1)>(3*(C1-O1))) AND (C>O) AND (O>O1)); BullishEngulfing = ((O1>C1) AND (C>O) AND (C>= O1) AND (C1>= O) AND ((C-O)>(O1-C1))); ThreeOutsideUpPattern = ((O2>C2) AND (C1>O1) AND (C1>= O2) AND (C2>= O1) AND ((C1-O1)>(O2-C2)) AND (C>O) AND (C>C1)); BullishHarami = ((O1>C1) AND (C>O) AND (C<= O1) AND (C1<= O) AND ((C-O)<(O1-C1))); ThreeInsideUpPattern = ((O2>C2) AND (C1>O1) AND (C1<= O2) AND (C2<= O1) AND ((C1-O1)<(O2-C2)) AND (C>O) AND (C>C1) AND (O>O1)); PiercingLine = ((C10.6)); BearishHarami = ((C1>O1) AND (O>C) AND (O<= C1) AND (O1<= C) AND ((O-C)<(C1-O1))); ThreeInsideDownPattern = ((C2>O2) AND (O1>C1) AND (O1<= C2) AND (O2<= C1) AND ((O1-C1)<(C2-O2)) AND (O>C) AND (CO*1.01) AND (C1>O1*1.01) AND (C2>O2*1.01) AND (C>C1) AND (C1>C2) AND (OO1) AND (O1O2) AND (((H-C)/(H-L))<0.2) AND (((H1-C1)/(H1-L1))<0.2) AND (((H2-C2)/(H2-L2))<0.2); DarkCloudCover = (C1>O1*1.01) AND (O>C) AND (O>H1) AND (C>O1) AND (((C1+O1)/2)>C) AND (C>O1) AND (MA(C,13)-Ref(MA(C,13),-4)>0); ThreeBlackCrows = (O>C*1.01) AND (O1>C1*1.01) AND (O2>C2*1.01) AND (CC1) AND (OC2) AND (O1Ref(C,-2) AND MLY; Doji = (O == C); MATCHLOW = LLV(Low,8)==LLV(Low,2) AND Ref(Close,-1)<=Ref(Open,-1)*.99 AND abs(Close-Ref(Close,-1))<=Close*.0025 AND Open>Ref(Close,-1) AND Open<=(High-((High-Low)*.5)); GapUpx = GapUp(); GapDownx = GapDown(); BigGapUp = L>1.01*H1; BigGapDown = H<0.99*L1; HugeGapUp = L>1.02*H1; HugeGapDown = H<0.98*L1; DoubleGapUp = GapUp() AND Ref(GapUp(),-1); DoubleGapDown = GapDown() AND Ref(GapDown(),-1); txt2=""; txt2+=WriteIf(BlackCandle ,"BlackCandle ",""); txt2+=WriteIf(LongBlackCandle ,"LongBlackCandle ",""); txt2+=WriteIf(SmallBlackCandle ,"SmallBlackCandle ",""); txt2+=WriteIf(WhiteCandle ,"WhiteCandle ",""); txt2+=WriteIf(LongWhiteCandle ,"LongWhiteCandle ",""); txt2+=WriteIf(SmallWhiteCandle ,"SmallWhiteCandle ",""); txt2+=WriteIf(BlackMaubozu ,"BlackMaubozu ",""); txt2+=WriteIf(WhiteMaubozu ,"WhiteMaubozu ",""); txt2+=WriteIf(BlackClosingMarubozu ,"BlackClosingMarubozu ",""); txt2+=WriteIf(WhiteClosingMarubozu ,"WhiteClosingMarubozu ",""); txt2+=WriteIf(BlackOpeningMarubozu ,"BlackOpeningMarubozu ",""); txt2+=WriteIf(WhiteOpeningMarubozu ,"WhiteOpeningMarubozu ",""); txt2+=WriteIf(BlackMaubozu ,"BlackMaubozu ",""); txt2+=WriteIf(BearishHarami ,"BearishHarami ",""); txt2+=WriteIf(eveningStar ,"eveningStar ",""); txt2+=WriteIf(Hammer ,"Hammer ",""); txt2+=WriteIf(InvertedHammer ,"InvertedHammer ",""); txt2+=WriteIf(PiercingLine ,"PiercingLine ",""); txt2+=WriteIf(BullishEngulfing ,"BullishEngulfing ",""); txt2+=WriteIf(BearishEngulfing ,"BearishEngulfing ",""); txt2+=WriteIf(BullishHarami ,"BullishHarami ",""); txt2+=WriteIf(BearishHarami ,"BearishHarami ",""); txt2+=WriteIf(morningStar ,"morningStar ",""); txt2+=WriteIf(NearDoji ,"NearDoji ",""); txt2+=WriteIf(Doji ,"Doji ",""); txt2+=WriteIf(DarkCloudCover ,"DarkCloudCover ",""); txt2+=WriteIf(invertedHammer ,"invertedHammer ",""); txt2+=WriteIf(Hammer ,"Hammer ",""); txt2+=WriteIf(shootingStar ,"shootingStar ",""); txt2+=WriteIf(invertedHammer ,"invertedHammer ",""); txt2+=WriteIf(eveningStar ,"eveningStar ",""); txt2+=WriteIf(darkCloudCover,"darkCloudCover ",""); txt2+=WriteIf(smallUpperShadow,"smallUpperShadow ",""); txt2+=WriteIf(smallLowerShadow,"smallLowerShadow ",""); txt2+=WriteIf(largeUpperShadow ,"largeUpperShadow ",""); txt2+=WriteIf(largeLowerShadow,"largeLowerShadow ",""); txt2+=WriteIf(upGap,"upGap ",""); txt2+=WriteIf(downGap,"downGap ",""); txt2+=WriteIf(morningStar,"morningStar ",""); txt2+=WriteIf(piercingLine,"piercingLine ",""); txt2+=WriteIf(threeWhiteSoldiers,"threeWhiteSoldiers ",""); txt2+=WriteIf(darkCloudCover,"darkCloudCover ",""); txt2+=WriteIf(eveningStar,"eveningStar ",""); /*Tweezer Top*/ TweezerTop=abs(H-Ref(H,-1))<=H*0.0025 AND O >C AND (Ref(C,-1) > Ref(O,-1))AND (MHT OR MHY); /*Tweezer Bottom*/ tweezerBottom= (abs(L-Ref(L,-1))/L<0.0025 OR abs(L-Ref(L,-2))/L<0.0025) AND O < C AND (Ref( O,-1) > Ref(C,-1)) AND (MLT OR MLY); PATTERN = WriteIf(tweezerTop, "Tweezer Top", WriteIf(tweezerBottom, "Tweezer Bottom","Zilch" )); //Filter = tweezerTop OR tweezerBottom; /*Body Colors*/ whiteBody=C>=O; blackBody=O>C; /*Body Size*/ smallBodyMaximum=0.0025;//less than 0.25% LargeBodyMinimum=0.01;//greater than 1.0% smallBody=(O>=C*(1-smallBodyMaximum) AND whiteBody) OR (C>=O*(1-smallBodyMaximum) AND blackBody); largeBody=(C>=O*(1+largeBodyMinimum) AND whiteBody) OR C<=O*(1-largeBodyMinimum) AND blackBody; mediumBody=NOT LargeBody AND NOT smallBody; identicalBodies=abs(abs(Ref(O,-1)-Ref(C,-1))-abs(O-C)) < abs(O-C)*smallBodyMaximum; realBodySize=abs(O-C); /*Shadows*/ smallUpperShadow=(whiteBody AND H<=C*(1+smallBodyMaximum)) OR (blackBody AND H<=O*(1+smallBodyMaximum)); smallLowerShadow=(whiteBody AND L>=O*(1-smallBodyMaximum)) OR (blackBody AND L>=C*(1-smallBodyMaximum)); largeUpperShadow=(whiteBody AND H>=C*(1+largeBodyMinimum)) OR (blackBody AND H>=O*(1+largeBodyMinimum)); largeLowerShadow=(whiteBody AND L<=O*(1-largeBodyMinimum)) OR (blackBody AND L<=C*(1-largeBodyMinimum)); /*Gaps*/ upGap= IIf(Ref(blackBody,-1)AND whiteBody AND O>Ref(O,-1),1, IIf(Ref(blackbody,-1) AND blackBody AND C>Ref(O,-1),1, IIf(Ref(whiteBody,-1) AND whiteBody AND O>Ref(C,-1),1, IIf(Ref(whiteBody,-1) AND blackBody AND C>Ref(C,-1),1,0)))); downGap=IIf(Ref(blackBody,-1)AND whiteBody AND CC); LongBlackCandle = (O>C AND (O-C)/(0.001+H-L)>0.6); SmallBlackCandle = ((O>C) AND ((H-L)>(3*(O-C)))); WhiteCandle = (C>O); LongWhiteCandle = ((C>O) AND ((C-O)/(0.001+H-L)>0.6)); SmallWhiteCandle = ((C>O) AND ((H-L)>(3*(C-O)))); BlackMaubozu = (O>C AND H==O AND C==L); WhiteMaubozu = (C>O AND H==C AND O==L); BlackClosingMarubozu = (O>C AND C==L); WhiteClosingMarubozu = (C>O AND C==H); BlackOpeningMarubozu = (O>C AND O==H); WhiteOpeningMarubozu = (C>O AND O==L); HangingMan = (((H-L)>4*(O-C)) AND ((C-L)/(0.001+H-L)>= 0.75) AND ((O-L)/(0.001+H-L)>= 0.75)); Hammer = (((H-L)>3*(O-C)) AND ((C-L)/(0.001+H-L)>0.6) AND ((O-L)/(0.001+H-L)>0.6)); InvertedHammer = (((H-L)>3*(O-C)) AND ((H-C)/(0.001+H-L)>0.6) AND ((H-O)/(0.001+H-L)>0.6)); ShootingStar = (((H-L)>4*(O-C)) AND ((H-C)/(0.001+H-L)>= 0.75) AND ((H-O)/(0.001+H-L)>= 0.75)); BlackSpinningTop = ((O>C) AND ((H-L)>(3*(O-C))) AND (((H-O)/(0.001+H-L))<0.4) AND (((C-L)/(0.001+H-L))<0.4)); WhiteSpinningTop = ((C>O) AND ((H-L)>(3*(C-O))) AND (((H-C)/(0.001+H-L))<0.4) AND (((O-L)/(0.001+H-L))<0.4)); BearishAbandonedBaby = ((C1 == O1) AND (C2>O2) AND (O>C) AND (L1>H2) AND (L1>H)); BearishEveningDojiStar = ((C2>O2) AND ((C2-O2)/(0.001+H2-L2)>0.6) AND (C2O1) AND ((H1-L1)>(3*(C1-O1))) AND (O>C) AND (OO1 AND ((C1+O1)/2)>C AND O>C AND O>C1 AND C>O1 AND (O-C)/(0.001+(H-L)>0.6)); BearishEngulfing = ((C1>O1) AND (O>C) AND (O>= C1) AND (O1>= C) AND ((O-C)>(C1-O1))); ThreeOutsideDownPattern = ((C2>O2) AND (O1>C1) AND (O1>= C2) AND (O2>= C1) AND ((O1-C1)>(C2-O2)) AND (O>C) AND (CC2) AND (C>O) AND (L2>H1) AND (L>H1)); BullishMorningDojiStar = ((O2>C2) AND ((O2-C2)/(0.001+H2-L2)>0.6) AND (C2>O1) AND (O1>C1) AND ((H1-L1)>(3*(C1-O1))) AND (C>O) AND (O>O1)); BullishEngulfing = ((O1>C1) AND (C>O) AND (C>= O1) AND (C1>= O) AND ((C-O)>(O1-C1))); ThreeOutsideUpPattern = ((O2>C2) AND (C1>O1) AND (C1>= O2) AND (C2>= O1) AND ((C1-O1)>(O2-C2)) AND (C>O) AND (C>C1)); BullishHarami = ((O1>C1) AND (C>O) AND (C<= O1) AND (C1<= O) AND ((C-O)<(O1-C1))); ThreeInsideUpPattern = ((O2>C2) AND (C1>O1) AND (C1<= O2) AND (C2<= O1) AND ((C1-O1)<(O2-C2)) AND (C>O) AND (C>C1) AND (O>O1)); PiercingLine = ((C10.6)); BearishHarami = ((C1>O1) AND (O>C) AND (O<= C1) AND (O1<= C) AND ((O-C)<(C1-O1))); ThreeInsideDownPattern = ((C2>O2) AND (O1>C1) AND (O1<= C2) AND (O2<= C1) AND ((O1-C1)<(C2-O2)) AND (O>C) AND (CO*1.01) AND (C1>O1*1.01) AND (C2>O2*1.01) AND (C>C1) AND (C1>C2) AND (OO1) AND (O1O2) AND (((H-C)/(H-L))<0.2) AND (((H1-C1)/(H1-L1))<0.2) AND (((H2-C2)/(H2-L2))<0.2); DarkCloudCover = (C1>O1*1.01) AND (O>C) AND (O>H1) AND (C>O1) AND (((C1+O1)/2)>C) AND (C>O1) AND (MA(C,13)-Ref(MA(C,13),-4)>0); ThreeBlackCrows = (O>C*1.01) AND (O1>C1*1.01) AND (O2>C2*1.01) AND (CC1) AND (OC2) AND (O1Ref(C,-2) AND MLY; Doji = (O == C); MATCHLOW = LLV(Low,8)==LLV(Low,2) AND Ref(Close,-1)<=Ref(Open,-1)*.99 AND abs(Close-Ref(Close,-1))<=Close*.0025 AND Open>Ref(Close,-1) AND Open<=(High-((High-Low)*.5)); GapUpx = GapUp(); GapDownx = GapDown(); BigGapUp = L>1.01*H1; BigGapDown = H<0.99*L1; HugeGapUp = L>1.02*H1; HugeGapDown = H<0.98*L1; DoubleGapUp = GapUp() AND Ref(GapUp(),-1); DoubleGapDown = GapDown() AND Ref(GapDown(),-1); /*Tweezer Top*/ TweezerTop=abs(H-Ref(H,-1))<=H*0.0025 AND O >C AND (Ref(C,-1) > Ref(O,-1)); /*Tweezer Bottom*/ tweezerBottom= (abs(L-Ref(L,-1))/L<0.0025 OR abs(L-Ref(L,-2))/L<0.0025) AND O < C AND (Ref( O,-1) > Ref(C,-1)); PATTERN = WriteIf(tweezerTop, "Tweezer Top", WriteIf(tweezerBottom, "Tweezer Bottom","Zilch" )); ///Filter = tweezerTop OR tweezerBottom; //AddTextColumn(PATTERN, "Tweezer Pattern", 5.6, colorWhite, IIf(TweezerTop, colorRed, //IIf(TweezerBottom, colorGreen, colorLightGrey))); //AddTextColumn(C_Status, "Candle Pattern", 5.6, colorWhite, IIf(HangingMan OR ShootingStar OR DarkCloudCover OR BearishEngulfing OR BearishHarami OR eveningStar, colorRed, //IIf(Hammer OR InvertedHammer OR PiercingLine OR BullishEngulfing OR BullishHarami OR morningStar OR MATCHLOW, colorGreen, IIf( NearDoji OR Doji, colorBlue, colorLightGrey)))); /************************************************** ***** Candlestick Commentary Load this file into the Commentary Option of the Analysis tab. Green arrows indicate bullish candles. Red arrows indicate bearish candles. Scroll down the commentary for comments. This is a work in progress. Thanks to all on this forum whose code I may have incorporated into this file. Comments are from Steve Nison "Japanese Candlestick Charting Techniques" and the LitWick web site. ************************************************** ********/ /*Body Colors*/ whiteBody=C>=O; blackBody=O>C; /*Body Size*/ smallBodyMaximum=0.0025;//less than 0.25% LargeBodyMinimum=0.01;//greater than 1.0% smallBody=(O>=C*(1-smallBodyMaximum) AND whiteBody) OR (C>=O*(1-smallBodyMaximum) AND blackBody); largeBody=(C>=O*(1+largeBodyMinimum) AND whiteBody) OR C<=O*(1-largeBodyMinimum) AND blackBody; mediumBody=NOT LargeBody AND NOT smallBody; identicalBodies=abs(abs(Ref(O,-1)-Ref(C,-1))-abs(O-C)) < abs(O-C)*smallBodyMaximum; realBodySize=abs(O-C); /*Shadows*/ smallUpperShadow=(whiteBody AND H<=C*(1+smallBodyMaximum)) OR (blackBody AND H<=O*(1+smallBodyMaximum)); smallLowerShadow=(whiteBody AND L>=O*(1-smallBodyMaximum)) OR (blackBody AND L>=C*(1-smallBodyMaximum)); largeUpperShadow=(whiteBody AND H>=C*(1+largeBodyMinimum)) OR (blackBody AND H>=O*(1+largeBodyMinimum)); largeLowerShadow=(whiteBody AND L<=O*(1-largeBodyMinimum)) OR (blackBody AND L<=C*(1-largeBodyMinimum)); /*Gaps*/ upGap= IIf(Ref(blackBody,-1)AND whiteBody AND O>Ref(O,-1),1, IIf(Ref(blackbody,-1) AND blackBody AND C>Ref(O,-1),1, IIf(Ref(whiteBody,-1) AND whiteBody AND O>Ref(C,-1),1, IIf(Ref(whiteBody,-1) AND blackBody AND C>Ref(C,-1),1,0)))); downGap=IIf(Ref(blackBody,-1)AND whiteBody AND C2*realBodySize) OR (whiteBody AND abs(H-C)>2*realBodySize)); Hammer=smallUpperShadow AND NOT doji AND ((blackBody AND abs(C-L)>2*realBodySize) OR (whiteBody AND abs(L-O)>2*realBodySize)); tweezerTop=abs(H-Ref(H,-1))<=H*0.0025; tweezerBottom=abs(L-Ref(L,-1))<=L*0.0025; engulfing= IIf(blackBody AND Ref(blackbody,-1) AND CRef(O,-1),1, IIf(blackBody AND Ref(whiteBody,-1) AND O>Ref(C,-1) AND CRef(C,-1) AND ORef(O,-1)AND ORef(C,-1),1, IIf(blackBody AND Ref(whiteBody,-1) AND C>Ref(O,-1) AND ORef(O,-1),1, IIf(whiteBody AND Ref(blackBody,-1) AND O>Ref(C,-1) AND CRef(O, -3) AND CRef(C,-2)AND Ref(blackbody,-1)AND blackBody AND engulfing; /*Doji Star Bullish*/ dojiStarBullish=(dojiStar AND (MLT OR MLY))OR (doji AND (C=Ref( C, -1) AND CRef(C,-1)*0.9975 AND C< Ref(C,-1)*1.0025; /*Morning Doji Star*/ morningDojiStar= Ref(LargeBody,-2) AND Ref(blackBody,-2) AND Ref(doji,-1) AND Ref(O,-1)Ref(C,-2) AND MLY; /* Morning Star*/ morningStar =Ref(largeBody,-2) AND Ref(blackBody,-2)//Large black candle AND Ref(downGap,-1)//Gap down yesterday AND whiteBody AND LargeBody AND C>Ref(C,-2)//Large white candle today AND MLY; //Yesterday was the low /* Piercing Line*/ piercingLine= Ref(largeBody,-1) AND Ref(blackBody,-1)AND O=(Ref(O,-1)+Ref(C,-1))/2 AND C=Ref(C,-2) AND O>=Ref(C,-1) AND abs(C-Ref(C,-2))<=C*0.0025; /*Three Inside Up harami confirming*/ threeInsideUp =Ref(Haramibullish,-1) AND whiteBody AND largeBody AND C>Ref(C,-1); /* Three Outside Up Engulfing confirmation*/ threeOutsideUp =Ref(engulfingBullish,-1) AND whiteBody AND C>Ref(C,-1); /* Three Stars in the South*///Rewrite??? threeStarsInTheSouth= Ref(LargeBody,-2) AND Ref(blackBody,-2) AND Ref(largelowerShadow,-2) AND Ref(blackBody,-1) AND Ref(largeLowerShadow,-1) AND Ref(L,-1)>Ref(L,-2) AND blackBody AND smallUpperShadow AND smallLowerShadow AND L>Ref(L,-1) AND HRef(C,-2) AND whiteBody AND CRef(O,-4) AND NOT Ref(LargeBody,-1) AND Ref(C,-1)Ref(C,-4); /*RisingThreeMethods*/ risingThreeMethods=Ref(LargeBody,-4) AND Ref(whiteBody,-4) AND NOT Ref(LargeBody,-3) AND NOT Ref(LargeBody,-2)AND NOT Ref(LargeBody,-1) AND Ref(C,-3)Ref(C,-4); /* Seperating Lines Bullish*/ separatingLinesBullish=Ref(blackBody,-1) AND whiteBody AND LargeBody AND smallLowerShadow AND MHT AND abs(O-Ref(O,-1))<=O*0.0025; /*Side by Side White Lines*/ sideBySideWhiteLines=NOT Ref(smallBody,-2) AND Ref(whiteBody,-2) AND Ref(upGap,-1) AND Ref(whitebody,-1)AND whiteBody AND identicalBodies AND abs(O-Ref(O,-1))Ref(C,-1) AND Ref(C,-1)>Ref(C,-2) AND Ref(O,-1)>Ref(O,-2) AND Ref(O,-1)Ref(O,-1) AND Ref(smallUpperShadow,-2) AND Ref(smallUpperShadow,-1) AND smallUppershadow AND LLV(L,12)==Ref(L,-2); /*Upside Gap Three Methods not very good*/ upsideGapThreeMethods=Ref(Largebody,-2) AND Ref(whiteBody,-2) AND Ref(LargeBody,-1) AND Ref(whiteBody,-1) AND Ref(upGap,-1) AND blackBody AND O>Ref(O,-1) AND CRef(O,-2) AND MHY; /*Three Line Strike not good signals*/ threeLineStrike=NOT Ref(smallBody,-3) AND NOT Ref(smallBody,-2) AND NOT Ref(smallBody,-1) AND Ref(whiteBody,-3) AND Ref(whiteBody,-2) AND Ref(whiteBody,-1) AND Ref(C,-1)>Ref(C,-2) AND Ref(C,-2)>Ref(C,-3) AND blackBody AND O>Ref(C,-1) AND C Ref(C,-1)); /*Upside Tasuki Gap*/ upsideTasukiGap=Ref(largeBody,-2) AND Ref(largeBody,1) AND Ref(whiteBody,-2) AND Ref(whiteBody,-1) AND Ref(upGap,-1) AND blackBody AND O>Ref(O,-1) AND CRef(C,-2) AND identicalBodies AND ORef(O,-2) AND Ref(O,-1)Ref(C,-2) AND C>Ref(C,-1) AND ORef(O,-1) AND Ref(LargeUpperShadow,-1) AND LargeUpperShadow AND C-ORef(O,-3) AND CRef(H,-1) AND C>Ref(O,-1) AND C<(Ref(O,-1)+Ref(C,-1))/2 AND MHT; /*Deliberation Bearish: needs confirmation*/ deliberationBearish=Ref(LargeBody,-2) AND Ref(whiteBody,-2) AND Ref(LargeBody,-1) AND Ref(whiteBody,-1) AND Ref(C,-1)>Ref(C,-2) AND smallbody AND upGap; /*CounterAttackBearish*/ CounterAttackBearish=MHT AND LargeBody AND blackbody AND Ref(largeBody,-1) AND Ref(whiteBody,-1) AND CRef(C,-1)*0.9975;; /*Doji Star Bearish*/ dojiStarBearish=(dojiStar AND (MHT OR MHY))OR (doji AND (C>Ref(C,-1) OR O>Ref(C,-1))AND Ref(whiteBody,-1) AND Ref(LargeBody,-1)); /*Engulfing Bearish*/ engulfingBearish=engulfing AND largeBody AND blackBody AND (Ref(whitebody,-1) OR Ref(Doji,-1))AND (MHT OR MHY); /*Evening Doji Star check formula???*/ eveningDojiStar=Ref(LargeBody,-2) AND Ref(whiteBody,-2) AND Ref(dojiStar,-1) AND Ref(GapUp(),-1) AND (MHY OR MHT); /*Evening Star*/ eveningStar=Ref(LargeBody,-2) AND Ref(whiteBody,-2) AND Ref(upGap,-1) AND NOT Ref(largeBody,-1) AND blackBody AND NOT smallBody AND (MHT OR MHY); /*Hammer Bearish*/ HammerBearish=Hammer AND HHV(H,8)==H; /*hangingMan*/ HangingMan=NOT largeBody AND smallUpperShadow AND LargeLowerShadow AND MHT; /*dragonfly Doji Bearish*/ dragonflyDojiBearish=doji AND smallUpperShadow AND LargeLowerShadow AND MHT; /*Harami Bearish-*/ HaramiBearish=harami AND Ref(Largebody,-1) AND Ref(whiteBody,-1)AND blackBody AND (MHY OR MHT); /*HaramiCross Bearish*/ HaramiCrossBearish=harami AND doji AND Ref(whiteBody,-1) AND Ref(Largebody,-1); /*Identical three black crows*/ idendicalThreeBlackCrows=Ref(blackBody,-2) AND Ref(blackBody,-1) AND blackBody AND abs(Ref(C,-2)-Ref(O,-1))Ref(C,-1)AND CRef(O,-2) AND MHY;//Third day /*Upside Gap Two Crows*/ upsideGapTwoCrows= Ref(whiteBody,-2) AND Ref(LargeBody,-2)// first day AND Ref(upGap,-1) AND Ref(blackBody,-1) // 2nd day AND blackbody AND O>Ref(O,-1) AND CRef(C,-2); /*Doji Star Bearish needs confirmation dojiStarBearish=Ref(LargeBody,-1) AND Ref(whiteBody,-1) // first day AND doji AND upGap AND MHT;*/ /* Downside Gap Three Methods*/ downsideGapThreeMethods= Ref(LargeBody,-2) AND Ref(blackBody,-2) AND Ref(downGap,-2) //first day AND Ref(LargeBody,-1) AND Ref(blackBody,-1)//2nd day AND whitebody AND ORef(C,-2) AND LLV(L,8)==Ref(L,-1); /*Downside Tasuki Gap*/ downsideTasukiGap= Ref(blackBody,-2)//first day AND Ref(blackbody,-1) AND Ref(downgap,-1) //2nd day AND whiteBody AND ORef(C,-1) AND C>Ref(O,-1) AND CRef(C,-2) AND Ref(C,-2)>Ref(C,-3) AND LargeBody AND blackBody AND O>Ref(C,-4) AND O=Ref(C,-1); /*On Neck Bearish not good*/ OnNeckBearish=Ref(LargeBody,-1) AND Ref(blackBody,-1) AND whiteBody AND O=Ref(L,-1)*0.9975; /*separating Lines Bearish*/ separatingLinesBearish=Ref(LargeBody,-1) AND Ref(whiteBody,-1) AND blackBody AND O>Ref(O,-1)*0.9975 AND O<=Ref(O,-1)*1.0025; /*Side By Side White Lines Bearish*/ sideBySideWhiteLinesBearish=NOT Ref(smallBody,-2) AND Ref(blackBody,-2) AND Ref(whiteBody,-1) AND whiteBody AND Ref(downGap,-1) AND identicalBodies AND abs(C-Ref(C,-1)Ref(O,-3); /*Thrusting Bearish*/ thrustingBearish=Ref(blackBody,-1) AND Ref(LargeBody,-1) AND LargeBody AND whitebody AND ORef(C,-1); /*Tweezer Top*/ TweezerTop=abs(H-Ref(H,-1))<=H*0.0025 AND O >C AND (Ref(C,-1) > Ref(O,-1)); txt2+=WriteIf(BlackCandle ,"BlackCandle ",""); txt2+=WriteIf(LongBlackCandle ,"LongBlackCandle ",""); txt2+=WriteIf(SmallBlackCandle ,"SmallBlackCandle ",""); txt2+=WriteIf(WhiteCandle ,"WhiteCandle ",""); txt2+=WriteIf(LongWhiteCandle ,"LongWhiteCandle ",""); txt2+=WriteIf(SmallWhiteCandle ,"SmallWhiteCandle ",""); txt2+=WriteIf(BlackMaubozu ,"BlackMaubozu ",""); txt2+=WriteIf(WhiteMaubozu ,"WhiteMaubozu ",""); txt2+=WriteIf(BlackClosingMarubozu ,"BlackClosingMarubozu ",""); txt2+=WriteIf(WhiteClosingMarubozu ,"WhiteClosingMarubozu ",""); txt2+=WriteIf(BlackOpeningMarubozu ,"BlackOpeningMarubozu ",""); txt2+=WriteIf(WhiteOpeningMarubozu ,"WhiteOpeningMarubozu ",""); txt2+=WriteIf(BlackMaubozu ,"BlackMaubozu ",""); txt2+=WriteIf(BearishHarami ,"BearishHarami ",""); txt2+=WriteIf(eveningStar ,"eveningStar ",""); txt2+=WriteIf(Hammer ,"Hammer ",""); txt2+=WriteIf(InvertedHammer ,"InvertedHammer ",""); txt2+=WriteIf(PiercingLine ,"PiercingLine ",""); txt2+=WriteIf(BullishEngulfing ,"BullishEngulfing ",""); txt2+=WriteIf(BearishEngulfing ,"BearishEngulfing ",""); txt2+=WriteIf(BullishHarami ,"BullishHarami ",""); txt2+=WriteIf(BearishHarami ,"BearishHarami ",""); txt2+=WriteIf(morningStar ,"morningStar ",""); txt2+=WriteIf(NearDoji ,"NearDoji ",""); txt2+=WriteIf(Doji ,"Doji ",""); txt2+=WriteIf(haramiBullish ,"haramiBullish ",""); txt2+=WriteIf(DarkCloudCover ,"DarkCloudCover ",""); txt2+=WriteIf(invertedHammer ,"invertedHammer ",""); txt2+=WriteIf(HaramiCross ,"HaramiCross ",""); txt2+=WriteIf(haramiBearish ,"haramiBearish ",""); txt2+=WriteIf(spinningTop ,"spinningTop ",""); txt2+=WriteIf(engulfing ,"engulfing ",""); txt2+=WriteIf(Harami ,"Harami ",""); txt2+=WriteIf(tweezerBottom ,"tweezerBottom ",""); txt2+=WriteIf(tweezerTop ,"tweezerTop ",""); txt2+=WriteIf(Hammer ,"Hammer ",""); txt2+=WriteIf(shootingStar ,"shootingStar ",""); txt2+=WriteIf(dojiStarBullish ,"dojiStarBullish ",""); txt2+=WriteIf(dojiStarBearish ,"dojiStarBearish ",""); txt2+=WriteIf(engulfingBullish ,"engulfingBullish ",""); txt2+=WriteIf(invertedHammer ,"invertedHammer ",""); txt2+=WriteIf(haramiBearish ,"haramiBearish ",""); txt2+=WriteIf(hammerBullish ,"hammerBullish ",""); txt2+=WriteIf(dojiStarBullish ,"dojiStarBullish ",""); txt2+=WriteIf(eveningStar ,"eveningStar ",""); txt2+=WriteIf(HammerBearish,"HammerBearish ",""); txt2+=WriteIf(HaramiCrossBearish ,"HaramiCrossBearish ",""); txt2+=WriteIf(inNeckBearish ,"inNeckBearish ",""); txt2+=WriteIf(OnNeckBearish ,"OnNeckBearish ",""); txt2+=WriteIf(fallingThreeMethods ,"fallingThreeMethods ",""); txt2+=WriteIf(threeBlackCrows ,"threeBlackCrows ",""); txt2+=WriteIf(downsideTasukiGap ,"downsideTasukiGap ",""); txt2+=WriteIf(downsideGapThreeMethods ,"downsideGapThreeMethods ",""); txt2+=WriteIf(twoCrows ,"twoCrows ",""); txt2+=WriteIf(darkCloudCover,"darkCloudCover ",""); txt2+=WriteIf(beltHoldBearish,"beltHoldBearish ",""); txt2+=WriteIf(abandonedBabybullish ,"abandonedBabybullish ",""); txt2+=WriteIf(beltHoldBullish ,"beltHoldBullish ",""); txt2+=WriteIf(breakAwayBullish,"breakAwayBullish ",""); txt2+=WriteIf(dojiStarBullish ,"dojiStarBullish ",""); txt2+=WriteIf(engulfingBullish ,"engulfingBullish ",""); txt2+=WriteIf(hammerBullish ,"hammerBullish ",""); txt2+=WriteIf(homingPigeon ,"homingPigeon ",""); txt2+=WriteIf(smallUpperShadow,"smallUpperShadow ",""); txt2+=WriteIf(smallLowerShadow,"smallLowerShadow ",""); txt2+=WriteIf(largeUpperShadow ,"largeUpperShadow ",""); txt2+=WriteIf(largeLowerShadow,"largeLowerShadow ",""); txt2+=WriteIf(upGap,"upGap ",""); txt2+=WriteIf(downGap,"downGap ",""); txt2+=WriteIf(meetingLinesbullish,"meetingLinesbullish ",""); txt2+=WriteIf(morningDojiStar,"morningDojiStar ",""); txt2+=WriteIf(morningStar,"morningStar ",""); txt2+=WriteIf(piercingLine,"piercingLine ",""); txt2+=WriteIf(stickSandwich,"stickSandwich ",""); txt2+=WriteIf(threeInsideUp ,"threeInsideUp ",""); txt2+=WriteIf(threeOutsideUp ,"threeOutsideUp ",""); txt2+=WriteIf(triStarBullish,"triStarBullish ",""); txt2+=WriteIf(threeriverBottom,"threeriverBottom ",""); txt2+=WriteIf(risingThreeMethods,"risingThreeMethods ",""); txt2+=WriteIf(threeWhiteSoldiers,"threeWhiteSoldiers ",""); txt2+=WriteIf(upsideGapThreeMethods,"upsideGapThreeMethods ",""); txt2+=WriteIf(tweezerBottom,"tweezerBottom ",""); txt2+=WriteIf(breakAwayBearish,"breakAwayBearish ",""); txt2+=WriteIf(darkCloudCover,"darkCloudCover ",""); txt2+=WriteIf(eveningDojiStar,"eveningDojiStar ",""); txt2+=WriteIf(eveningStar,"eveningStar ",""); txt2+=WriteIf(triStarBearish,"triStarBearish ",""); txt2+=WriteIf(threeoutsideDownBearish,"threeoutsideDownBearish ",""); txt2+=WriteIf(dragonflyDojiBearish,"dragonflyDojiBearish ",""); txt2+=WriteIf(HammerBearish,"HammerBearish ",""); txt2+=WriteIf(threeInsideDownBearish,"threeInsideDownBearish ",""); Candle_current_txt2=txt2; // 1-Old 4- Latest //cc_cond1= Ref(WhiteCandle ,-3) + Ref(SmallWhiteCandle ,-3) + Ref(Hammer,-3) // ; cc_cond2= Ref(WhiteCandle,-2) + Ref(smallUpperShadow ,-2) + Ref(smallLowerShadow,-2) ; cc_cond3= Ref(SmallBlackCandle,-1) + Ref(smallUpperShadow ,-1) + Ref(smallLowerShadow,-1) +Ref(NearDoji ,-1) ; cc_cond4= BlackCandle + smallUpperShadow + smallLowerShadow ; Filter_candle= (cc_cond4>1 AND BlackCandle ) AND (cc_cond3>0 AND Ref(SmallBlackCandle,-1)) AND (cc_cond2 >0 AND Ref(WhiteCandle,-2) ) ; //////////////////////////////////////////////////////////////////////////////////////// Filter_roc_HL= ( expLinearSlopeHS_Cond_num AND ROC_HL_cond ) ; _TRACE("Filter_roc_HL "+Filter_roc_HL); _TRACE("Filter_pastDay "+Filter_pastDay); _TRACE("Filter_roc_HL "+Filter_roc_HL); Filter=Filter_roc_HL // AND FilterNLCond //AND Filter_candle //AND Filter_Condstr1; AND Filter_pastDay AND (SellSum==3 AND BuySum==0 AND Ref(Close,3)=2 ); //_TRACE(" Filter "+ (expLinearSlopeHS_Cond AND ROC_HL_cond) ); bodyfactor = ( Close - Open )/ (High-Low); rangefactor = (Close - Open)/ MA ( (Close-Open), 15); AddColumn(Sellsum,"Sellsum"); AddColumn(Buysum,"Buysum"); AddColumn(Close,"close",4.6); //excel AddColumn(Close_cond,"close_cond"); AddColumn(SI_sign_cond,"SI_sign"); AddColumn(Ref(SI,-1),"SI(-1)",4.6); AddColumn(SI,"SI",4.6); /* hourly buy sell*/ /* hourly */ AddColumn(IIf(filter_buy,Buysum,0),"BuyHourlySum"); AddColumn(IIf(filter_sell,Sellsum,0),"SellHourlySum"); AddColumn( Ref(Close,3)> Close,">close3Houlybuy"); AddColumn( Ref(Close,3)< Close,">close3Hourlysell"); AddColumn( ROC(Ref(Close,3),3,True),">%chg3Bars"); AddColumn( ROC(Ref(Close,4),4,True),">%chg4Bars"); AddColumn(Close< Ref(Close,1),">BUYDaily"); AddColumn(Close> Ref(Close,1),">SELLDaily"); AddColumn(ROC( Ref(Close,1) ,1,True),"roc",4.6); AddColumn(bodyfactor ,"bf",4.6); AddColumn( rangefactor,"rf",4.6); AddColumn(Ref(bodyfactor ,1),">>bf",4.6); AddColumn( Ref(rangefactor ,1),">>rf",4.6); //AddColumn(ROC( Ref(High,1) ,1,True),"rocH",4.6); //AddColumn(ROC( Ref(Low,1) ,1,True),"rocL",4.6); //AddTextColumn(HL_txt,"HL"); /* AddColumn(HL_sign,"Q1-sign"); //HL_1_12_nosign_T AddColumn(HL_sign_abs,"Q2-sign"); AddColumn(HL_nosign,"Q3-Nosign"); //HL_1_12_nosign_T AddColumn(HL_nosign_abs,"Q4-Nosign"); */ //AddTextColumn(expLinearSlopeHS_txt,"ematxt"); //AddTextColumn(em_code_sum,"em_code_sum"); //AddColumn(cc_cond1, "old"); AddColumn(cc_cond2, "c_cond2"); AddColumn(cc_cond3, "c_cond3"); AddColumn(cc_cond4, "latest"); //excel AddColumn(MA_ROC_slope_code,"txt1"); AddColumn(LEMA_ROC_slope_code,"txt12"); AddColumn(MA_slope_code,"txt21"); AddColumn(LEMA_slope_code,"txt22"); AddColumn(Ref(MA_ROC_slope_code,-1),",<-txt1"); AddColumn(Ref(LEMA_ROC_slope_code,-1),"<-txt12"); AddColumn(Ref(MA_slope_code,-1),"<-txt21"); AddColumn(Ref(LEMA_slope_code,-1),"<-txt22"); //cond of past day AddColumn(expLinearSlopeHS_Cond_num_prev,"ref(LEMA,-1)",1); AddColumn(ROC_HL_plain_past,"ref(HL,-1)",1); //excel //AddColumn(expLinearSlopeHS_Cond_num,"emaCond"); AddColumn(Dtrend,"Dtrend"); AddColumn(Utrend,"Utrend"); AddColumn(ROC(SI,1,True),"1_T"); AddColumn(ROC(SI,12,True),"12_T"); //excel AddColumn(ROC(SI,1),"1_abs"); AddColumn(ROC(SI,12),"12_abs"); AddColumn(ROC(ROC(SI,1,True),1,True),"1Diff"); AddColumn(ROC(ROC(SI,12,True),1,True),"12Diff"); AddColumn(ROC(ROC(SI,12,True),1,True),"12Diff"); //// /* AddColumn(str1,"SI"); AddColumn(str2,"EMA(1)"); AddColumn(str3,"LEMA(1)"); AddColumn(str4,"SI(1)"); AddColumn(str5,"SI(12)"); AddColumn(str6,"SI_ROC_DIFF"); AddColumn(str11,"SI_ROC12_DIFF"); */ //AddColumn(str7,"bf"); //AddColumn(str8,"rf"); //AddColumn(str9,"AbsSI(1)"); //AddColumn(str10,"AbsSI(12)"); /* AddColumn(str1_diff,"DSI"); AddColumn(str2_diff,"DEMA(1)"); AddColumn(str3_diff,"DLEMA(1)"); AddColumn(str4_diff,"DSI(1)"); AddColumn(str5_diff,"DSI(12)"); AddColumn(str6_diff,"DSI_ROC_DIFF"); */ //AddColumn(str7_diff,"bf"); //AddColumn(str8_diff,"rf"); //AddColumn(str9_diff,"AbsSI(1)"); //AddColumn(str10_diff,"AbsSI(12)"); //AddColumn(str11_diff,"DSI(12)_ROC_DIFF"); ////////////////////////////////////////////////////////////////////////////