Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

ALL Moving Averages (Revised) for Amibroker (AFL)

Rating:
4 / 5 (Votes 5)
Tags:
amibroker, moving average

This AFL is a revised version of old one which i had already posted in this site month back. This AFL is for those friends who are not able to view complete output of All Moving Averages due to screen resolution. I had made bit changes in calculations too for more accuracy. Hope you like my AFL.

Screenshots

Indicator / Formula

Copy & Paste Friendly
_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//////////////////////////////////////////

5 comments

1. kv_maligi

Very Good

2. trueind

good

3. Dr.Nagaraj

Sir,
Very useful afl. But, I am not able to view anything on the screen except the boxes. I am managing only with them. It is the same with both the afl versions. I am using Amibroker 5.6.
Please do the needful.
thanking you,
Dr.Nagaraj

4. abdelazeem

goooooooooooooooood

5. azmak

Its not working, I can see only the boxes

Leave Comment

Please login here to leave a comment.

Back