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

YOGYA TRADING GUIDE for Amibroker (AFL)

Rating:
5 / 5 (Votes 7)
Tags:
amibroker

To use this system perfectly you have to add following ticker in your database or else change the ribbon code according to your nifty and sector ticker.

Cnx Nifty
Cnx Auto
Cnx Bank
Bse Capital Goods
Bse Consumer Durables
Cnx Energy
Cnx Finance
Cnx Fmcg
Cnx It
Cnx Media
Cnx Metal
Cnx Pharma
Cnx Realty

For any other query please contact akmeheta@gmail.com

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
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
Title = "";
_SECTION_BEGIN("Text Toggle");
Alledit = ParamToggle("All Text", "Show|Hide",0);
Heading = ParamToggle("Heading", "Show|Hide",0);
Fullsymbol = ParamToggle("Name/Industry", "Show|Hide",0);
Datetime1 = ParamToggle("Date/Ltp", "Show|Hide",0);
Datetime2 = ParamToggle("Today Action", "Show|Hide",1);
Day1 = ParamToggle("Day Separator", "Show|Hide",1);
 
/*Candle Stick Chart For Stock*/
_SECTION_BEGIN("Basics");
/*One Candle Price Action And Body Color*/
Ygbody=C>=O; //First Candle Green
Yrbody=C<O; // First Candle Red
Ygbody1 = Ref(C,-1) >= Ref(O, -1); // Second Candle Green
Yrbody1 = Ref(C,-1) < Ref(O, -1); // Second Candle Red
Ygbody2 = Ref(C,-2) >= Ref(O, -2); // Third Candle Green
Yrbody2 = Ref(C,-2) < Ref(O, -2); // Third Candle Red
 
Yocspread = abs(O-C);// Body Of The First Candle
Yhlspread = (H-L); // Length Of The First Candle
Yocspread1 = abs(Ref(O,-1)- Ref(C, -1));// Body Of The Second Candle
Yhlspread1 = Ref(H, -1)- Ref(L,-1); // Length Of The First Candle
Yocspread2 =abs(C-(Ref(O,-1))); // Body Of First And Second Candle
Yhlspread2= Max(H, Ref(H,-1))-Min(L,Ref(L,-1)); //Length Of First And Second Candle
 
Ygapup = Open >Ref(Close,-1); // Gap Up In First Candle
Ygapdown= Open < Ref(Close, -1);// Gap Down In First Candle
Ygapup1 = Ref(Open,-1) >Ref(Close,-2); // Gap Up In First Candle
Ygapdown1= Ref(Open, -1) < Ref(Close, -2);// Gap Down In First Candle
 
Ybiggapup = Low > Ref(H, -1); // First Candle Low Is Greater Than Second Candle High
Ybiggapdown = High < Ref(L, -1); // First Candle High Is Less Than Second Candle Low
Ybiggapup1 = Ref(Low, -1) > Ref(H, -2); // Second Candle Low Is Greater Than Third Candle High
Ybiggapdown1 = Ref(High, -1) < Ref(L, -2); //Second Candle High Is Less Than Third Candle Low
Ybiggapup2 = Ref(Low, -2) > Ref(H, -3); // Third Candle Low Is Greater Than Fourth Candle High
Ybiggapdown2 = Ref(High, -2) < Ref(L, -3); //Third Candle High Is Less Than Fourth Candle Low
 
 
Ypclose = C>=Ref(C,-1); // Gain In First Candle
Ynclose = C < Ref(C,-1); //Loss In First Candle
Ypclose1 =Ref(C, -1) >=Ref(C,-2); // Gain In Second Candle
Ynclose1 = Ref(C, -1) < Ref(C,-1); //Loss In Second Candle
 
Ybopen = (O >= (Ref(High,-1)+Ref(Low,-1))/2) AND Yrbody1; // Bullish Open First Candle
Ybeopen = (O < (Ref(High,-1)+Ref(Low,-1))/2) AND Ygbody1; // Bearish Open First Candle
Yexbopen = O > Ref(H,-1); // Extreme Bullish Open First Candle
Yexbeopen = O < Ref(L,-1); // Extreme Bearish Open First Candle
 
Ybclose = C > Ref(H, -1); // Bullish Close First Candle
Ybeclose = C < Ref (L, -1); // Bearish Close First Candle
Ybclose1 = Ref(C, -1) > Ref(H, -2); // Bullish Close Second Candle
Ybeclose1 = Ref(C, -1) < Ref (L, -2); // Bearish Close Second Candle
 
 
 
Yaverage5 = Ref(MA(H, 5), -1) - Ref(MA(L, 5), -1); // Average Lenth Of Five Candle
 
_SECTION_END();
 
 
_SECTION_BEGIN("Parameters");
Ycandledays = Param( "Candle Days", 23, 5, 50000 ); // Candle Days To Determine High-Low
Ypricefield = ParamField("Price Field",0); // Price Field: 0 - Returns Open Array, 1 - Returns High Array, 2 - Returns Low Array, 3 - Returns Close Array (Default), 4 - Returns Average Array = (H+L+C)/3, 5 - Returns Volume Array, 6 - Returns Open Interest Array
 
 
/* Close Type */
Yexbclose = C>= (L+Yhlspread*0.8) ; // Bullish Close(Closed At Upper End Of The Candle)
Yexbeclose = C<=(L+Yhlspread*0.2) ; // Bearish Close(Closed At Lower End Of The Candle)
 
Yexbclose1 = C>= (L+Yhlspread*0.8) AND Ypclose ; // Bullish Close(Closed At Upper End Of The Candle)
Yexbeclose1 = C<=(L+Yhlspread*0.2) AND Ynclose ; // Bearish Close(Closed At Lower End Of The Candle)
 
Ynuclose =  (Yexbclose1==0 AND Yexbeclose1==0);// Neutral Close
 
_SECTION_END();
 
 
 
 
/*Candle At Top(Bearish Reversal) Or Candle At Resistance(Bearish Reversal)*/
Topresistance = HHV(Ypricefield, Ycandledays)== Max(Ypricefield, Ref(Ypricefield, -1));
 
Yabandonedbabybearish= (Ygbody2 AND Ybiggapup1 AND Ybiggapdown AND Topresistance);
 
Ybelowthestomach= (Ybeopen AND Ybclose1 AND Yrbody AND Topresistance);
 
Ybeltholdbearish = (Yexbopen AND Yrbody AND Topresistance);
 
Ybreakawaybearish = (Ybeopen AND Ybeclose AND Topresistance);
 
Ydarkcloudcover= (Ygapup AND Ygbody1 AND Ynclose AND Topresistance);
 
Yengulfingbearish= (Ygapup AND Ygbody1 AND Ybeclose AND Topresistance);
 
Yeveningstar= (Ygbody2 AND Ygapup1 AND Ygapdown AND Ybeclose AND Topresistance) ;
 
Yharamibearish = (Ygapdown AND Ygbody1 AND Yrbody AND Topresistance);
 
Ykickingbearish = (Ygbody1 AND Yexbeopen AND Yrbody AND Topresistance);
 
Yshootingstar= (Ygapup AND (Yocspread/Yhlspread) < 0.3  AND Yexbeclose AND Topresistance);
 
Ytristarbearish= (Ybiggapup2 AND Ybiggapup1 AND Ybiggapdown AND Topresistance);
 
Ydojibearish= ((Yocspread/Yhlspread) < 0.1 AND Topresistance);
 
Ydojibearishyesterday= ((Yocspread1/Yhlspread1) < 0.1 AND Topresistance);
 
Yonebarbearishwick= ((Yocspread/Yhlspread)< 0.25 AND Yexbeclose AND Topresistance);
 
Ytwobarbearishwick= ((Yocspread2/Yhlspread2)< 0.25 AND Yexbeclose AND Topresistance);
 
Ytheextremereversalbearish = ((Yhlspread/Yaverage5) > 3.5 AND C<= (L +Yhlspread*0.7) AND Topresistance);
 
Ytopcandlebearish = (Yrbody AND Topresistance);
 
 
/*Candle At Bottom(Bullish Reversal) Or Candle At Support(Bullish Reversal)*/
 
Bottomsupport = LLV(Ypricefield, Ycandledays)== Min(Ypricefield, Ref(Ypricefield, -1));
 
Yabandonedbabybullish= (Yrbody2 AND Ybiggapdown1 AND Ybiggapup AND Bottomsupport);
 
Yabovethestomach= (Ybopen AND Ybeclose1 AND Ygbody AND Bottomsupport);
 
Ybeltholdbullish = (Yexbeopen AND Ygbody AND Bottomsupport);
 
Ybreakawaybullish = (Ybopen AND Ybclose AND Bottomsupport);
 
Yengulfingbullish= (Ygapdown AND Yrbody AND Ybclose AND Bottomsupport);
 
Yhammer= (Ygapdown AND (Yocspread/Yhlspread) < 0.3 AND Yexbclose AND Bottomsupport);
 
Yharamibullish = (Ygapup AND Yrbody1 AND Ygbody AND Bottomsupport);
 
Ykickingbullish = (Yrbody1 AND Yexbopen AND Ygbody AND Bottomsupport);
 
Ymorningstar= (Yrbody2 AND Ygapdown1 AND Ygapup AND Ybclose AND Bottomsupport) ;
 
Ypiercingpattern= (Ygapdown AND Yrbody1 AND Ypclose AND Bottomsupport);
 
Ytristarbullish= (Ybiggapdown2 AND Ybiggapdown1 AND Ybiggapup AND Bottomsupport);
 
Ydojibullish= ((Yocspread/Yhlspread) < 0.1 AND Bottomsupport);
 
Ydojibullishyesterday= ((Yocspread1/Yhlspread1) < 0.1 AND Bottomsupport);
 
Yonebarbullishwick= ((Yocspread/Yhlspread)< 0.25 AND Yexbclose AND Bottomsupport);
 
Ytwobarbullishwick= ((Yocspread2/Yhlspread2)< 0.25 AND Yexbclose AND Bottomsupport);
 
Ytheextremereversalbullish = ((Yhlspread/Yaverage5) > 3.5 AND C>= (L +Yhlspread*0.4) AND Bottomsupport);
 
Ybottomcandlebullish = (Ygbody AND Bottomsupport);
 
/*Candle At Top Breakout*/
Ytopbreak = Ypricefield >= Ref(HHV(Ypricefield, Ycandledays), -1);
Yheavyvolume = Volume >= Ref(HHV(Volume, Ycandledays), -1);
Ytopbreakout1= Ygapup AND Ygbody AND Ytopbreak AND Yheavyvolume;
Ytopbreakout2= Ygapdown AND Ygbody AND Ytopbreak AND Ybclose;
 
 
/*Candle At Bottom Breakout*/
Ybottombreak = Ypricefield <= Ref(LLV(Ypricefield, Ycandledays), -1);
Ybottombreakout1 = Ygapdown AND Yrbody AND Ybottombreak;
Ybottombreakout2 = Ygapup AND Yrbody AND Ybottombreak AND Ybclose;
 
 
/* Candle At Top Fuctions*/
function Candlepattern(R)
   {
   global Candlereversalpattern;
   if(R == 0) { Candlereversalpattern =  "Abandoned Baby Bearish";Candleattopformula = (Yabandonedbabybearish);}
   else if(R == 1) { Candlereversalpattern =  "Belowthe Stomach";Candleattopformula = (Ybelowthestomach);}
   else if(R == 2) { Candlereversalpattern =  "Belthold Bearish";Candleattopformula = (Ybeltholdbearish);}
   else if(R == 3) { Candlereversalpattern =  "Breakaway Bearish";Candleattopformula =(Ybreakawaybearish);}
   else if(R == 4) { Candlereversalpattern =  "Engulfing Bearish";Candleattopformula = (Yengulfingbearish);}
   else if(R == 5) { Candlereversalpattern =  "Darkcloud Cover";Candleattopformula = (Ydarkcloudcover);}
   else if(R == 6) { Candlereversalpattern =  "Evening Star"; Candleattopformula =(Yeveningstar);}
   else if(R == 7) { Candlereversalpattern =  "Harami Bearish";Candleattopformula =(Yharamibearish);}
   else if(R == 8) { Candlereversalpattern =  "Kicking Bearish";Candleattopformula = (Ykickingbearish);}
   else if(R == 9) { Candlereversalpattern =  "Shooting Star";Candleattopformula = (Yshootingstar);}
   else if(R == 10) { Candlereversalpattern =  "Tristar Bearish";Candleattopformula =(Ytristarbearish);}
   else if(R == 11) { Candlereversalpattern =  "Onebar Bearish Wick";Candleattopformula =(Yonebarbearishwick);}
   else if(R == 12) { Candlereversalpattern =  "Doji Bearish First Candle";Candleattopformula =(Ydojibearish);}
   else if(R == 13) { Candlereversalpattern =  "Doji Bearish Second Candle";Candleattopformula =(Ydojibearishyesterday);}
   else if(R == 14) { Candlereversalpattern =  "Twobar Bearish Wick"; Candleattopformula = (Ytwobarbearishwick);}
   else if(R == 15) { Candlereversalpattern =  "Extreme Reversal Bearish"; Candleattopformula =(Ytheextremereversalbearish);}
   else if(R == 16) { Candlereversalpattern =  "Top Candle Bearish";Candleattopformula = (Ytopcandlebearish);}
   else if(R == 17) { Candlereversalpattern =  "Abandoned Baby Bullish";Candleattopformula = (Yabandonedbabybullish);}
   else if(R == 18) { Candlereversalpattern =  "Above The Stomach";Candleattopformula = (Yabovethestomach);}
   else if(R == 19) { Candlereversalpattern =  "Belthold Bullish";Candleattopformula = (Ybeltholdbullish);}
   else if(R == 20) { Candlereversalpattern =  "Breakaway Bullish";Candleattopformula =(Ybreakawaybullish);}
   else if(R == 21) { Candlereversalpattern =  "Engulfing Bullish";Candleattopformula = (Yengulfingbullish);}
   else if(R == 22) { Candlereversalpattern =  "Piercing Pattern";Candleattopformula = (Ypiercingpattern);}
   else if(R == 23) { Candlereversalpattern =  "Morning Star"; Candleattopformula =(Ymorningstar);}
   else if(R == 24) { Candlereversalpattern =  "Harami Bullish";Candleattopformula =(Yharamibullish);}
   else if(R == 25) { Candlereversalpattern =  "Kicking Bullish";Candleattopformula = (Ykickingbullish);}
   else if(R == 26) { Candlereversalpattern =  "Hammer";Candleattopformula = (Yhammer);}
   else if(R == 27) { Candlereversalpattern =  "Tristar Bullish";Candleattopformula =(Ytristarbullish);}
   else if(R == 28) { Candlereversalpattern =  "Onebar Bullish Wick";Candleattopformula =(Yonebarbullishwick);}
   else if(R == 29) { Candlereversalpattern =  "Doji Bullish First Candle";Candleattopformula =(Ydojibullish);}
   else if(R == 30) { Candlereversalpattern =  "Doji Bullish Second Candle";Candleattopformula =(Ydojibullishyesterday);}
   else if(R == 31) { Candlereversalpattern =  "Twobar Bullish Wick"; Candleattopformula = (Ytwobarbullishwick);}
   else if(R == 32) { Candlereversalpattern =  "Extreme Reversal Bullish"; Candleattopformula =(Ytheextremereversalbullish);}
   else if(R == 33) { Candlereversalpattern =  "Bottom Candle Bullish";Candleattopformula = (Ybottomcandlebullish);}
 
return Candleattopformula;
   }
 
Candlereversalpatternlist = "";    
for(Cr=0; Cr<=46; Cr++)     
    {  
    VarSet("Pattern"+NumToStr(Cr,1.0),Candlepattern(Cr));  
    Candlereversalpatternlist = Candlereversalpatternlist + Candlereversalpattern + ",";   
    }  
         
Bi = BarIndex();       
Selectedbar = SelectedValue(Bi) -Bi[0];    
//Selecredbar = Status("Lastvisiblebar")-1;    
Candlereversal="";     
for(Cr=0; Cr<=46; Cr++)     
    {  
    Temp = VarGet("Pattern"+NumToStr(Cr,1.0)); 
    if(Temp[Selectedbar]) Candlereversal = Candlereversal+" " + NumToStr(Cr,1.0) + "-" + StrExtract(Candlereversalpatternlist,Cr)+","
    } //Output = Candlereversal
 
 
/* Candle At Break Fuctions*/
function Candlebreakout(Bo)
   {
   global Candlebreakoutpattern;
   if(Bo == 0) { Candlebreakoutpattern =  "Top Breakout";Candleatbreakformula = (Ytopbreakout1);}
   else if(Bo == 1) { Candlebreakoutpattern =  "Top Breakout";Candleatbreakformula = (Ytopbreakout2);}
   else if(Bo == 2) { Candlebreakoutpattern =  "Bottom Breakout";Candleatbreakformula = (Ybottombreakout1);}
   else if(Bo == 3) { Candlebreakoutpattern =  "Bottom Breakout";Candleatbreakformula =(Ybottombreakout2);}
 
 
return Candleatbreakformula;
   }
 
Candlebreakoutpatternlist = "";    
for(Bc=0; Bc<=4; Bc++)      
    {  
    VarSet("Pattern"+NumToStr(Bc,1.0),Candlebreakout(Bc)); 
    Candlebreakoutpatternlist = Candlebreakoutpatternlist + Candlebreakoutpattern + ",";   
    }  
         
Bi = BarIndex();       
Selebcedbar = SelectedValue(Bi) -Bi[0];    
//Selebcedbar = Status("Lastvisiblebar")-1;    
Candleatbreak="";      
for(Bc=0; Bc<=4; Bc++)      
    {  
    Temp = VarGet("Pattern"+NumToStr(Bc,1.0)); 
    if(Temp[Selectedbar]) Candleatbreak = Candleatbreak+" " + NumToStr(Bc,1.0) + "-" + StrExtract(Candlebreakoutpatternlist,Bc)+",";   
    }//Output = Candleatbreak
/* Close Type */
Ctype =
WriteIf(Yexbclose1, "Bullish Close",
WriteIf(Yexbeclose1, "Bearish Close",
WriteIf(Ynuclose, "Neutral Close","")));
 
 
/*Candle At Top(Bearish Reversal) Or Candle At Resistance(Bearish Reversal)*/
Tcandle =
WriteIf(Yabandonedbabybearish, "Abandoned Baby Bearish",
WriteIf(Ybelowthestomach, "Belowthe Stomach",
WriteIf(Ybeltholdbearish, "Belthold Bearish",
WriteIf(Ybreakawaybearish, "Breakaway Bearish",
WriteIf(Ydarkcloudcover, "Darkcloud Cover",
WriteIf(Yengulfingbearish, "Engulfing Bearish",
WriteIf(Yeveningstar, "Evening Star",
WriteIf(Yharamibearish, "Harami Bearish",
WriteIf(Ykickingbearish, "Kicking Bearish",
WriteIf(Yshootingstar, "Shooting Star",
WriteIf(Ytristarbearish, "Tristar Bearish",
WriteIf(Ydojibearish, "Doji Bearish First Candle",
WriteIf(Ydojibearishyesterday, "Doji Bearish Second Candle",
WriteIf(Yonebarbearishwick, "Onebar Bearish Wick",
WriteIf(Ytwobarbearishwick, "Twobar Bearish Wick",
WriteIf(Ytheextremereversalbearish, "Extreme Reversal Bearish",
WriteIf(Ytopcandlebearish, "Top Candle Bearish",
 
 
/*Candle At Bottom(Bullish Reversal) Or Candle At Support(Bullish Reversal)*/
 
WriteIf(Yabandonedbabybullish, "Abandoned Baby Bullish",
WriteIf(Yabovethestomach, "Above The Stomach",
WriteIf(Ybeltholdbullish, "Belthold Bullish",
WriteIf(Ybreakawaybullish, "Breakaway Bullish",
WriteIf(Ypiercingpattern, "Piercing Pattern",
WriteIf(Yengulfingbullish, "Engulfing Bullish",
WriteIf(Ymorningstar, "Morning Star",
WriteIf(Yharamibullish, "Harami Bullish",
WriteIf(Ykickingbullish, "Kicking Bullish",
WriteIf(Yhammer, "Hammer",
WriteIf(Ytristarbullish, "Tristar Bullish",
WriteIf(Ydojibullish, "Doji Bullish First Candle",
WriteIf(Ydojibullishyesterday, "Doji Bullish Second Candle",
WriteIf(Yonebarbullishwick, "Onebar Bullish Wick",
WriteIf(Ytwobarbullishwick, "Twobar Bullish Wick",
WriteIf(Ytheextremereversalbullish, "Extreme Reversal Bullish",
WriteIf(Ybottomcandlebullish, "Bottom Candle Bullish",""))))))))))))))))))))))))))))))))));
 
/*Candle At Top Breakout*/
Breakoutcandle =
WriteIf(Ytopbreakout1, "Top Breakout Gapup",
WriteIf(Ytopbreakout2, "Top Breakout Gapdown",
 
/*Candle At Bottom Breakout*/
WriteIf(Ybottombreakout1, "Bottom Breakout Gapdown",
WriteIf(Ybottombreakout2, "Bottom Breakout Gapup",""))));
 
 
 
Filter = 1;
 
Tcandlec =  IIf( Yabandonedbabybearish OR Ybelowthestomach OR Ybeltholdbearish OR Ybreakawaybearish OR Ydarkcloudcover OR Yengulfingbearish OR Yeveningstar OR Yharamibearish OR Ykickingbearish OR Yshootingstar OR Ytristarbearish OR Ydojibearish OR Ydojibearishyesterday OR Yonebarbearishwick OR Ytwobarbearishwick OR Ytheextremereversalbearish OR Ytopcandlebearish, colorRed,
            IIf( Yabandonedbabybullish OR Yabovethestomach OR Ybeltholdbullish OR Ybreakawaybullish OR Ypiercingpattern OR Yengulfingbullish OR Ymorningstar OR Yharamibullish OR Ykickingbullish OR Yhammer OR Ytristarbullish OR Ydojibullish OR Ydojibullishyesterday OR Yonebarbullishwick OR Ytwobarbullishwick OR Ytheextremereversalbullish OR Ybottomcandlebullish, colorGreen, 0));
Breakoutcandlec =IIf(Ytopbreakout1 OR Ytopbreakout2, colorGreen,
           IIf(Ybottombreakout1 OR Ybottombreakout2, colorRed, 0));
 
 
 
Ctypec =    IIf(Yexbclose1, colorGreen,
           IIf(Yexbeclose1, colorRed, 0));
 
AddColumn(Close, "Close", 1.2);
AddTextColumn(Ctype, "Close Type   ", 1.0, Ctypec, colorDefault,150);
AddTextColumn(Tcandle, "Candle At Resistance   ", 1.0, Tcandlec, colorDefault,150);
AddTextColumn(Breakoutcandle, "Candle At Breakout   ", 1.0, Breakoutcandlec, colorDefault,150);
 
 
_SECTION_BEGIN("Yactions Points");
/* Actions Points */
 
/* For Intraday Only */
TimeFrameSet(inDaily);
Ypricefield= ParamField("Price Field", 0);
 
 
Yath = Ref(HHV(Ypricefield, 2500), -1); // All Time High
Yatl = Ref(LLV(Ypricefield, 2500), -1); // All Time Low
 
Y2yh = Ref(HHV(Ypricefield, 500), -1); // 2 Year High
Y2yl = Ref(LLV(Ypricefield, 500), -1); // 2 Year Low
 
Y52wh = Ref(HHV(Ypricefield, 250), -1); // 52 Week High
Y52wl = Ref(LLV(Ypricefield, 250), -1); // 52 Week Low
 
Yqh = Ref(HHV(Ypricefield, 55), -1); // Quarterly High
Yql = Ref(LLV(Ypricefield, 55), -1); // Quarterly Low
 
Ymh = Ref(HHV(Ypricefield, 21), -1); // Monthly High
Yml = Ref(LLV(Ypricefield, 21), -1); // Monthly Low
 
Yfh = Ref(HHV(Ypricefield, 10), -1); //Fortnight High
Yfl = Ref(LLV(Ypricefield, 10), -1); //Fortnight Low
 
Ywh = Ref(HHV(Ypricefield, 5), -1); // Weekly High
Ywl = Ref(LLV(Ypricefield, 5), -1); // Weekly Low
 
 
 
 
Yath1 = (C > (Yath -Yath*0.02));
Yatl1 = (C < (Yatl + Yatl*0.02));
 
Y2yh1 = (C > (Y2yh - Y2yh*0.02));
Y2yl1 = (C < (Y2yl+ Y2yl*0.02));
 
Y52wh1 = (C < (Y52wh+ Y52wh*0.015) AND C > (Y52wh - Y52wh*0.015));
Y52wl1 = (C < (Y52wl+ Y52wl*0.015) AND C > (Y52wl - Y52wl*0.015));
 
Yqh1 = (C < (Yqh+ Yqh*0.01) AND C > (Yqh - Yqh*0.01));
Yql1 = (C < (Yql+ Yql*0.01) AND C > (Yql - Yql*0.01));
 
Ymh1 = (C < (Ymh+ Ymh*0.01) AND C > (Ymh - Ymh*0.01));
Yml1 = (C < (Yml+ Yml*0.01) AND C > (Yml - Yml*0.01));
 
Yfh1 = (C < (Yfh+ Yfh*0.01) AND C > (Yfh - Yfh*0.01));
Yfl1 = (C < (Yfl+ Yfl*0.01) AND C > (Yfl - Yfl*0.01));
 
Ywh1 = (C < (Ywh+ Ywh*0.005) AND C > (Ywh - Ywh*0.005));
Ywl1 = (C < (Ywl+ Ywl*0.005) AND C > (Ywl - Ywl*0.005));
 
/* Candle At Break Fuctions*/
function Ypriceation(Pa)
   {
   global Pricetpattern;
   if(Pa ==0){Pricetpattern = "All Time High";Priceactionformula =(Yath1);}
   else if(Pa ==1){Pricetpattern = "All Time Low";Priceactionformula =(Yatl1);}
   else if(Pa ==2){Pricetpattern = "2year High" ;Priceactionformula =(Y2yh1);}
   else if(Pa ==3){Pricetpattern = "2year Low";Priceactionformula =(Y2yl1);}
   else if(Pa ==4){Pricetpattern = "52 Week High" ;Priceactionformula =(Y52wh1);}
   else if(Pa ==5){Pricetpattern = "52 Week Low" ;Priceactionformula =(Y52wl1);}
   else if(Pa ==6){Pricetpattern = "Quarterly High";Priceactionformula =(Yqh1);}
   else if(Pa ==7){Pricetpattern = "Quarterly Low";Priceactionformula =(Yql1);}
   else if(Pa ==8){Pricetpattern = "Monthly High";Priceactionformula =(Ymh1);}
   else if(Pa ==9){Pricetpattern = "Monthly Low";Priceactionformula =(Yml1);}
   else if(Pa ==10){Pricetpattern = "Fortnight High";Priceactionformula =(Yfh1);}
   else if(Pa ==11){Pricetpattern = "Fortnight Low";Priceactionformula =(Yfl1);}
   else if(Pa ==12){Pricetpattern = "Weekly High";Priceactionformula =(Ywh1);}
   else if(Pa ==13){Pricetpattern = "Weekly Low";Priceactionformula =(Ywl1);}
 
return Priceactionformula;
   }
 
Pricetpatternlist = "";
for(Pc=0; Pc<=14; Pc++)
{
VarSet("Pattern"+NumToStr(Pc,1.0),Ypriceation(Pc));
Pricetpatternlist = Pricetpatternlist + Pricetpattern + ",";
}
 
Bi = BarIndex();
Selectedbar = SelectedValue(Bi) -Bi[0];
//Selebcedbar = Status("Lastvisiblebar")-1;
Priceaction="";
for(Pc=0; Pc<=14; Pc++)
{
Temp = VarGet("Pattern"+NumToStr(Pc,1.0));
if(Temp[Selectedbar]) Priceaction = Priceaction+" " + NumToStr(Pc,1.0) + "-" + StrExtract(Pricetpatternlist,Pc)+",";
}//Output = Priceaction
 
 
 
 
Yaction =
WriteIf(Yath1, "All Time High",
WriteIf(Yatl1, "All Time Low",
 
WriteIf(Y2yh1, "2year High",
WriteIf(Y2yl1, "2year Low",
 
WriteIf(Y52wh1, "52 Week High",
WriteIf(Y52wl1, "52 Week Low",
 
WriteIf(Yqh1, "Quarterly High",
WriteIf(Yql1, "Quarterly Low",
 
WriteIf(Ymh1, "Monthly High",
WriteIf(Yml1, "Monthly Low",
 
WriteIf(Yfh1, "Fortnight High",
WriteIf(Yfl1, "Fortnight Low",
 
WriteIf(Ywh1, "Weekly High",
WriteIf(Ywl1, "Weekly Low", ""))))))))))))));
 
TimeFrameRestore();
Filter = 1;
 
Yactionc = IIf(Yath1 OR Y2yh1 OR Y52wh1 OR Yqh1 OR Ymh1 OR Yfh1 OR Ywh1 , colorGreen,
      IIf(Yatl1 OR Y2yl1 OR Y52wl1 OR Yql1 OR Yml1 OR Yfl1 OR Ywl1, colorRed, 0));
 
AddTextColumn(Yaction, "Price Actions", 1.0, Yactionc, colorDefault,150);
_SECTION_END();
 
/* Volume Filter */
TimeFrameSet(inDaily);
Yathv = Ref(HHV(Volume,2500),-1);
Y52whv = Ref(HHV(Volume,250),-1);
Yqhv = Ref(HHV(Volume,65),-1);
Ymhv = Ref(HHV(Volume,23),-1);
 
 
Yathv1= Volume > Yathv;
Y52whv1= Volume > Y52whv;
Yqhv1= Volume > Yqhv;
Ymhv1= Volume > Ymhv;
 
Yvolume =
WriteIf(Yathv1,"All Time High Volume",
WriteIf(Y52whv1,"52 Week High Volume",
WriteIf(Yqhv1,"Quarterly High Volume",
WriteIf(Ymhv1,"Monthly High Volume",""))));
 
Yvolumec = IIf( Yathv1 OR Y52whv1 OR Yqhv1 OR Ymhv1, colorGreen,0);
 
/* Candle At Break Fuctions*/
function Dvolumefilter(Vo)
   {
   global Dvolumefilterpattern;
   if(Vo == 0) { Dvolumefilterpattern =  "All Time High Volume";Dvolumeformula = (Yathv1);}
   else if(Vo == 1) { Dvolumefilterpattern =  "52 Week High Volume";Dvolumeformula = (Y52whv1);}
   else if(Vo == 2) { Dvolumefilterpattern =  "Quarterly High Volume";Dvolumeformula = (Yqhv1);}
   else if(Vo == 3) { Dvolumefilterpattern =  "Monthly High Volume";Dvolumeformula =(Ymhv1);}
 
 
return Dvolumeformula;
   }
 
Dvolumefilterpatternlist = "";     
for(Vc=0; Vc<=4; Vc++)      
    {  
    VarSet("Pattern"+NumToStr(Vc,1.0),Dvolumefilter(Vc));  
    Dvolumefilterpatternlist = Dvolumefilterpatternlist + Dvolumefilterpattern + ",";  
    }  
         
Bi = BarIndex();       
Selectedbar = SelectedValue(Bi) -Bi[0];    
//Selebcedbar = Status("Lastvisiblebar")-1;    
Dvolume="";    
for(Vc=0; Vc<=4; Vc++)      
    {  
    Temp = VarGet("Pattern"+NumToStr(Vc,1.0)); 
    if(Temp[Selectedbar]) Dvolume = Dvolume+" " + NumToStr(Vc,1.0) + "-" + StrExtract(Dvolumefilterpatternlist,Vc)+",";
    }//Output = Dvolume
 
 
 
TimeFrameRestore();
 
 
Filter = 1;
SetOption("Nodefaultcolumns", False );
AddTextColumn(Yvolume, "Volume Filter", 1.0, Yvolumec, colorDefault,170);
 
if(Alledit==0)
{
_SECTION_BEGIN("STOCK Ribbon");
RIBBON5 = ParamToggle("RIBBON", "Show|Hide",0);
if(RIBBON5==0)
{
Yrgbody=C>=O; //First Candle Green
Yrrbody=C<O; // First Candle Red
Yrhlspread1 = Ref(H, -1)- Ref(L,-1); // Length Of The First Candle
Yrbclose = C > (Ref(C, -1)+ Yrhlspread1*0.38); // Bullish Close
Yrbeclose = C < (Ref (C, -1) - Yrhlspread1*0.38); // Bearish Close
Yrrbclose = C > Ref(H, -1); // Bullish Close First Candle
Yrrbeclose = C < Ref (L, -1); // Bearish Close First Candle
 
Uptrend=Yrbclose AND Yrgbody AND Yrrbclose ;
Downtrend=Yrbeclose AND Yrrbody AND Yrrbeclose;
 
Plot( 1.5, /* Defines The Height Of The Ribbon In Percent Of Pane Width*/"Ribbon",IIf( Uptrend, colorGreen, IIf( Downtrend, colorRed, 0 )), /* Choose Color */styleOwnScale|styleArea|styleNoLabel, -7.5, 100 );
 
Text = "Stock Ribbon";
 
GfxSelectFont("Tahoma", Status("Pxheight")/75 );
GfxSetTextAlign(0);// Center Alignment
GfxSetTextColor( colorBlue );
GfxSetBkMode(2);
GfxTextOut( "Ribbon: "+Name(), Status("Pxwidth")/1.15, Status("Pxheight")/1.12 );
 
 
Yrs =SectorID();
 
if (Yrs==1)
{
Yfsopen = Foreign("Cnx Auto", "O");
Yfshigh = Foreign("Cnx Auto", "H");
Yfslow = Foreign("Cnx Auto", "L");
Yfsclose = Foreign("Cnx Auto", "C");
Text2 = "Ribbon: Auto";
}
else if (Yrs==4)
{
Yfsopen = Foreign("Cnx Bank", "O");
Yfshigh = Foreign("Cnx Bank", "H");
Yfslow = Foreign("Cnx Bank", "L");
Yfsclose = Foreign("Cnx Bank", "C");
Text2 = "Ribbon: Bank";
}
else if (Yrs==6)
{
Yfsopen = Foreign("Bse Capital Goods", "O");
Yfshigh = Foreign("Bse Capital Goods", "H");
Yfslow = Foreign("Bse Capital Goods", "L");
Yfsclose = Foreign("Bse Capital Goods", "C");
Text2 = "Ribbon: Capital Goods";
}
else if (Yrs==27)
{
Yfsopen = Foreign("Bse Capital Goods", "O");
Yfshigh = Foreign("Bse Capital Goods", "H");
Yfslow = Foreign("Bse Capital Goods", "L");
Yfsclose = Foreign("Bse Capital Goods", "C");
Text2 = "Ribbon: Capital Goods";
}
else if (Yrs==7)
{
Yfsopen = Foreign("Bse Consumer Durables", "O");
Yfshigh = Foreign("Bse Consumer Durables", "H");
Yfslow = Foreign("Bse Consumer Durables", "L");
Yfsclose = Foreign("Bse Consumer Durables", "C");
Text2 = "Ribbon: Consumer Durables";
}
else if (Yrs==8)
{
Yfsopen = Foreign("Bse Consumer Durables", "O");
Yfshigh = Foreign("Bse Consumer Durables", "H");
Yfslow = Foreign("Bse Consumer Durables", "L");
Yfsclose = Foreign("Bse Consumer Durables", "C");
Text2 = "Ribbon: Consumer Durables";
}
else if (Yrs==10)
{
Yfsopen = Foreign("Cnx Energy", "O");
Yfshigh = Foreign("Cnx Energy", "H");
Yfslow = Foreign("Cnx Energy", "L");
Yfsclose = Foreign("Cnx Energy", "C");
Text2 = "Ribbon: Energy";
}
else if (Yrs==11)
{
Yfsopen = Foreign("Cnx Finance", "O");
Yfshigh = Foreign("Cnx Finance", "H");
Yfslow = Foreign("Cnx Finance", "L");
Yfsclose = Foreign("Cnx Finance", "C");
Text2 = "Ribbon: Finance";
}
else if (Yrs==12)
{
Yfsopen = Foreign("Cnx Fmcg", "O");
Yfshigh = Foreign("Cnx Fmcg", "H");
Yfslow = Foreign("Cnx Fmcg", "L");
Yfsclose = Foreign("Cnx Fmcg", "C");
Text2 = "Ribbon: Fmcg";
}
else if (Yrs==15)
{
Yfsopen = Foreign("Cnx It", "O");
Yfshigh = Foreign("Cnx It", "H");
Yfslow = Foreign("Cnx It", "L");
Yfsclose = Foreign("Cnx It", "C");
Text2 = "Ribbon: It";
}
else if (Yrs==16)
{
Yfsopen = Foreign("Cnx Media", "O");
Yfshigh = Foreign("Cnx Media", "H");
Yfslow = Foreign("Cnx Media", "L");
Yfsclose = Foreign("Cnx Media", "C");
Text2 = "Ribbon: Media";
}
else if (Yrs==17)
{
Yfsopen = Foreign("Cnx Metal", "O");
Yfshigh = Foreign("Cnx Metal", "H");
Yfslow = Foreign("Cnx Metal", "L");
Yfsclose = Foreign("Cnx Metal", "C");
Text2 = "Ribbon: Metal";
}
 
else if (Yrs==13)
{
Yfsopen = Foreign("Cnx Pharma", "O");
Yfshigh = Foreign("Cnx Pharma", "H");
Yfslow = Foreign("Cnx Pharma", "L");
Yfsclose = Foreign("Cnx Pharma", "C");
Text2 = "Ribbon: Pharma";
}
 
else if (Yrs==22)
{
Yfsopen = Foreign("Cnx Realty", "O");
Yfshigh = Foreign("Cnx Realty", "H");
Yfslow = Foreign("Cnx Realty", "L");
Yfsclose = Foreign("Cnx Realty", "C");
Text2 = "Ribbon: Realty";
}
else
{
Yfsopen = O;
Yfshigh = H;
Yfslow = L;
Yfsclose = C;
Text2 = "Ribbon: STOCK";
}
 
 
SECTORRIBBON5 = ParamToggle("SECTOR RIBBON", "Show|Hide",1);
 
if(SECTORRIBBON5==0)
{
 
Yrgbody1=Yfsclose>=Yfsopen; //First Candle Green
Yrrbody1=Yfsclose<Yfsopen; // First Candle Red
Yrhlspread2 = Ref(Yfshigh, -1)- Ref(Yfslow, -1); // Length Of The First Candle
Yrbclose1 = Yfsclose > (Ref(Yfsclose, -1)+ Yrhlspread2*0.38); // Bullish Close
Yrbeclose2 = Yfsclose < (Ref (Yfsclose, -1) - Yrhlspread2*0.38); // Bearish Close
Yrrbclose1 = Yfsclose > Ref(Yfshigh,  -1); // Bullish Close First Candle
Yrrbeclose1 = Yfsclose < Ref (Yfslow,  -1); // Bearish Close First Candle
 
 
Uptrend1=Yrbclose1 AND Yrgbody1 AND Yrrbclose1 ;
Downtrend1=Yrbeclose2 AND Yrrbody1 AND Yrrbeclose1;
 
Plot( 1.5, /* Defines The Height Of The Ribbon In Percent Of Pane Width*/"Ribbon",IIf( Uptrend1, colorGreen, IIf( Downtrend1, colorRed, 0 )), /* Choose Color */styleOwnScale|styleArea|styleNoLabel, -4.5, 100 );
 
 
 
GfxSelectFont("Tahoma", Status("Pxheight")/75 );
GfxSetTextAlign(0);// Center Alignment
GfxSetTextColor( colorBlue );
GfxSetBkMode(2);
GfxTextOut( Text2, Status("Pxwidth")/1.15, Status("Pxheight")/1.08 );
}
 
Ynfsopen = Foreign("Cnx Nifty", "O");
Ynfshigh = Foreign("Cnx Nifty", "H");
Ynfslow = Foreign("Cnx Nifty", "L");
Ynfsclose = Foreign("Cnx Nifty", "C");
 
Ynrgbody1=Ynfsclose>=Ynfsopen; //First Candle Green
Ynrrbody1=Ynfsclose<Ynfsopen; // First Candle Red
Ynrhlspread2 = Ref(Ynfshigh, -1)- Ref(Ynfslow, -1); // Length Of The First Candle
Ynrbclose1 = Ynfsclose > (Ref(Ynfsclose, -1)+ Ynrhlspread2*0.38); // Bullish Close
Ynrbeclose2 = Ynfsclose < (Ref (Ynfsclose, -1) - Ynrhlspread2*0.38); // Bearish Close
Ynrrbclose1 = Ynfsclose > Ref(Ynfshigh,  -1); // Bullish Close First Candle
Ynrrbeclose1 = Ynfsclose < Ref (Ynfslow,  -1); // Bearish Close First Candle
 
 
Ynuptrend1=Ynrbclose1 AND Ynrgbody1 AND Ynrrbclose1 ;
Yndowntrend1=Ynrbeclose2 AND Ynrrbody1 AND Ynrrbeclose1;
 
Plot( 1.5, /* Defines The Height Of The Ribbon In Percent Of Pane Width*/"Ribbon",IIf( Ynuptrend1, colorGreen, IIf( Yndowntrend1, colorRed, 0 )), /* Choose Color */styleOwnScale|styleArea|styleNoLabel, -1.5, 100 );
 
Text1 = "Ribbon: Nifty";
 
 
GfxSelectFont("Tahoma", Status("Pxheight")/75);
GfxSetTextAlign(0);// Center Alignment
GfxSetTextColor( colorBlue );
GfxSetBkMode(2);
GfxTextOut( Text1, Status("Pxwidth")/1.15, Status("Pxheight")/1.05 );
}
_SECTION_END();
 
 
_SECTION_BEGIN("Full Name");
 
if(Fullsymbol==0)
{
GfxSelectFont("Tahoma", Status("Pxheight")/12 );
GfxSetTextAlign( 6 |0);// X-Direction Alignment: (Ta_Center = 6, Ta_Left = 0,Ta_Right = 2) Y-Direction Alignment(Ta_Baseline = 24, Ta_Bottom = 8, Ta_Top = 0)
GfxSetTextColor( colorDarkGrey);;
GfxSetBkMode(0); // Transparent
GfxTextOut( FullName(), Status("Pxwidth")/2, Status("Pxheight")/3 );
GfxSelectFont("Tahoma", Status("Pxheight")/24 );
GfxSetBkMode(0);
GfxTextOut( IndustryID(Mode=1), Status("Pxwidth")/2.5, Status("Pxheight")/2 );
GfxTextOut( SectorID(Mode=1), Status("Pxwidth")/1.5, Status("Pxheight")/2 );
_SECTION_END();
}
_SECTION_BEGIN("Price Message Board");
Overlaymode = ParamToggle("Overlay Mode", "Show|Hide",0);
Messageboard = ParamToggle("Message Board", "Show|Hide",0);
Messageboardtext = ParamToggle("All Price", "Show|Hide",0);
 
if(Messageboard==0)
{
 
 
if (Overlaymode==1)
{
GfxSetOverlayMode(1);
}
else if(Overlaymode==0)
 
GfxSetOverlayMode(0);
 
Yrgbody=C>=O; //First Candle Green
Yrrbody=C<O; // First Candle Red
Yrhlspread1 = Ref(H, -1)- Ref(L,-1); // Length Of The First Candle
Yrbclose = C > (Ref(C, -1)+ Yrhlspread1*0.38); // Bullish Close
Yrbeclose = C < (Ref (C, -1) - Yrhlspread1*0.38); // Bearish Close
Yrrbclose = C > Ref(H, -1); // Bullish Close First Candle
Yrrbeclose = C < Ref (L, -1); // Bearish Close First Candle
 
 
Uptrend=Yrbclose AND Yrgbody AND Yrrbclose ;
Downtrend=Yrbeclose AND Yrrbody AND Yrrbeclose;
 
 
Barssincebuy = BarsSince( Uptrend );
Barssinceshort = BarsSince( Downtrend );
Lastsignal = IIf( Barssincebuy < Barssinceshort, 1, -1 );
 
if ( SelectedValue( Lastsignal ) == 1 )
    {
        GfxSelectSolidBrush( colorDarkGreen );
    }
 else
    {
        GfxSelectSolidBrush( colorIndigo);
        }
 
Xp=Param("Horizontal Position",0,1,2400,1);
Yp=Param("Vertical Position",-15,-100,1200,1);
 
 
 
X =(Status("Pxwidth")/256)+Xp;
 
Y = (Status("Pxheight")/16)+Yp;
 
 
GfxSelectPen( colorLightBlue, 1); // Border Color
GfxSetTextAlign(0);
GfxRoundRect( X-5, Y-40,X+290, Y+40, 7, 7 ) ;
GfxRoundRect( X-5, Y+270,X+135, Y+40, 7, 7 ) ;
GfxRoundRect( X+140, Y+270,X+290, Y+40, 7, 7 ) ;
GfxSetBkMode(1);
 
 
 
 
GfxSelectFont( "Tahoma",15, 800 );
GfxSetTextColor ( colorWhite );
GfxTextOut( ( "Target Or Action Prices"),X,Y-40);
GfxTextOut( ( "Yesterday Close:"),X,Y-10);
 
 
GfxTextOut( ( "   High                 Low"),X,Y+15);
 
GfxSetTextColor ( colorYellow );
GfxSelectFont( "Tahoma", 13, 100 );
 
/* Ytarget Price*/
 
/* For Intraday Only */
Yh = TimeFrameGetPrice( "H", inDaily, -1 );
Yc = TimeFrameGetPrice( "C", inDaily, -1 );
Yl =  TimeFrameGetPrice( "L", inDaily, -1 );
 
Cqh = TimeFrameGetPrice( "H", inQuarterly, 0 );
Cql = TimeFrameGetPrice( "L", inQuarterly, 0 );
 
 
Lqh = TimeFrameGetPrice( "H", inQuarterly, -1 );
Lql = TimeFrameGetPrice( "L", inQuarterly, -1 );
 
 
Cyh = TimeFrameGetPrice( "H", inYearly, 0 );
Cyl = TimeFrameGetPrice( "L", inYearly, 0 );
 
 
Lyh = TimeFrameGetPrice( "H", inYearly, -1 );
Lyl = TimeFrameGetPrice( "L", inYearly, -1 );
 
TimeFrameSet(inDaily);
 
Lmh = Ref(HHV(H, 21), -1); // Monthly High
Lml = Ref(LLV(L, 21), -1); // Monthly Low
 
Cmh = Ref(HHV(H, 10), -1); //Fortnight High
Cml = Ref(LLV(L, 10), -1); //Fortnight Low
 
Lwh = Ref(HHV(H, 5), -1); // Weekly High
Lwl = Ref(LLV(L, 5), -1); // Weekly Low
 
 
Ath= Highest(H);
Atl= Lowest(L);
 
Ath1 =C < (Ath+ Ath*0.1) AND C > (Ath - Ath*0.1);
Lyh1 =C < (Lyh+ Lyh*0.1) AND C > (Lyh - Lyh*0.1);
Cyh1 =C < (Cyh+ Cyh*0.1) AND C > (Cyh - Cyh*0.1);
Lqh1 =C < (Lqh+ Lqh*0.1) AND C > (Lqh - Lqh*0.1);
Cqh1 = C < (Cqh+ Cqh*0.1) AND C > (Cqh - Cqh*0.1);
Lmh1 = C < (Lmh+ Lmh*0.1) AND C > (Lmh - Lmh*0.1);
Cmh1 = C < (Cmh+ Cmh*0.1) AND C > (Cmh - Cmh*0.1);
Lwh1 = C < (Lwh+ Lwh*0.1) AND C > (Lwh - Lwh*0.1);
Yh1 = C < (Yh+ Yh*0.1) AND C > (Yh - Yh*0.1);
 
Yc1 = C < (Yc+ Yc*0.1) AND C > (Yc - Yc*0.1);
 
Atl1 =C < (Atl+ Atl*0.1) AND C > (Atl - Atl*0.1);
Lyl1 =C < (Lyl+ Lyl*0.1) AND C > (Lyl - Lyl*0.1);
Cyl1 =C < (Cyl+ Cyl*0.1) AND C > (Cyl - Cyl*0.1);
Lql1 =C < (Lql+ Lql*0.1) AND C > (Lql - Lql*0.1);
Cql1 =  C < (Cql+ Cql*0.1) AND C > (Cql - Cql*0.1);
Lml1 = C < (Lml+ Lml*0.1) AND C > (Lml - Lml*0.1);
Cml1 = C < (Cml+ Cml*0.1) AND C > (Cml - Cml*0.1);
Lwl1 = C < (Lwl+ Lwl*0.1) AND C > (Lwl - Lwl*0.1);
Yl1 = C < (Yl+ Yl*0.1) AND C > (Yl - Yl*0.1);
 
 
TimeFrameRestore();
 
// Highs
GfxTextOut( ( "___________________________"),X,Y-5);
GfxTextOut( ( "___________________________"),X,Y-35);
GfxTextOut( ( "1. YH:"),X,Y+40);
GfxTextOut( ( "______________"),X,Y+45);
GfxTextOut( ( "2. 5DH:"),X,Y+65);
GfxTextOut( ( "______________"),X,Y+70);
GfxTextOut( ( "3. 10DH: "),X,Y+90);
GfxTextOut( ( "______________"),X,Y+95);
GfxTextOut( ( "4. 20DH:"),X,Y+115);
GfxTextOut( ( "______________"),X,Y+120);
GfxTextOut( ( "5. CQH:"),X,Y+140);
GfxTextOut( ( "______________"),X,Y+145);
GfxTextOut( ( "6. LQH: "),X,Y+165);
GfxTextOut( ( "______________"),X,Y+170);
GfxTextOut( ( "7. CYH: "),X,Y+190);
GfxTextOut( ( "______________"),X,Y+195);
GfxTextOut( ( "8. LYH: "),X,Y+215);
GfxTextOut( ( "______________"),X,Y+220);
GfxTextOut( ( "9. ATH: "),X,Y+240);
GfxTextOut( ( "______________"),X,Y+245);
//LOWS
GfxTextOut( ( "1. YL:"),X+145,Y+40);
GfxTextOut( ( "______________"),X+145,Y+45);
GfxTextOut( ( "2. 5DL:"),X+145,Y+65);
GfxTextOut( ( "______________"),X+145,Y+70);
GfxTextOut( ( "3. 10DL: "),X+145,Y+90);
GfxTextOut( ( "______________"),X+145,Y+95);
GfxTextOut( ( "4. 20DL:"),X+145,Y+115);
GfxTextOut( ( "______________"),X+145,Y+120);
GfxTextOut( ( "5. CQL:"),X+145,Y+140);
GfxTextOut( ( "______________"),X+145,Y+145);
GfxTextOut( ( "6. LQL: "),X+145,Y+165);
GfxTextOut( ( "______________"),X+145,Y+170);
GfxTextOut( ( "7. CYL: "),X+145,Y+190);
GfxTextOut( ( "______________"),X+145,Y+195);
GfxTextOut( ( "8. LYL: "),X+145,Y+215);
GfxTextOut( ( "______________"),X+145,Y+220);
GfxTextOut( ( "9. ATL: "),X+145,Y+240);
GfxTextOut( ( "______________"),X+145,Y+245);
 
 
if(Messageboardtext==1)
{
GfxTextOut ( ("" + WriteIf (Yh1, ""+Yh,"")), X+70,Y+40);
GfxTextOut ( ("" + WriteIf (Lwh1, ""+Lwh,"")), X+70,Y+65);
GfxTextOut ( ("" + WriteIf (Cmh1, ""+Cmh,"")), X+70,Y+90);
GfxTextOut ( ("" + WriteIf (Lmh1, ""+Lmh,"")), X+70,Y+115);
GfxTextOut ( ("" + WriteIf (Cqh1, ""+Cqh,"")), X+70,Y+140);
GfxTextOut ( ("" + WriteIf (Lqh1, ""+Lqh,"")), X+70,Y+165);
GfxTextOut ( ("" + WriteIf (Cyh1, ""+Cyh,"")), X+70,Y+190);
GfxTextOut ( ("" + WriteIf (Lyh1, ""+Lyh,"")), X+70,Y+215);
GfxTextOut ( ("" + WriteIf (Ath1, ""+Ath,"")), X+70,Y+240);
 
GfxSelectFont( "Tahoma", 15, 800 );
GfxSetTextColor ( colorWhite );
GfxTextOut ( (""+Yc), X+175,Y-10);
GfxSelectFont( "Tahoma", 13, 100 );
GfxSetTextColor ( colorYellow );
GfxTextOut ( ("" + WriteIf (Yl1, ""+Yl,"")), X+220,Y+40);
GfxTextOut ( ("" + WriteIf (Lwl1, ""+Lwl,"")), X+220,Y+65);
GfxTextOut ( ("" + WriteIf (Cml1, ""+Cml,"")), X+220,Y+90);
GfxTextOut ( ("" + WriteIf (Lml1, ""+Lml,"")), X+220,Y+115);
GfxTextOut ( ("" + WriteIf (Cql1, ""+Cql,"")), X+220,Y+140);
GfxTextOut ( ("" + WriteIf (Lql1, ""+Lql,"")), X+220,Y+165);
GfxTextOut ( ("" + WriteIf (Cyl1, ""+Cyl,"")), X+220,Y+190);
GfxTextOut ( ("" + WriteIf (Lyl1, ""+Lyl,"")), X+220,Y+215);
GfxTextOut ( ("" + WriteIf (Atl1, ""+Atl,"")), X+220,Y+240);
}
else
{
GfxTextOut ( (""+Yh), X+70,Y+40);
GfxTextOut ( (""+Lwh), X+70,Y+65);
GfxTextOut ( (""+Cmh), X+70,Y+90);
GfxTextOut ( (""+Lmh), X+70,Y+115);
GfxTextOut ( (""+Cqh), X+70,Y+140);
GfxTextOut ( (""+Lqh), X+70,Y+165);
GfxTextOut ( (""+Cyh), X+70,Y+190);
GfxTextOut ( (""+Lyh), X+70,Y+215);
GfxTextOut ( (""+Ath), X+70,Y+240); 
GfxSelectFont( "Tahoma", 15, 800 );
GfxSetTextColor ( colorWhite );
GfxTextOut ( (""+Yc), X+175,Y-10);
GfxSelectFont( "Tahoma", 13, 100 );
GfxSetTextColor ( colorYellow );
GfxTextOut ( (""+Yl), X+220,Y+40);
GfxTextOut ( (""+Lwl), X+220,Y+65);
GfxTextOut ( (""+Cml), X+220,Y+90);
GfxTextOut ( (""+Lml), X+220,Y+115);
GfxTextOut ( (""+Cql), X+220,Y+140);
GfxTextOut ( (""+Lql), X+220,Y+165);
GfxTextOut ( (""+Cyl), X+220,Y+190);
GfxTextOut ( (""+Lyl), X+220,Y+215);
GfxTextOut ( (""+Atl), X+220,Y+240);
}}
_SECTION_END();
 
 
_SECTION_BEGIN("Ltp");
if(Datetime1==0)
{
Yhor=Param("Horizontal Position",1.18,0.1,120,1);
Yver=Param("Vertical Position",15,0.1,120,1);
Yyc=TimeFrameGetPrice("C",inDaily,-1);
Ydd=Prec(C-Yyc,2);
Yxx=Prec((Ydd/Yyc)*100,2);
 
Yto=TimeFrameGetPrice("O",inDaily,0);
Ydd1=Prec(C-Yto,2);
Yxx1=Prec((Ydd1/Yto)*100,2);
 
GfxSelectFont("Tahoma", Status("Pxheight")/32 );
GfxSetTextAlign( 6 | 24 ); // Center And Baseline Alignment
GfxSetBkMode(1);
//--  ----
Bi = BarIndex();
Ii = SelectedValue( Bi ) - Bi[ 0 ];
if (C[Ii]>Yyc[Ii])
GfxSetTextColor(colorGreen);
else
GfxSetTextColor(colorRed);
//-- ---------------
GfxTextOut( "LTP: "+Close, Status("Pxwidth")/Yhor, Status("Pxheight")/Yver );
GfxSelectFont("Tahoma", Status("Pxheight")/50 );
GfxTextOut(""+Ydd+"  ("+Yxx+"%)", Status("Pxwidth")/Yhor, (Status("Pxheight")/Yver)+25 );
}
if(Datetime2==0)
{
 
if (C[Ii]>Yto[Ii])
GfxSetTextColor(colorGreen);
else
GfxSetTextColor(colorRed);
//-- ---------------
 
GfxTextOut(""+Ydd1+"  ("+Yxx1+"%)", Status("Pxwidth")/Yhor, (Status("Pxheight")/Yver)+50 );
 
}
 
 
_SECTION_END();
 
 
_SECTION_BEGIN("Day Separator");
if(Day1==0)
{
Grid_Day = Day()!=Ref(Day(),-1);
Plot(Grid_Day,"",ParamColor("Day Color",colorDarkGrey) ,styleHistogram|styleDots|styleNoLabel|styleOwnScale);
}
_SECTION_END();
 
 
 
 
 
_SECTION_BEGIN("Analysis Message Board");
if (Overlaymode==1)
{
GfxSetOverlayMode(1);
}
else if(Overlaymode==0)
 
GfxSetOverlayMode(0);
 
 
if(Messageboard==0)
{
 
Barssincebuy = BarsSince( Uptrend );
Barssinceshort = BarsSince( Downtrend );
Lastsignal = IIf( Barssincebuy < Barssinceshort, 1, -1 );
 
if ( SelectedValue( Lastsignal ) == 1 )
    {
        GfxSelectSolidBrush( colorDarkGreen );
    }
 else
    {
        GfxSelectSolidBrush( colorIndigo);
        }
 
X1p=Param("Horizontal Position",0,1,2400,1);
Y1p=Param("Vertical Position",0,-740,1200,1);
 
 
X1 =(Status("Pxwidth")/256)+X1p;
 
Y1 = (Status("Pxheight")/16)+Y1p;
 
 
GfxRoundRect( X1-5, Y1+540,X1+350, Y1+830, 7, 7 ) ;
 
 
 
 
GfxSetTextAlign(0);
GfxSelectFont( "Tahoma", 20, 800 );
GfxSetTextColor ( colorWhite );
GfxTextOut( ( "Candle And Price Action"),X1,Y1+540);
GfxTextOut( ( "___________________"),X1,Y1+545);
GfxSelectFont( "Tahoma", 13, 100 );
GfxSetTextColor ( colorYellow );
GfxTextOut( "1. Price Actions:"+Priceaction, X1, Y1+575);
GfxTextOut( ( "________________________"),X1,Y1+580);
GfxTextOut( "2. Reversal Candle:"+Candlereversal, X1, Y1+600);
GfxTextOut( ( "________________________"),X1,Y1+605);
GfxTextOut( "3. Breakout Candle:"+Candleatbreak, X1, Y1+625);
GfxTextOut( ( "________________________"),X1,Y1+630);
GfxTextOut( "4. Volume Singal:"+Dvolume, X1, Y1+650);
GfxTextOut( ( "________________________"),X1,Y1+655);
 
 
 
_SECTION_END();
}
 
if(Heading==0)
{
 
_SECTION_BEGIN("Heading");
 
X2p=Param("Horizontal Position",0,-740,2400,1);
Y2p=Param("Vertical Position",0,-740,1200,1);
 
X2 =(Status("Pxwidth")/256)+X2p;
Y2 = (Status("Pxheight")/16)+Y2p;
 
GfxSetTextAlign(6|0);
GfxSelectFont( "Tahoma", 20, 800 );
GfxSetTextColor ( colorWhite );
GfxRoundRect( X2+400, Y2-52,X2+1400, Y2+15, 7, 7 );
 
GfxTextOut( "YOGYA TRADING SYSTEM", x2+900, y2-50);
GfxSetTextColor ( colorOrange);
GfxTextOut( Name(), x2+475, y2-50 );
GfxSetTextColor ( colorLime );
GfxTextOut( Interval(2), x2+630, y2-50 );
GfxSetTextColor ( colorLightOrange );
GfxSetTextAlign(0);
GfxTextOut( IndustryID(Mode=1), x2+1100, y2-50);
GfxSetTextAlign(6|0);
GfxSetTextColor ( colorYellow );
GfxTextOut( ( "__________________________________________________________"),x2+900,y2-45);
 
GfxSelectFont( "Tahoma", 13, 800 );
GfxSetTextColor ( colorLime );
GfxTextOut( Date(), x2+510, y2-10 );
GfxSetTextColor ( colorYellow );
YDO=TimeFrameGetPrice("O",inDaily,0);
YDH=TimeFrameGetPrice("H",inDaily,0);
YDL=TimeFrameGetPrice("L",inDaily,0);
YDC=TimeFrameGetPrice("C",inDaily,0);
YDV=TimeFrameGetPrice("V",inDaily,0);
 
GfxTextOut( "Open:"+WriteVal(YDO,1.2), x2+700, Y2-10 );
GfxTextOut( "High:"+WriteVal(YDH,1.2), x2+850, Y2-10 );
GfxTextOut( "Low:"+WriteVal(YDL,1.2), x2+1000, Y2-10 );
GfxTextOut( "Close:"+WriteVal(YDC,1.2), x2+1150, Y2-10 );
GfxTextOut( "Volume="+WriteVal(YDV,1.0), x2+1300, Y2-10 );
 
_SECTION_END();
}
}
GfxSetBkMode(2);
GfxSetTextColor ( colorBlack);
GfxTextOut( "akmeheta@gmail.com", x2+900, y2+700);
_SECTION_BEGIN("Background Color");
SetChartOptions(0,chartShowArrows|chartShowDates);
SetChartBkColor(ParamColor("Background Color",colorDarkOliveGreen)); // Color Of Outer Border
Plot( C, "Price", IIf( C > O, ParamColor("Up Candle", colorBrightGreen), ParamColor("Down Candle",colorRed )), styleCandle );
 
_SECTION_END();
 
 
 
GraphXSpace = Status("Pxheight")/75;

6 comments

1. maonondoi

Thank you so much. The Best.

2. mehra3580

thanks for contribution but don’t know how it works

3. viraldalal

Yes sir can you please add buy / sell indicator ?

How to use pls assist

4. manish

Thank you

5. fahad

very good
I would be nice if buy and sell added.

6. nitinnp1

SIR I REQUEST YOU TO PLEASE BUY & SELL ARROW, as it will make us more confident while taking positon. thanks sir.

Leave Comment

Please login here to leave a comment.

Back