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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
_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(LinRegSlopeEMA(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