Multiple Moving Averages Trends with Buy Sell Signals

Buy-Sell-Signals-with-Multiple-Moving-AveragesBuy-Sell-Signals-with-Multiple-Moving-Averages

This Trading System is primarily based on Moving Averages i.e. Simple Moving Averages, Exponential Moving Averages, Double Exponential Moving Averages & Triple Exponential Moving Averages to indicate price trend. Also added Buy Sell Signals to take trade with clear targets and stoploss. This system can be used with minimum 15 min time frame for day trading and hourly for positional trading.

Use Multiple Moving Averages Trends with Buy Sell Signals System AFL for Trading in MCX Commodity, NCDEX Agriculture Commodity, NSE Equity Cash Stocks, Nifty Future, Bank Nifty Future, Most Active Stock Futures Etc.

Download Buy Sell Signals with Multiple Moving Averages

Password : techarticles.in

AmiTrader

COPY & PASTE CODE :

_SECTION_BEGIN(“5 PPC ALL Moving Averages”);
//============== MA ==============
pxHeight = Status( “pxchartheight”) ;
xx = Status( “pxchartwidth”);
Left = 1100;
width = 200;
x = 5;
x2 = 400;
y = pxHeight;
GfxSelectPen( colorWhite, 1); // broader color
GfxSelectSolidBrush( colorBlack );
GfxSetBkMode( 1);
GfxRoundRect( x, y -105, x2, y-55 , 10,10) ;
GfxSelectFont( “Verdana”, 7, 500);
GfxSetTextColor( colorWhite);
GfxTextOut( ( “Simple Moving Averages”),7,y-118);
GfxSelectFont(“Verdana”, 7.5,200);

DT5   =    5; // DTL =  5 Day Moving Trend
DT10  =   10; // DTM = 10 Day Moving Trend
DT20  =   20; // DTS = 20 Day Moving Trend
DT50  =   50; // DTL =  50 Day Moving Trend
DT100 =  100; // DTM = 100 Day Moving Trend
DT200 =  200; // DTS = 200 Day Moving Trend

MT5   = LinRegSlope( MA(C, DT5  ), 2 );  //5 Day Moving Average
MT10  = LinRegSlope( MA(C, DT10 ), 2 );  //10 Day Moving Average
MT20  = LinRegSlope( MA(C, DT20 ), 2 );  //20 Day Moving Average
MT50  = LinRegSlope( MA(C, DT50 ), 2 );  //50 Day Moving Average
MT100 = LinRegSlope( MA(C, DT100), 2 );  //100 Day Moving Average
MT200 = LinRegSlope( MA(C, DT200), 2 );  //200 Day Moving Average

MTT5   = IIf(LinRegSlope( MA(C,   DT5  ), 2 )>0,True , False);  //5 Day Moving Average
MTT10   = IIf(LinRegSlope( MA(C,  DT10  ), 2 )>0,True , False);
MTT20   = IIf(LinRegSlope( MA(C,  DT20  ), 2 )>0,True , False);
MTT50   = IIf(LinRegSlope( MA(C,  DT50  ), 2 )>0,True , False);
MTT100   = IIf(LinRegSlope( MA(C, DT100 ), 2 )>0,True , False);
MTT200   = IIf(LinRegSlope( MA(C, DT200 ), 2 )>0,True , False);

///////5 Days UP Trend ////

GfxSetTextColor( colorYellow);
GfxTextOut((“5 Days  ” ),7,y-100);
GfxSetTextColor( colorLime);
GfxTextOut(( ”  ”  + WriteIf (MT5 > 0 AND MT5 < 0.3,     “WEAK UP TREND” , ” “)), 65, y-100);
GfxSetTextColor( colorBrightGreen);
GfxTextOut(( ”  ”  + WriteIf (MT5 >= 0.3 AND MT5 < 0.6,  “MEDIUM UP TREND” , ” “)), 65, y-100);
GfxSetTextColor( colorGreen);
GfxTextOut(( ”  ”  + WriteIf  (MT5 >= 0.6,              “BUY BUY BUY” , ” “)),65, y-100);

///////5 Days Down Trend////

GfxSetTextColor( colorOrange);
GfxTextOut(( ”  ”  + WriteIf (MT5<0 AND MT5> -0.3,        “WEAK DOWN TREND” , ” “)), 65, y-100);
GfxSetTextColor( colorPink);
GfxTextOut(( ”  ”  + WriteIf (MT5<= -0.3 AND MT5 > -0.6, “MEDIUM DOWN TREND” , ” “)),65, y-100);
GfxSetTextColor( colorRed);
GfxTextOut(( ”  ”  + WriteIf(MT5 <= -0.6,                 “SELL SELL SELL” , ” “)), 65, y-100);
GfxSetTextColor( colorWhite);
GfxTextOut(( ”  ”  + WriteIf(NOT MT5 > 0 AND MT5 < 0.3 AND NOT MT5 >= 0.3 AND MT5 < 0.6 AND NOT MT5 >= 0.6 AND NOT MT5<0 AND MT5> -0.3 AND NOT MT5 <= -0.3 AND MT5> -0.6 AND NOT MT5 <= -0.6 , ”  SIDEWAYS” , “”)), 65, y-100);

///////10 Days UP Trend ////

GfxSetTextColor( colorYellow);
GfxTextOut((“10 Days  ” ),200,y-100);
GfxSetTextColor( colorLime);
GfxTextOut(( ”  ”  + WriteIf (MT10 > 0 AND MT10 < 0.3,     “WEAK UP TREND” , ” “)), 262, y-100);
GfxSetTextColor( colorBrightGreen);
GfxTextOut(( ”  ”  + WriteIf (MT10 >= 0.3 AND MT10 < 0.6,  “MEDIUM UP TREND” , ” “)), 262, y-100);
GfxSetTextColor( colorGreen);
GfxTextOut(( ”  ”  + WriteIf  (MT10 >= 0.6,              “BUY BUY BUY” , ” “)),262,y-100);

///////10 Days Down Trend////

GfxSetTextColor( colorOrange);
GfxTextOut(( ”  ”  + WriteIf (MT10<0 AND MT10> -0.3,        “WEAK DOWN TREND” , ” “)),262, y-100);
GfxSetTextColor( colorPink);
GfxTextOut(( ”  ”  + WriteIf (MT10<= -0.3 AND MT10 > -0.6, “MEDIUM DOWN TREND” , ” “)), 262, y-100);
GfxSetTextColor( colorRed);
GfxTextOut(( ”  ”  + WriteIf(MT10 <= -0.6,                 “SELL SELL SELL” , ” “)), 262, y-100);
GfxSetTextColor( colorWhite);
GfxTextOut(( ”  ”  + WriteIf(NOT MT10 > 0 AND MT10 < 0.3 AND NOT MT10 >= 0.3 AND MT10 < 0.6 AND NOT MT10 >= 0.6 AND NOT MT10<0 AND MT10> -0.3 AND NOT MT10 <= -0.3 AND MT10> -0.6 AND NOT MT10 <= -0.6 , ”  SIDEWAYS” , “”)), 262, y-100);

///////20 Days UP Trend ////

GfxSetTextColor( colorYellow);
GfxTextOut((“20 Days  ” ),7,y-85);
GfxSetTextColor( colorLime);
GfxTextOut(( ”  ”  + WriteIf (MT20 > 0 AND MT20 < 0.3,     “WEAK UP TREND” , ” “)), 65, y-85);
GfxSetTextColor( colorBrightGreen);
GfxTextOut(( ”  ”  + WriteIf (MT20 >= 0.3 AND MT20 < 0.6,  “MEDIUM UP TREND” , ” “)), 65, y-85);
GfxSetTextColor( colorGreen);
GfxTextOut(( ”  ”  + WriteIf  (MT20 >= 0.6,              “BUY BUY BUY” , ” “)),65, y-85);

///////20 Days Down Trend////

GfxSetTextColor( colorOrange);
GfxTextOut(( ”  ”  + WriteIf (MT20<0 AND MT20> -0.3,        “WEAK DOWN TREND” , ” “)), 65, y-85);
GfxSetTextColor( colorPink);
GfxTextOut(( ”  ”  + WriteIf (MT20<= -0.3 AND MT20 > -0.6, “MEDIUM DOWN TREND” , ” “)),65, y-85);
GfxSetTextColor( colorRed);
GfxTextOut(( ”  ”  + WriteIf(MT20 <= -0.6,                 “SELL SELL SELL” , ” “)), 65, y-85);
GfxSetTextColor( colorWhite);
GfxTextOut(( ”   ”  + WriteIf(NOT MT20 > 0 AND MT20 < 0.3 AND NOT MT20 >= 0.3 AND MT20 < 0.6 AND NOT MT20 >= 0.6 AND NOT MT20<0 AND MT20> -0.3 AND NOT MT20 <= -0.3 AND MT20> -0.6 AND NOT MT20 <= -0.6 , ”  SIDEWAYS” , “”)), 65, y-85);

///////50 Days UP Trend ////

GfxSetTextColor( colorYellow);
GfxTextOut((“50 Days  ” ),200,y-85);
GfxSetTextColor( colorLime);
GfxTextOut(( ”  ”  + WriteIf (MT50 > 0 AND MT50 < 0.3,     “WEAK UP TREND” , ” “)), 262, y-85);
GfxSetTextColor( colorBrightGreen);
GfxTextOut(( ”  ”  + WriteIf (MT50 >= 0.3 AND MT50 < 0.6,  “MEDIUM UP TREND” , ” “)), 262, y-85);
GfxSetTextColor( colorGreen);
GfxTextOut(( ”  ”  + WriteIf  (MT50 >= 0.6,              “BUY BUY BUY” , ” “)),262,y-85);

///////50 Days Down Trend////

GfxSetTextColor( colorOrange);
GfxTextOut(( ”  ”  + WriteIf (MT50<0 AND MT50> -0.3,        “WEAK DOWN TREND” , ” “)), 262, y-85);
GfxSetTextColor( colorPink);
GfxTextOut(( ”  ”  + WriteIf (MT50<= -0.3 AND MT50 > -0.6, “MEDIUM DOWN TREND” , ” “)), 262, y-85);
GfxSetTextColor( colorRed);
GfxTextOut(( ”  ”  + WriteIf(MT50 <= -0.6,                 “SELL SELL SELL” , ” “)), 262, y-85);
GfxSetTextColor( colorWhite);
GfxTextOut(( ”  ”  + WriteIf(NOT MT50 > 0 AND MT50 < 0.3 AND NOT MT50 >= 0.3 AND MT50 < 0.6 AND NOT MT50 >= 0.6 AND NOT MT50<0 AND MT50> -0.3 AND NOT MT50 <= -0.3 AND MT50> -0.6 AND NOT MT50 <= -0.6 , ”  SIDEWAYS” , “”)), 262, y-85);

///////100 Days UP Trend ////

GfxSetTextColor( colorYellow);
GfxTextOut((“100 Days  ” ),7,y-70);
GfxSetTextColor( colorLime);
GfxTextOut(( ”  ”  + WriteIf (MT100 > 0 AND MT100 < 0.3,     “WEAK UP TREND” , ” “)), 65, y-70);
GfxSetTextColor( colorBrightGreen);
GfxTextOut(( ”  ”  + WriteIf (MT100 >= 0.3 AND MT100 < 0.6,  “MEDIUM UP TREND” , ” “)), 65, y-70);
GfxSetTextColor( colorGreen);
GfxTextOut(( ”  ”  + WriteIf  (MT100 >= 0.6,              “BUY BUY BUY” , ” “)),65, y-70);

///////100 Days Down Trend////

GfxSetTextColor( colorOrange);
GfxTextOut(( ”  ”  + WriteIf (MT100<0 AND MT100> -0.3,        “WEAK DOWN TREND” , ” “)), 65, y-70);
GfxSetTextColor( colorPink);
GfxTextOut(( ”  ”  + WriteIf (MT100<= -0.3 AND MT100 > -0.6, “MEDIUM DOWN TREND” , ” “)),65, y-70);
GfxSetTextColor( colorRed);
GfxTextOut(( ”  ”  + WriteIf(MT100 <= -0.6,                 “SELL SELL SELL” , ” “)), 65, y-70);
GfxSetTextColor( colorWhite);
GfxTextOut(( ”  ”  + WriteIf(NOT MT100 > 0 AND MT100 < 0.3 AND NOT MT100 >= 0.3 AND MT100 < 0.6 AND NOT MT100 >= 0.6 AND NOT MT100<0 AND MT100> -0.3 AND NOT MT100 <= -0.3 AND MT100> -0.6 AND NOT MT100 <= -0.6 , ”  SIDEWAYS” , “”)),65, y-70);

///////200 Days UP Trend ////

GfxSetTextColor( colorYellow);
GfxTextOut((“200 Days  ” ),200,y-70);
GfxSetTextColor( colorLime);
GfxTextOut(( ”  ”  + WriteIf (MT200 > 0 AND MT200 < 0.3,     “WEAK UP TREND” , ” “)), 262, y-70);
GfxSetTextColor( colorBrightGreen);
GfxTextOut(( ”  ”  + WriteIf (MT200 >= 0.3 AND MT200 < 0.6,  “MEDIUM UP TREND” , ” “)), 262, y-70);
GfxSetTextColor( colorGreen);
GfxTextOut(( ”  ”  + WriteIf  (MT200 >= 0.6,              “BUY BUY BUY” , ” “)),262,y-70);

///////200 Days Down Trend////

GfxSetTextColor( colorOrange);
GfxTextOut(( ”  ”  + WriteIf (MT200<0 AND MT200> -0.3,        “WEAK DOWN TREND” , ” “)), 262, y-70);
GfxSetTextColor( colorPink);
GfxTextOut(( ”  ”  + WriteIf (MT200<= -0.3 AND MT200 > -0.6, “MEDIUM DOWN TREND” , ” “)), 262, y-70);
GfxSetTextColor( colorRed);
GfxTextOut(( ”  ”  + WriteIf(MT200 <= -0.6,                 “SELL SELL SELL” , ” “)), 262, y-70);
GfxSetTextColor( colorWhite);
GfxTextOut(( ”  ”  + WriteIf(NOT MT200 > 0 AND MT200 < 0.3 AND NOT MT200 >= 0.3 AND MT200 < 0.6 AND NOT MT200 >= 0.6 AND NOT MT200<0 AND MT200> -0.3 AND NOT MT200 <= -0.3 AND MT200> -0.6 AND NOT MT200 <= -0.6 , ”  SIDEWAYS” , “”)), 262, y-70);

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//============== DEMA==============
pxHeight = Status( “pxchartheight”) ;
xx = Status( “pxchartwidth”);
Left = 1100;
width = 200;
x = 5;
x2 = 400;
y = pxHeight;
GfxSelectPen( colorWhite, 1); // broader color
GfxSelectSolidBrush( colorBlack );
GfxSetBkMode( 1);
GfxRoundRect( x, y -40, x2, y+7 , 10,10) ;
GfxSelectFont( “Verdana”, 7, 300);
GfxSetTextColor( colorWhite );
GfxTextOut( ( “Double Exponential (DEMA) “),7,y-53);
GfxSelectFont(“Verdana”, 7.5,200);
GfxSetTextColor( colorWhite );

DT5   =    5; // DTL =  5 Day Moving Trend
DT10  =   10; // DTM = 10 Day Moving Trend
DT20  =   20; // DTS = 20 Day Moving Trend
DT50  =   50; // DTL =  50 Day Moving Trend
DT100 =  100; // DTM = 100 Day Moving Trend
DT200 =  200; // DTS = 200 Day Moving Trend

DET5   = LinRegSlope( DEMA(C, DT5  ), 2 );  //5 Day Moving Average
DET10  = LinRegSlope( DEMA(C, DT10 ), 2 );  //10 Day Moving Average
DET20  = LinRegSlope( DEMA(C, DT20 ), 2 );  //20 Day Moving Average
DET50  = LinRegSlope( DEMA(C, DT50 ), 2 );  //50 Day Moving Average
DET100 = LinRegSlope( DEMA(C, DT100), 2 );  //100 Day Moving Average
DET200 = LinRegSlope( DEMA(C, DT200), 2 );  //200 Day Moving Average

MTT5   = IIf(LinRegSlope( DEMA(C,   DT5  ), 2 ) >0,True , False);  //5 Day Moving Average
MTT10   = IIf(LinRegSlope( DEMA(C,  DT10  ), 2 )>0,True , False);
MTT20   = IIf(LinRegSlope( DEMA(C,  DT20  ), 2 )>0,True , False);
MTT50   = IIf(LinRegSlope( DEMA(C,  DT50  ), 2 )>0,True , False);
MTT100   = IIf(LinRegSlope( DEMA(C, DT100 ), 2 )>0,True , False);
MTT200   = IIf(LinRegSlope( DEMA(C, DT200 ), 2 )>0,True , False);

///////5 Days UP Trend ////

GfxSetTextColor( colorYellow);
GfxTextOut((“5 Days  ” ),7,y-37);
GfxSetTextColor( colorLime);
GfxTextOut(( ”  ”  + WriteIf (DET5 > 0 AND DET5 < 0.3,     “WEAK UP TREND” , ” “)), 65, y-37);
GfxSetTextColor( colorBrightGreen);
GfxTextOut(( ”  ”  + WriteIf (DET5 >= 0.3 AND DET5 < 0.6,  “MEDIUM UP TREND” , ” “)), 65, y-37);
GfxSetTextColor( colorGreen);
GfxTextOut(( ”  ”  + WriteIf  (DET5 >= 0.6,              “BUY BUY BUY” , ” “)),65, y-37);

///////5 Days Down Trend////

GfxSetTextColor( colorOrange);
GfxTextOut(( ”  ”  + WriteIf (DET5<0 AND DET5> -0.3,        “WEAK DOWN TREND” , ” “)), 65, y-37);
GfxSetTextColor( colorPink);
GfxTextOut(( ”  ”  + WriteIf (DET5<= -0.3 AND DET5 > -0.6, “MEDIUM DOWN TREND” , ” “)),65, y-37);
GfxSetTextColor( colorRed);
GfxTextOut(( ”  ”  + WriteIf(DET5 <= -0.6,                 “SELL SELL SELL” , ” “)), 65, y-37);
GfxSetTextColor( colorWhite);
GfxTextOut(( ”  ”  + WriteIf(NOT DET5 > 0 AND DET5 < 0.3 AND NOT DET5 >= 0.3 AND DET5 < 0.6 AND NOT DET5 >= 0.6 AND NOT DET5<0 AND DET5> -0.3 AND NOT DET5 <= -0.3 AND DET5> -0.6 AND NOT DET5 <= -0.6 , ”  SIDEWAYS” , “”)),65, y-37);

///////10 Days UP Trend ////

GfxSetTextColor( colorYellow);
GfxTextOut((“10 Days  ” ),200,y-37);
GfxSetTextColor( colorLime);
GfxTextOut(( ”  ”  + WriteIf (DET10 > 0 AND DET10 < 0.3,     “WEAK UP TREND” , ” “)), 262, y-37);
GfxSetTextColor( colorBrightGreen);
GfxTextOut(( ”  ”  + WriteIf (DET10 >= 0.3 AND DET10 < 0.6,  “MEDIUM UP TREND” , ” “)), 262, y-37);
GfxSetTextColor( colorGreen);
GfxTextOut(( ”  ”  + WriteIf  (DET10 >= 0.6,              “BUY BUY BUY” , ” “)),262,y-37);

///////10 Days Down Trend////

GfxSetTextColor( colorOrange);
GfxTextOut(( ”  ”  + WriteIf (DET10<0 AND DET10> -0.3,        “WEAK DOWN TREND” , ” “)), 262, y-37);
GfxSetTextColor( colorPink);
GfxTextOut(( ”  ”  + WriteIf (DET10<= -0.3 AND DET10 > -0.6, “MEDIUM DOWN TREND” , ” “)), 262, y-37);
GfxSetTextColor( colorRed);
GfxTextOut(( ”  ”  + WriteIf(DET10 <= -0.6,                 “SELL SELL SELL” , ” “)), 262, y-37);
GfxSetTextColor( colorWhite);
GfxTextOut(( ”  ”  + WriteIf(NOT DET10 > 0 AND DET10 < 0.3 AND NOT DET10 >= 0.3 AND DET10 < 0.6 AND NOT DET10 >= 0.6 AND NOT DET10<0 AND DET10> -0.3 AND NOT DET10 <= -0.3 AND DET10> -0.6 AND NOT DET10 <= -0.6 , ”  SIDEWAYS” , “”)), 262, y-37);

///////20 Days UP Trend ////

GfxSetTextColor( colorYellow);
GfxTextOut((“20 Days  ” ),7,y-22);
GfxSetTextColor( colorLime);
GfxTextOut(( ”  ”  + WriteIf (DET20 > 0 AND DET20 < 0.3,     “WEAK UP TREND” , ” “)), 65, y-22);
GfxSetTextColor( colorBrightGreen);
GfxTextOut(( ”  ”  + WriteIf (DET20 >= 0.3 AND DET20 < 0.6,  “MEDIUM UP TREND” , ” “)), 65, y-22);
GfxSetTextColor( colorGreen);
GfxTextOut(( ”  ”  + WriteIf  (DET20 >= 0.6,              “BUY BUY BUY” , ” “)),65, y-22);

///////20 Days Down Trend////

GfxSetTextColor( colorOrange);
GfxTextOut(( ”  ”  + WriteIf (DET20<0 AND DET20> -0.3,        “WEAK DOWN TREND” , ” “)), 65, y-22);
GfxSetTextColor( colorPink);
GfxTextOut(( ”  ”  + WriteIf (DET20<= -0.3 AND DET20 > -0.6, “MEDIUM DOWN TREND” , ” “)),65, y-22);
GfxSetTextColor( colorRed);
GfxTextOut(( ”  ”  + WriteIf(DET20 <= -0.6,                 “SELL SELL SELL” , ” “)), 65, y-22);
GfxSetTextColor( colorWhite);
GfxTextOut(( ”   ”  + WriteIf(NOT DET20 > 0 AND DET20 < 0.3 AND NOT DET20 >= 0.3 AND DET20 < 0.6 AND NOT DET20 >= 0.6 AND NOT DET20<0 AND DET20> -0.3 AND NOT DET20 <= -0.3 AND DET20> -0.6 AND NOT DET20 <= -0.6 , ”  SIDEWAYS” , “”)), 65, y-22);

///////50 Days UP Trend ////

GfxSetTextColor( colorYellow);
GfxTextOut((“50 Days  ” ),200,y-22);
GfxSetTextColor( colorLime);
GfxTextOut(( ”  ”  + WriteIf (DET50 > 0 AND DET50 < 0.3,     “WEAK UP TREND” , ” “)), 262, y-22);
GfxSetTextColor( colorBrightGreen);
GfxTextOut(( ”  ”  + WriteIf (DET50 >= 0.3 AND DET50 < 0.6,  “MEDIUM UP TREND” , ” “)), 262, y-22);
GfxSetTextColor( colorGreen);
GfxTextOut(( ”  ”  + WriteIf  (DET50 >= 0.6,              “BUY BUY BUY” , ” “)),262,y-22);

///////50 Days Down Trend////

GfxSetTextColor( colorOrange);
GfxTextOut(( ”  ”  + WriteIf (DET50<0 AND DET50> -0.3,        “WEAK DOWN TREND” , ” “)), 262, y-22);
GfxSetTextColor( colorPink);
GfxTextOut(( ”  ”  + WriteIf (DET50<= -0.3 AND DET50 > -0.6, “MEDIUM DOWN TREND” , ” “)), 262, y-22);
GfxSetTextColor( colorRed);
GfxTextOut(( ”  ”  + WriteIf(DET50 <= -0.6,                 “SELL SELL SELL” , ” “)), 262, y-22);
GfxSetTextColor( colorWhite);
GfxTextOut(( ”  ”  + WriteIf(NOT DET50 > 0 AND DET50 < 0.3 AND NOT DET50 >= 0.3 AND DET50 < 0.6 AND NOT DET50 >= 0.6 AND NOT DET50<0 AND DET50> -0.3 AND NOT DET50 <= -0.3 AND DET50> -0.6 AND NOT DET50 <= -0.6 , ”  SIDEWAYS” , “”)), 262, y-22);

///////100 Days UP Trend ////

GfxSetTextColor( colorYellow);
GfxTextOut((“100 Days  ” ),7,y-7);
GfxSetTextColor( colorLime);
GfxTextOut(( ”  ”  + WriteIf (DET100 > 0 AND DET100 < 0.3,     “WEAK UP TREND” , ” “)),65, y-7);
GfxSetTextColor( colorBrightGreen);
GfxTextOut(( ”  ”  + WriteIf (DET100 >= 0.3 AND DET100 < 0.6,  “MEDIUM UP TREND” , ” “)), 65, y-7);
GfxSetTextColor( colorGreen);
GfxTextOut(( ”  ”  + WriteIf  (DET100 >= 0.6,              “BUY BUY BUY” , ” “)),65, y-7);

///////100 Days Down Trend////

GfxSetTextColor( colorOrange);
GfxTextOut(( ”  ”  + WriteIf (DET100<0 AND DET100> -0.3,        “WEAK DOWN TREND” , ” “)), 65, y-7);
GfxSetTextColor( colorPink);
GfxTextOut(( ”  ”  + WriteIf (DET100<= -0.3 AND DET100 > -0.6, “MEDIUM DOWN TREND” , ” “)),65, y-7);
GfxSetTextColor( colorRed);
GfxTextOut(( ”  ”  + WriteIf(DET100 <= -0.6,                 “SELL SELL SELL” , ” “)),65, y-7);
GfxSetTextColor( colorWhite);
GfxTextOut(( ”  ”  + WriteIf(NOT DET100 > 0 AND DET100 < 0.3 AND NOT DET100 >= 0.3 AND DET100 < 0.6 AND NOT DET100 >= 0.6 AND NOT DET100<0 AND DET100> -0.3 AND NOT DET100 <= -0.3 AND DET100> -0.6 AND NOT DET100 <= -0.6 , “SIDEWAYS”, “”)),65, y-7);

///////200 Days UP Trend ////

GfxSetTextColor( colorYellow);
GfxTextOut((“200 Days  ” ),200,y-7);
GfxSetTextColor( colorLime);
GfxTextOut(( ”  ”  + WriteIf (DET200 > 0 AND DET200 < 0.3,     “WEAK UP TREND” , ” “)), 262, y-7);
GfxSetTextColor( colorBrightGreen);
GfxTextOut(( ”  ”  + WriteIf (DET200 >= 0.3 AND DET200 < 0.6,  “MEDIUM UP TREND” , ” “)), 262, y-7);
GfxSetTextColor( colorGreen);
GfxTextOut(( ”  ”  + WriteIf  (DET200 >= 0.6,              “BUY BUY BUY” , ” “)),262,y-7);

///////200 Days Down Trend////

GfxSetTextColor( colorOrange);
GfxTextOut(( ”  ”  + WriteIf (DET200<0 AND DET200> -0.3,        “WEAK DOWN TREND” , ” “)), 262, y-7);
GfxSetTextColor( colorPink);
GfxTextOut(( ”  ”  + WriteIf (DET200<= -0.3 AND DET200 > -0.6, “MEDIUM DOWN TREND” , ” “)), 262, y-7);
GfxSetTextColor( colorRed);
GfxTextOut(( ”  ”  + WriteIf(DET200 <= -0.6,                 “SELL SELL SELL” , ” “)), 262, y-7);
GfxSetTextColor( colorWhite);
GfxTextOut(( ”  ”  + WriteIf(NOT DET200 > 0 AND DET200 < 0.3 AND NOT DET200 >= 0.3 AND DET200 < 0.6 AND NOT DET200 >= 0.6 AND NOT DET200<0 AND DET200> -0.3 AND NOT DET200 <= -0.3 AND DET200> -0.6 AND NOT DET200 <= -0.6 , ”  SIDEWAYS” , “”)), 262, y-7);

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//============== EMA==============
pxHeight = Status( “pxchartheight”) ;
xx = Status( “pxchartwidth”);
Left = 1100;
width = 200;
x = 400;
x2 = 795;
y = pxHeight;
GfxSelectPen( colorWhite, 1); // broader color
GfxSelectSolidBrush( colorBlack );
GfxSetBkMode( 1);
GfxRoundRect( x+3, y -105, x2, y-55 ,10,10) ;
GfxSelectFont( “Verdana”, 7, 300);
GfxSetTextColor( colorWhite );
GfxTextOut( ( “Exponential Moving Average (EMA) “),405,y-118);
GfxSelectFont(“Verdana”, 7.5,200);
GfxSetTextColor( colorWhite );

DT5   =    5; // DTL =  5 Day Moving Trend
DT10  =   10; // DTM = 7 Day Moving Trend
DT20  =   20; // DTS = 20 Day Moving Trend
DT50  =   50; // DTL =  50 Day Moving Trend
DT100 =  100; // DTM = 100 Day Moving Trend
DT200 =  200; // DTS = 200 Day Moving Trend

ET5   = LinRegSlope( EMA(C, DT5  ), 2 );  //5 Day Moving Average
ET10  = LinRegSlope( EMA(C, DT10 ), 2 );  //7 Day Moving Average
ET20  = LinRegSlope( EMA(C, DT20 ), 2 );  //20 Day Moving Average
ET50  = LinRegSlope( EMA(C, DT50 ), 2 );  //50 Day Moving Average
ET100 = LinRegSlope( EMA(C, DT100), 2 );  //100 Day Moving Average
ET200 = LinRegSlope( EMA(C, DT200), 2 );  //200 Day Moving Average

MTT5   = IIf(LinRegSlope(  EMA(C,   DT5  ), 2 )>0,True , False);  //5 Day Moving Average
MTT10   = IIf(LinRegSlope( EMA(C,  DT10  ), 2 )>0,True , False);
MTT20   = IIf(LinRegSlope( EMA(C,  DT20  ), 2 )>0,True , False);
MTT50   = IIf(LinRegSlope( EMA(C,  DT50  ), 2 )>0,True , False);
MTT100   = IIf(LinRegSlope( EMA(C, DT100 ), 2 )>0,True , False);
MTT200   = IIf(LinRegSlope( EMA(C, DT200 ), 2 )>0,True , False);

///////5 Days Down Trend////
GfxSetTextColor( colorYellow);
GfxTextOut((“5 Days  ” ),405,y-100);
GfxSetTextColor( colorLime);
GfxTextOut(( ”  ”  + WriteIf (ET5 > 0 AND ET5 < 0.3,     “WEAK UP TREND” , ” “)), 460, y-100);
GfxSetTextColor( colorBrightGreen);
GfxTextOut(( ”  ”  + WriteIf (ET5 >= 0.3 AND ET5 < 0.6,  “MEDIUM UP TREND” , ” “)), 460, y-100);
GfxSetTextColor( colorGreen);
GfxTextOut(( ”  ”  + WriteIf  (ET5 >= 0.6,              “BUY BUY BUY” , ” “)),460, y-100);

///////5 Days Down Trend////

GfxSetTextColor( colorOrange);
GfxTextOut(( ”  ”  + WriteIf (ET5<0 AND ET5> -0.3,        “WEAK DOWN TREND” , ” “)), 460, y-100);
GfxSetTextColor( colorPink);
GfxTextOut(( ”  ”  + WriteIf (ET5<= -0.3 AND ET5 > -0.6, “MEDIUM DOWN TREND” , ” “)),460, y-100);
GfxSetTextColor( colorRed);
GfxTextOut(( ”  ”  + WriteIf(ET5 <= -0.6,                 “SELL SELL SELL” , ” “)), 460, y-100);
GfxSetTextColor( colorWhite);
GfxTextOut(( ”  ”  + WriteIf(NOT ET5 > 0 AND ET5 < 0.3 AND NOT ET5 >= 0.3 AND ET5 < 0.6 AND NOT ET5 >= 0.6 AND NOT ET5<0 AND ET5> -0.3 AND NOT ET5 <= -0.3 AND ET5> -0.6 AND NOT ET5 <= -0.6 , ”  SIDEWAYS” , “”)), 460, y-100);

///////10 Days UP Trend ////

GfxSetTextColor( colorYellow);
GfxTextOut((“10 Days  ” ),600,y-100);
GfxSetTextColor( colorLime);
GfxTextOut(( ”  ”  + WriteIf (ET10 > 0 AND ET10 < 0.3,     “WEAK UP TREND” , ” “)), 655, y-100);
GfxSetTextColor( colorBrightGreen);
GfxTextOut(( ”  ”  + WriteIf (ET10 >= 0.3 AND ET10 < 0.6,  “MEDIUM UP TREND” , ” “)), 655, y-100);
GfxSetTextColor( colorGreen);
GfxTextOut(( ”  ”  + WriteIf  (ET10 >= 0.6,              “BUY BUY BUY” , ” “)),655,y-100);

///////10 Days Down Trend////

GfxSetTextColor( colorOrange);
GfxTextOut(( ”  ”  + WriteIf (ET10<0 AND ET10> -0.3,        “WEAK DOWN TREND” , ” “)),655, y-100);
GfxSetTextColor( colorPink);
GfxTextOut(( ”  ”  + WriteIf (ET10<= -0.3 AND ET10 > -0.6, “MEDIUM DOWN TREND” , ” “)), 655, y-100);
GfxSetTextColor( colorRed);
GfxTextOut(( ”  ”  + WriteIf(ET10 <= -0.6,                 “SELL SELL SELL” , ” “)), 655, y-100);
GfxSetTextColor( colorWhite);
GfxTextOut(( ”  ”  + WriteIf(NOT ET10 > 0 AND ET10 < 0.3 AND NOT ET10 >= 0.3 AND ET10 < 0.6 AND NOT ET10 >= 0.6 AND NOT ET10<0 AND ET10> -0.3 AND NOT ET10 <= -0.3 AND ET10> -0.6 AND NOT ET10 <= -0.6 , ”  SIDEWAYS” , “”)), 655, y-100);

///////20 Days UP Trend ////

GfxSetTextColor( colorYellow);
GfxTextOut((“20 Days  ” ),405,y-85);
GfxSetTextColor( colorLime);
GfxTextOut(( ”  ”  + WriteIf (ET20 > 0 AND ET20 < 0.3,     “WEAK UP TREND” , ” “)), 460, y-85);
GfxSetTextColor( colorBrightGreen);
GfxTextOut(( ”  ”  + WriteIf (ET20 >= 0.3 AND ET20 < 0.6,  “MEDIUM UP TREND” , ” “)), 460, y-85);
GfxSetTextColor( colorGreen);
GfxTextOut(( ”  ”  + WriteIf  (ET20 >= 0.6,              “BUY BUY BUY” , ” “)),460, y-85);

///////20 Days Down Trend////

GfxSetTextColor( colorOrange);
GfxTextOut(( ”  ”  + WriteIf (ET20<0 AND ET20> -0.3,        “WEAK DOWN TREND” , ” “)), 460, y-85);
GfxSetTextColor( colorPink);
GfxTextOut(( ”  ”  + WriteIf (ET20<= -0.3 AND ET20 > -0.6, “MEDIUM DOWN TREND” , ” “)),460, y-85);
GfxSetTextColor( colorRed);
GfxTextOut(( ”  ”  + WriteIf(ET20 <= -0.6,                 “SELL SELL SELL” , ” “)), 460, y-85);
GfxSetTextColor( colorWhite);
GfxTextOut(( ”   ”  + WriteIf(NOT ET20 > 0 AND ET20 < 0.3 AND NOT ET20 >= 0.3 AND ET20 < 0.6 AND NOT ET20 >= 0.6 AND NOT ET20<0 AND ET20> -0.3 AND NOT ET20 <= -0.3 AND ET20> -0.6 AND NOT ET20 <= -0.6 , ”  SIDEWAYS” , “”)), 460, y-85);

///////50 Days UP Trend ////

GfxSetTextColor( colorYellow);
GfxTextOut((“50 Days  ” ),600,y-85);
GfxSetTextColor( colorLime);
GfxTextOut(( ”  ”  + WriteIf (ET50 > 0 AND ET50 < 0.3,     “WEAK UP TREND” , ” “)), 655, y-85);
GfxSetTextColor( colorBrightGreen);
GfxTextOut(( ”  ”  + WriteIf (ET50 >= 0.3 AND ET50 < 0.6,  “MEDIUM UP TREND” , ” “)), 655, y-85);
GfxSetTextColor( colorGreen);
GfxTextOut(( ”  ”  + WriteIf  (ET50 >= 0.6,              “BUY BUY BUY” , ” “)),655,y-85);

///////50 Days Down Trend////

GfxSetTextColor( colorOrange);
GfxTextOut(( ”  ”  + WriteIf (ET50<0 AND ET50> -0.3,        “WEAK DOWN TREND” , ” “)), 655, y-85);
GfxSetTextColor( colorPink);
GfxTextOut(( ”  ”  + WriteIf (ET50<= -0.3 AND ET50 > -0.6, “MEDIUM DOWN TREND” , ” “)), 655, y-85);
GfxSetTextColor( colorRed);
GfxTextOut(( ”  ”  + WriteIf(ET50 <= -0.6,                 “SELL SELL SELL” , ” “)), 655, y-85);
GfxSetTextColor( colorWhite);
GfxTextOut(( ”  ”  + WriteIf(NOT ET50 > 0 AND ET50 < 0.3 AND NOT ET50 >= 0.3 AND ET50 < 0.6 AND NOT ET50 >= 0.6 AND NOT ET50<0 AND ET50> -0.3 AND NOT ET50 <= -0.3 AND ET50> -0.6 AND NOT ET50 <= -0.6 , ”  SIDEWAYS” , “”)), 655, y-85);

///////100 Days UP Trend ////

GfxSetTextColor( colorYellow);
GfxTextOut((“100 Days  ” ),405,y-70);
GfxSetTextColor( colorLime);
GfxTextOut(( ”  ”  + WriteIf (ET100 > 0 AND ET100 < 0.3,     “WEAK UP TREND” , ” “)), 460, y-70);
GfxSetTextColor( colorBrightGreen);
GfxTextOut(( ”  ”  + WriteIf (ET100 >= 0.3 AND ET100 < 0.6,  “MEDIUM UP TREND” , ” “)), 460, y-70);
GfxSetTextColor( colorGreen);
GfxTextOut(( ”  ”  + WriteIf  (ET100 >= 0.6,              “BUY BUY BUY” , ” “)),460, y-70);

///////100 Days Down Trend////

GfxSetTextColor( colorOrange);
GfxTextOut(( ”  ”  + WriteIf (ET100<0 AND ET100> -0.3,        “WEAK DOWN TREND” , ” “)), 460, y-70);
GfxSetTextColor( colorPink);
GfxTextOut(( ”  ”  + WriteIf (ET100<= -0.3 AND ET100 > -0.6, “MEDIUM DOWN TREND” , ” “)),460, y-70);
GfxSetTextColor( colorRed);
GfxTextOut(( ”  ”  + WriteIf(ET100 <= -0.6,                 “SELL SELL SELL” , ” “)), 460, y-70);
GfxSetTextColor( colorWhite);
GfxTextOut(( ”  ”  + WriteIf(NOT ET100 > 0 AND ET100 < 0.3 AND NOT ET100 >= 0.3 AND ET100 < 0.6 AND NOT ET100 >= 0.6 AND NOT ET100<0 AND ET100> -0.3 AND NOT ET100 <= -0.3 AND ET100> -0.6 AND NOT ET100 <= -0.6 , ”  SIDEWAYS” , “”)),460, y-70);

///////200 Days UP Trend ////

GfxSetTextColor( colorYellow);
GfxTextOut((“200 Days  ” ),600,y-70);
GfxSetTextColor( colorLime);
GfxTextOut(( ”  ”  + WriteIf (ET200 > 0 AND ET200 < 0.3,     “WEAK UP TREND” , ” “)), 655, y-70);
GfxSetTextColor( colorBrightGreen);
GfxTextOut(( ”  ”  + WriteIf (ET200 >= 0.3 AND ET200 < 0.6,  “MEDIUM UP TREND” , ” “)), 655, y-70);
GfxSetTextColor( colorGreen);
GfxTextOut(( ”  ”  + WriteIf  (ET200 >= 0.6,              “BUY BUY BUY” , ” “)),655,y-70);

///////200 Days Down Trend////

GfxSetTextColor( colorOrange);
GfxTextOut(( ”  ”  + WriteIf (ET200<0 AND ET200> -0.3,        “WEAK DOWN TREND” , ” “)), 655, y-70);
GfxSetTextColor( colorPink);
GfxTextOut(( ”  ”  + WriteIf (ET200<= -0.3 AND ET200 > -0.6, “MEDIUM DOWN TREND” , ” “)), 655, y-70);
GfxSetTextColor( colorRed);
GfxTextOut(( ”  ”  + WriteIf(ET200 <= -0.6,                 “SELL SELL SELL” , ” “)), 655, y-70);
GfxSetTextColor( colorWhite);
GfxTextOut(( ”  ”  + WriteIf(NOT ET200 > 0 AND ET200 < 0.3 AND NOT ET200 >= 0.3 AND ET200 < 0.6 AND NOT ET200 >= 0.6 AND NOT ET200<0 AND ET200> -0.3 AND NOT ET200 <= -0.3 AND ET200> -0.6 AND NOT ET200 <= -0.6 , ”  SIDEWAYS” , “”)), 655, y-70);
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//============== TEMA ==============
pxHeight = Status( “pxchartheight”) ;
xx = Status( “pxchartwidth”);
Left = 1100;
width = 200;
x = 400;
x2 = 795;
y = pxHeight;
GfxSelectPen( colorWhite, 1); // broader color
GfxSelectSolidBrush( colorBlack );
GfxSetBkMode( 1);
GfxRoundRect( x+3, y+8, x2, y-40 , 10,10) ;
GfxSelectFont( “Verdana”, 7, 300);
GfxSetTextColor( colorWhite );
GfxTextOut( ( “Triple Exponential (Tema)”),405,y-53);
GfxSelectFont(“Verdana”, 7.5,300);
GfxSetTextColor( colorWhite );

DT5   =    5; // DTL =  5 Day Moving Trend
DT10  =   7; // DTM = 7 Day Moving Trend
DT20  =   20; // DTS = 20 Day Moving Trend
DT50  =   50; // DTL =  50 Day Moving Trend
DT100 =  100; // DTM = 100 Day Moving Trend
DT200 =  200; // DTS = 200 Day Moving Trend

TEM5   = LinRegSlope( TEMA(C, DT5  ), 2 );  //5 Day Moving Average
TEM10  = LinRegSlope( TEMA(C, DT10 ), 2 );  //7 Day Moving Average
TEM20  = LinRegSlope( TEMA(C, DT20 ), 2 );  //20 Day Moving Average
TEM50  = LinRegSlope( TEMA(C, DT50 ), 2 );  //50 Day Moving Average
TEM100 = LinRegSlope( TEMA(C, DT100), 2 );  //100 Day Moving Average
TEM200 = LinRegSlope( TEMA(C, DT200), 2 );  //200 Day Moving Average

MTT5   = IIf(LinRegSlope( TEMA(C,   DT5  ), 2 )>0,True , False);  //5 Day Moving Average
MTT10   = IIf(LinRegSlope( TEMA(C,  DT10  ), 2 )>0,True , False);
MTT20   = IIf(LinRegSlope( TEMA(C,  DT20  ), 2 )>0,True , False);
MTT50   = IIf(LinRegSlope( TEMA(C,  DT50  ), 2 )>0,True , False);
MTT100   = IIf(LinRegSlope( TEMA(C, DT100 ), 2 )>0,True , False);
MTT200   = IIf(LinRegSlope( TEMA(C, DT200 ), 2 )>0,True , False);

///////5 Days UP Trend ////

GfxSetTextColor( colorYellow);
GfxTextOut((“5 Days  ” ),405,y-37);
GfxSetTextColor( colorLime);
GfxTextOut(( ”  ”  + WriteIf (TEM5 > 0 AND TEM5 < 0.3,     “WEAK UP TREND” , ” “)), 460, y-37);
GfxSetTextColor( colorBrightGreen);
GfxTextOut(( ”  ”  + WriteIf (TEM5 >= 0.3 AND TEM5 < 0.6,  “MEDIUM UP TREND” , ” “)), 460, y-37);
GfxSetTextColor( colorGreen);
GfxTextOut(( ”  ”  + WriteIf  (TEM5 >= 0.6,              “BUY BUY BUY” , ” “)),460, y-37);

///////5 Days Down Trend////

GfxSetTextColor( colorOrange);
GfxTextOut(( ”  ”  + WriteIf (TEM5<0 AND TEM5> -0.3,        “WEAK DOWN TREND” , ” “)), 460, y-37);
GfxSetTextColor( colorPink);
GfxTextOut(( ”  ”  + WriteIf (TEM5<= -0.3 AND TEM5 > -0.6, “MEDIUM DOWN TREND” , ” “)),460, y-37);
GfxSetTextColor( colorRed);
GfxTextOut(( ”  ”  + WriteIf(TEM5 <= -0.6,                 “SELL SELL SELL” , ” “)), 460, y-37);
GfxSetTextColor( colorWhite);
GfxTextOut(( ”  ”  + WriteIf(NOT TEM5 > 0 AND TEM5 < 0.3 AND NOT TEM5 >= 0.3 AND TEM5 < 0.6 AND NOT TEM5 >= 0.6 AND NOT TEM5<0 AND TEM5> -0.3 AND NOT TEM5 <= -0.3 AND TEM5> -0.6 AND NOT TEM5 <= -0.6 , ”  SIDEWAYS” , “”)), 460, y-37);

///////10 Days UP Trend ////

GfxSetTextColor( colorYellow);
GfxTextOut((“10 Days  ” ),600,y-37);
GfxSetTextColor( colorLime);
GfxTextOut(( ”  ”  + WriteIf (TEM10 > 0 AND TEM10 < 0.3,     “WEAK UP TREND” , ” “)), 655, y-37);
GfxSetTextColor( colorBrightGreen);
GfxTextOut(( ”  ”  + WriteIf (TEM10 >= 0.3 AND TEM10 < 0.6,  “MEDIUM UP TREND” , ” “)), 655, y-37);
GfxSetTextColor( colorGreen);
GfxTextOut(( ”  ”  + WriteIf  (TEM10 >= 0.6,              “BUY BUY BUY” , ” “)),655,y-37);

///////10 Days Down Trend////

GfxSetTextColor( colorOrange);
GfxTextOut(( ”  ”  + WriteIf (TEM10<0 AND TEM10> -0.3,        “WEAK DOWN TREND” , ” “)), 655, y-37);
GfxSetTextColor( colorPink);
GfxTextOut(( ”  ”  + WriteIf (TEM10<= -0.3 AND TEM10 > -0.6, “MEDIUM DOWN TREND” , ” “)), 655, y-37);
GfxSetTextColor( colorRed);
GfxTextOut(( ”  ”  + WriteIf(TEM10 <= -0.6,                 “SELL SELL SELL” , ” “)), 655, y-37);
GfxSetTextColor( colorWhite);
GfxTextOut(( ”  ”  + WriteIf(NOT TEM10 > 0 AND TEM10 < 0.3 AND NOT TEM10 >= 0.3 AND TEM10 < 0.6 AND NOT TEM10 >= 0.6 AND NOT TEM10<0 AND TEM10> -0.3 AND NOT TEM10 <= -0.3 AND TEM10> -0.6 AND NOT TEM10 <= -0.6 , ”  SIDEWAYS” , “”)), 655, y-37);

///////20 Days UP Trend ////

GfxSetTextColor( colorYellow);
GfxTextOut((“20 Days  ” ),405,y-22);
GfxSetTextColor( colorLime);
GfxTextOut(( ”  ”  + WriteIf (TEM20 > 0 AND TEM20 < 0.3,     “WEAK UP TREND” , ” “)), 460, y-22);
GfxSetTextColor( colorBrightGreen);
GfxTextOut(( ”  ”  + WriteIf (TEM20 >= 0.3 AND TEM20 < 0.6,  “MEDIUM UP TREND” , ” “)), 460, y-22);
GfxSetTextColor( colorGreen);
GfxTextOut(( ”  ”  + WriteIf  (TEM20 >= 0.6,                  “BUY BUY BUY” , ” “)),460, y-22);

///////20 Days Down Trend////

GfxSetTextColor( colorOrange);
GfxTextOut(( ”  ”  + WriteIf (TEM20<0 AND TEM20> -0.3,       “WEAK DOWN TREND” , ” “)), 460, y-22);
GfxSetTextColor( colorPink);
GfxTextOut(( ”  ”  + WriteIf (TEM20<= -0.3 AND TEM20 > -0.6, “MEDIUM DOWN TREND” , ” “)),460, y-22);
GfxSetTextColor( colorRed);
GfxTextOut(( ”  ”  + WriteIf(TEM20 <= -0.6,                  “SELL SELL SELL” , ” “)), 460, y-22);
GfxSetTextColor( colorWhite);
GfxTextOut(( ”   ”  + WriteIf(NOT TEM20 > 0 AND TEM20 < 0.3 AND NOT TEM20 >= 0.3 AND TEM20 < 0.6 AND NOT TEM20 >= 0.6 AND NOT TEM20<0 AND TEM20> -0.3 AND NOT TEM20 <= -0.3 AND TEM20> -0.6 AND NOT TEM20 <= -0.6 , ”  SIDEWAYS” , “”)), 460, y-22);

///////50 Days UP Trend ////

GfxSetTextColor( colorYellow);
GfxTextOut((“50 Days  ” ),600,y-22);
GfxSetTextColor( colorLime);
GfxTextOut(( ”  ”  + WriteIf (TEM50 > 0 AND TEM50 < 0.3,     “WEAK UP TREND” , ” “)), 655, y-22);
GfxSetTextColor( colorBrightGreen);
GfxTextOut(( ”  ”  + WriteIf (TEM50 >= 0.3 AND TEM50 < 0.6,  “MEDIUM UP TREND” , ” “)), 655, y-22);
GfxSetTextColor( colorGreen);
GfxTextOut(( ”  ”  + WriteIf  (TEM50 >= 0.6,                  “BUY BUY BUY” , ” “)),655,y-22);

///////50 Days Down Trend////

GfxSetTextColor( colorOrange);
GfxTextOut(( ”  ”  + WriteIf (TEM50<0 AND TEM50> -0.3,        “WEAK DOWN TREND” , ” “)), 655, y-22);
GfxSetTextColor( colorPink);
GfxTextOut(( ”  ”  + WriteIf (TEM50<= -0.3 AND TEM50 > -0.6, “MEDIUM DOWN TREND” , ” “)), 655, y-22);
GfxSetTextColor( colorRed);
GfxTextOut(( ”  ”  + WriteIf(TEM50 <= -0.6,                 “SELL SELL SELL” , ” “)), 655, y-22);
GfxSetTextColor( colorWhite);
GfxTextOut(( ”  ”  + WriteIf(NOT TEM50 > 0 AND TEM50 < 0.3 AND NOT TEM50 >= 0.3 AND TEM50 < 0.6 AND NOT TEM50 >= 0.6 AND NOT TEM50<0 AND TEM50> -0.3 AND NOT TEM50 <= -0.3 AND TEM50> -0.6 AND NOT TEM50 <= -0.6 , ”  SIDEWAYS” , “”)), 655, y-22);

///////100 Days UP Trend ////

GfxSetTextColor( colorYellow);
GfxTextOut((“100 Days  ” ),405,y-7);
GfxSetTextColor( colorLime);
GfxTextOut(( ”  ”  + WriteIf (TEM100 > 0 AND TEM100 < 0.3,     “WEAK UP TREND” , ” “)), 460, y-7);
GfxSetTextColor( colorBrightGreen);
GfxTextOut(( ”  ”  + WriteIf (TEM100 >= 0.3 AND TEM100 < 0.6,  “MEDIUM UP TREND” , ” “)), 460, y-7);
GfxSetTextColor( colorGreen);
GfxTextOut(( ”  ”  + WriteIf  (TEM100 >= 0.6,              “BUY BUY BUY” , ” “)),460, y-7);

///////100 Days Down Trend////

GfxSetTextColor( colorOrange);
GfxTextOut(( ”  ”  + WriteIf (TEM100<0 AND TEM100> -0.3,        “WEAK DOWN TREND” , ” “)), 460, y-7);
GfxSetTextColor( colorPink);
GfxTextOut(( ”  ”  + WriteIf (TEM100<= -0.3 AND TEM100 > -0.6, “MEDIUM DOWN TREND” , ” “)),460, y-7);
GfxSetTextColor( colorRed);
GfxTextOut(( ”  ”  + WriteIf(TEM100 <= -0.6,                 “SELL SELL SELL” , ” “)), 460, y-7);
GfxSetTextColor( colorWhite);
GfxTextOut(( ”  ”  + WriteIf(NOT TEM100 > 0 AND TEM100 < 0.3 AND NOT TEM100 >= 0.3 AND TEM100 < 0.6 AND NOT TEM100 >= 0.6 AND NOT TEM100<0 AND TEM100> -0.3 AND NOT TEM100 <= -0.3 AND TEM100> -0.6 AND NOT TEM100 <= -0.6 , ”  SIDEWAYS” , “”)),460, y-7);

///////200 Days UP Trend ////

GfxSetTextColor( colorYellow);
GfxTextOut((“200 Days  ” ),600,y-7);
GfxSetTextColor( colorLime);
GfxTextOut(( ”  ”  + WriteIf (TEM200 > 0 AND TEM200 < 0.3,     “WEAK UP TREND” , ” “)), 655, y-7);
GfxSetTextColor( colorBrightGreen);
GfxTextOut(( ”  ”  + WriteIf (TEM200 >= 0.3 AND TEM200 < 0.6,  “MEDIUM UP TREND” , ” “)), 655, y-7);
GfxSetTextColor( colorGreen);
GfxTextOut(( ”  ”  + WriteIf  (TEM200 >= 0.6,              “BUY BUY BUY” , ” “)),655,y-7);

///////200 Days Down Trend////

GfxSetTextColor( colorOrange);
GfxTextOut(( ”  ”  + WriteIf (TEM200<0 AND TEM200> -0.3,        “WEAK DOWN TREND” , ” “)), 655, y-7);
GfxSetTextColor( colorPink);
GfxTextOut(( ”  ”  + WriteIf (TEM200<= -0.3 AND TEM200 > -0.6, “MEDIUM DOWN TREND” , ” “)), 655, y-7);
GfxSetTextColor( colorRed);
GfxTextOut(( ”  ”  + WriteIf(TEM200 <= -0.6,                 “SELL SELL SELL” , ” “)), 655, y-7);
GfxSetTextColor( colorWhite);
GfxTextOut(( ”  ”  + WriteIf(NOT TEM200 > 0 AND TEM200 < 0.3 AND NOT TEM200 >= 0.3 AND TEM200 < 0.6 AND NOT TEM200 >= 0.6 AND NOT TEM200<0 AND TEM200> -0.3 AND NOT TEM200 <= -0.3 AND TEM200> -0.6 AND NOT TEM200 <= -0.6 , ”  SIDEWAYS” , “”)), 655, y-7);
_SECTION_END();
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////EMA//////////////////////////////////////////

_SECTION_BEGIN(“Price”);
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat(“{{NAME}} – {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}”, O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, “Close”, ParamColor(“Color”, colorDefault ), styleNoTitle | ParamStyle(“Style”) | GetPriceStyle() );
_SECTION_END();

_SECTION_BEGIN(“Signal Panel”);
no=10;
res=HHV(H,no);
sup=LLV(L,no);
avd=IIf(C>Ref(res,-1),1,IIf(C<Ref(sup,-1),-1,0));
avn=ValueWhen(avd!=0,avd,1);
s5d=IIf(avn==1,sup,res);

showsl = ParamToggle(“Stop Loss Line”, “Show|Hide”, 0);
if (showsl == 1)
{Plot(s5d,”Stop Loss”,colorCustom14,styleDots);}

exitlong = Cross(s5d, H);
PlotShapes(exitlong * shapeNone, colorBlack,0,H,-10);
exitshort = Cross(L, s5d);
PlotShapes(exitshort * shapeNone, colorBlack,0,L,-15);

Buy = exitshort;
Sell = exitlong;

Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);

for(i=BarCount-1;i>1;i–)
{
if(Buy[i] == 1)
{
entry = H[i];
sig = “BUY”;
sl = s5d[i];
tar1 = entry + (entry * .0050);
tar2 = entry + (entry * .0092);
tar3 = entry + (entry * .0179);

bars = i;
i = 0;
}
if(Sell[i] == 1)
{
sig = “SELL”;
entry = L[i];
sl = s5d[i];
tar1 = entry – (entry * .0050);
tar2 = entry – (entry * .0112);
tar3 = entry – (entry * .0212);

bars = i;
i = 0;
}
}
Offset = 5;
Clr = IIf(sig == “BUY”, colorLime, colorRed);
ssl = IIf(bars == BarCount-1, s5d[BarCount-1], Ref(s5d, -1));
sl = ssl[BarCount-1];

Plot(LineArray(bars-Offset, tar1, BarCount, tar1,1), “”, Clr, styleLine|styleDots, Null, Null, Offset);
Plot(LineArray(bars-Offset, tar2, BarCount, tar2,1), “”, Clr, styleLine|styleDots, Null, Null, Offset);
Plot(LineArray(bars-Offset, tar3, BarCount, tar3,1), “”, Clr, styleLine|styleDots, Null, Null, Offset);
Plot(LineArray(bars-Offset, sl, BarCount, sl,1), “”, colorWhite, styleLine|styleThick, Null, Null, Offset);
Plot(LineArray(bars-Offset, entry, BarCount, entry,1), “”, colorLightGrey, styleLine|styleDashed, Null, Null, Offset);
PlotShapes(IIf(Buy, shapeSmallCircle, shapeNone),colorWhite, 0, L, Offset=-30);
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-15);
PlotShapes(IIf(Sell, shapeSmallCircle, shapeNone),colorYellow, 0,H, Offset=30);
PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorYellow, 0,H, Offset=-15);
for (i=bars; i <BarCount;i++)
{

PlotText (“TRAIL SL”,BarCount-2,sl,Null,colorRed);

}