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

Day Trading System for Amibroker (AFL)

Rating:
4 / 5 (Votes 4)
Tags:
intraday, amibroker

The complete system for Day Trading with following -

1. Day Pivot with Supports and Resistances.
2. week Pivot wit Supports AND Resistances.
3.Hour High, Low AND Close EMAs all Realtime AND Live on your Chart.
4.Day High, Low AND Close EMAs all Realtime AND Live on your Chart.
5.Week High, Low AND Close EMAs all Realtime AND Live on your Chart.
6.3, 30, 100 AND 200 EMAs on chart.
7. J10SAR on Chart which will change Realtime on the chart.
8.Magnified Market Price on Chart. (You can change the size AND position)- Good one.

I have found it on the web.

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
//Day  Pivot with Supports and Resistances.
//Week Pivot wit Supports AND Resistances.
//Hour High, Low AND Close EMAs all Realtime AND Live on your Chart.
//Day High, Low AND Close EMAs all Realtime AND Live on your Chart.
//Week High, Low AND Close EMAs all Realtime AND Live on your Chart.
//3, 30, 100 AND 200 EMAs on chart.
//J10SAR on Chart which will change Realtime on the chart.
//Magnified Market Price on Chart. (You can change the size AND position)
 
 
 
_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();
 
_SECTION_BEGIN("R&S Channel");
 
a1=  LastValue(StDev(abs(C-Ref(C,-1))/Ref(C,-1)*100,50));
 
a1 = Param( "R&S Period",1,1,5);
Peak(H,a1,1);
Trough(L,a1,1);
 
Plot(Peak(H,a1,1), "Resistance Level", colorGreen, styleLine, Null, Null, 10 );
 
Plot(Trough(L,a1,1), "Support Level", colorRed, styleLine, Null, Null, 10 );
 
_SECTION_END();
 
Buy = Cross( C, Peak(H,a1,1) ) ;
Sell =Cross( Trough(L,a1,1), C ) ;
 
 
PlotShapes(IIf(Buy, shapeUpArrow , shapeNone), colorGreen);
PlotShapes(IIf(Sell, shapeDownArrow , shapeNone), colorRed);_SECTION_BEGIN("ATP");
Atp=ParamToggle("ATP","Off|On",1);
if(Atp==1)
{
  
  
DayChange = Day() != Ref(Day(), -1);
AvgTradePrice = Null;
CurDayBars = 0;
CurDayCloseSum = 0;
  
for (i = 0; i < BarCount; i++)
{
if (DayChange[i])
{
CurDayCloseSum = C[i];
CurDayBars = 1;
}
else
{
CurDayCloseSum = CurDayCloseSum + C[i];
CurDayBars++;
}
AvgTradePrice[i] = CurDayCloseSum / CurDayBars;
}
Plot(AvgTradePrice, "AvgTradePrice",colorOrange,styleThick);
ATP=AvgTradePrice;
  
_SECTION_END();}
 
//KUMARAN TRADER TOOLS//
 
_SECTION_BEGIN("Price");
SetChartBkGradientFill( ParamColor("BgTop",colorBlack),ParamColor("BgBottom",colorBlack),ParamColor("Titleblock",colorLightGrey));
SetChartOptions(0,chartShowDates|chartShowArrows|chartLogarithmic|chartWrapTitle);
GraphXSpace = 5;
Plot(C,"",colorWhite,styleCandle);
_SECTION_END();
 
//Previous Days HI LO //
 
DayH = TimeFrameGetPrice("H", inDaily, -1);  DayHI = LastValue (DayH,1);// yesterdays high
DayL = TimeFrameGetPrice("L", inDaily, -1);  DayLI = LastValue (DayL,1);    // yesterdays low
DayC = TimeFrameGetPrice("C", inDaily, -1);     // yesterdays close
DayO = TimeFrameGetPrice("O", inDaily);         // current day open
DayH2= TimeFrameGetPrice("H", inDaily, -2);  DayH2I = LastValue (DayH2,1); // Two days before high
DayL2= TimeFrameGetPrice("L", inDaily, -2);  DayL2I = LastValue (DayL2,1);  // Two days before low
DayH3= TimeFrameGetPrice("H", inDaily, -3);  DayH3I = LastValue (DayH3,1);  // Three days before high
DayL3= TimeFrameGetPrice("L", inDaily, -3);  DayL3I = LastValue (DayL3,1);  // Three days before low
 
numbars = LastValue(Cum(Status("barvisible")));
hts  = -33.5;
 
YHL = ParamToggle("Yesterday HI LO","Show|Hide",1);
if(YHL==1) {
  Plot(DayL,"YL",colorRed,styleLine|styleLine|styleNoRescale|styleNoTitle);
  Plot(DayH,"YH",colorGreen,styleLine|styleLine|styleNoRescale|styleNoTitle);
  PlotText(" YH " ,     LastValue(BarIndex())-(numbars/Hts), DayHI, colorGreen);
  PlotText(" YL " ,     LastValue(BarIndex())-(numbars/Hts), DayLI, colorRed); 
}
 
 
_SECTION_BEGIN( "Stokinghem-Diraj 2652 system" );
/*Stokinghem-Diraj 2652 Intra-Day system*/
"========";
 
 
 
SetChartOptions( 0, chartShowArrows | chartShowDates );
 
H1 = SelectedValue( TimeFrameGetPrice( "H", inDaily, -1 ) );
L1 = SelectedValue( TimeFrameGetPrice( "L", inDaily, -1 ) );
C1 = SelectedValue( TimeFrameGetPrice( "C", inDaily, -1 ) );
H2 = SelectedValue( TimeFrameGetPrice( "H", inDaily, 0 ) );
L2 = SelectedValue( TimeFrameGetPrice( "L", inDaily, 0 ) );
O1 = SelectedValue( TimeFrameGetPrice( "open", inDaily, 0 ) );
/*PIVOT Calculation*/
D1 = ( H1 - L1 );
D2 = ( H2 - L2 );
F1 = D1 * 0.433;
F2 = D1 * 0.766;
F3 = D1 * 1.35;
 
 
F4 = 0;
 
if ( D2 <= F1 )
    F4 = F1;
else
    if ( D2 <= F2  )
        F4 = F2;
    else
        F4 = F3;
 
 
 
S_P = ( O1 - F4 );
 
B_P = ( O1 + F4 );
 
BP = ( L2 + F4 );
 
BPTGT = ( BP + ( BP * .0065 ) );//.0015 brokerage
 
BPSTPLS = ( BP - ( BP * .0085 ) );
 
SP = ( H2 - F4 );
 
SPTGT = ( SP - ( SP * .0065 ) );
 
SPSTPLS = ( SP + ( SP * .0085 ) );
 
 
p = ( H1 + L1 + C1 ) / 3;
 
s1 = ( H1 );
 
r1 = ( L1 );
 
r2 = SelectedValue( L2 );
 
s2 = SelectedValue( H2 );
 
//CONDITION
 
S = ( C > p );
 
SS = ( C < P );
 
//Plot
 
Plot ( p  , "PIVOT", 25, 4 );PlotText( "PIVOT" , BarCount-25, p+0, 25 );
 
 
Plot ( r1, "PRE_LOW", 29, 4 );PlotText( "PreDay LOW" , BarCount-25, r1+0, 29 );
 
Plot ( s1, "PRE_HIGH", 29, 4 );PlotText( "PreDay HIGH" , BarCount-25, s1+0, 29 );
 
Plot ( s2, "DAY_HIGH", 42, 4 );PlotText( "Day HIGH" , BarCount-25, s2+0, 42 );
 
Plot ( r2, "DAY_LOW", 42, 4 );PlotText( "Day LOW" , BarCount-25, r2+0, 42 );
 
 
 
 
GfxSetBkColor( colorRed );
 
GfxSetTextColor( 41 );
 
GfxSelectFont( "TOHMA", 9, 700, False );
 
 
 
GfxSetBkColor( colorLightGrey );
 
GfxSetTextColor( 16 );
 
 
 
GfxTextOut("* "+ ( WriteVal( H1 ) + "--" + WriteVal( L1 ) + "=PreDay=" + WriteVal( D1 ) ), 32, 100 );
 
GfxTextOut("* "+ ( WriteVal( H2 ) + "--" + WriteVal( L2 ) + "=ToDay=" + WriteVal( D2 ) ), 32, 115 );
 
GfxTextOut( "F1=" + ( WriteVal( F1 ) ), 32, 130 );
 
GfxTextOut( "F2=" + ( WriteVal( F2 ) ), 32, 145 );
 
GfxTextOut( "F3=" + ( WriteVal( F3 ) ), 32, 160 );
 
 
GfxTextOut( "Selected FC==" + ( WriteVal( F4 ) ), 32, 175 );
 
GfxTextOut( ( "-P-TGT 0.65 and STP-LS 1.0(Inc-Bkrg)-" ), 32, 190 );
 
 
 
 
 
 
 
 
Filter =  S OR SS;
 
AddColumn( IIf( S, 66, 1 ), "Buy", formatChar, 1, bkcolor = IIf( S, 43, 33 ) );
 
AddColumn( IIf( SS, 83, 1 ), "Sell", formatChar, 1, bkcolor = IIf( SS, 25, 32 ) );
 
 
 
AddColumn( C, "CMP", 1.2, colorDefault, colorLightBlue );
 
AddColumn( BP, "BUY PRICE", 1.2, colorDefault, colorGreen );
 
AddColumn( BPTGT, "TGT PRICE", 1.2, colorDefault, colorBrown );
 
AddColumn( BPSTPLS, "STPLS BUY", 1.2, colorDefault, colorRed );
 
AddColumn( p, "PIVOT", 1.2, colorDefault, colorYellow );
 
AddColumn( SPSTPLS, "STPLS SELL", 1.2, colorDefault, colorRed );
 
AddColumn( SP, "SELL PRICE", 1.2, colorDefault, colorGreen );
 
AddColumn( SPTGT, "TGT PRICE", 1.2, colorDefault, colorBrown );
 
 
AddColumn( H1, "PRE-HIGH" );
 
AddColumn( L1, "PRE-LOW" );
 
AddColumn( D1, "PRE-DIFF" );
 
AddColumn( F1, "0.433" );
 
AddColumn( F2, "0.766" );
 
AddColumn( F3, "1.35" );
 
AddColumn( H2, "D-HIGH" );
 
AddColumn( L2, "D-LOW" );
 
AddColumn( D2, "D-DIFF" );
 
AddColumn( F4, "SELECT FACT" );
 
 
Buy = Cross ( ( C ), ( BP ) );
 
Sell = Cross ( ( C ), ( SP ) );
 
AlertIf( Buy, "SOUND C:\\Windows\\Media\\Ding.wav", "2652 System", 1, 2 );
 
AlertIf( Sell, "SOUND C:\\Windows\\Media\\Chime.wav", "2652 System", 2, 2 );
 
 
 
_SECTION_END();
 
 
_SECTION_BEGIN("Show Values at H&L");
 
n=Param("Values back",20,1,200,1);
p=Param("zig %",5,1,100,1);
dist = 0.8*ATR(15);
 
for( i = 1; i < n; i++ )
{  
    PlotText(""+LastValue(Peak(H,p,i),True),BarCount-3-LastValue(PeakBars(H,p,i)),LastValue(dist,True)+LastValue(Peak(H,p,i),False),colorBlack,ColorRGB(225,225,225));
    PlotText(""+LastValue(Trough(L,p,i),True),BarCount-3-LastValue(TroughBars(L,p,i)),LastValue(Trough(L,p,i),False)-LastValue(dist,True),colorBlack,ColorRGB(225,225,225));
}
 
_SECTION_END();
 
_SECTION_BEGIN("Price1");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();
 
// AMA System by Karthikmarar
// Two adjustable parameter "Buy sensitivity" and "Buy Finetune" provided to adjust entry points.
// Two adjustable parameter "Sell sensitivity" and "Sell Finetune" provided to adjust Exit points.
 
//SAM-JN-AFL V1.0 .. Made by SAM(Admin and Founder of Traderadda.com)
//This AFL is made with help of various codes available freely. I have made many alterations and Some my design in it.
//If you have any suggestions please visit http://traderadda.com
 
_SECTION_BEGIN("Background Color Switcher");
if (NOT ParamToggle("Background switch","On,Off",defaultval=1))
{
bckg1=ParamColor("Background level 1",colorBlack);
bckg2=ParamColor("Background level 2",colorBlack);
bckg3=ParamColor("Background level 3",ColorRGB(25,0,0));
bckg4=ParamColor("Background level 4",ColorRGB(40,0,0));
stockname=ParamColor("Stock name color",ColorRGB(44,44,37));
 
 
GfxGradientRect(0,0,Status("pxwidth"),Status("pxhe ight")*2/5,bckg1,bckg2);
GfxGradientRect(0,Status("pxheight")*2/5,Status("pxwidth"),Status("pxheight")*4/5,bckg2,bckg3);
GfxGradientRect(0,Status("pxheight")*4/5,Status("pxwidth"),Status("pxheight"),bckg3,bckg4 );
 
if (NOT ParamToggle("StockName Switch","On,Off"))
{
GfxSelectFont("Time news roman", Status("pxheight")/7 );
GfxSetTextAlign(6 );
GfxSetOverlayMode(1);
GfxSetTextColor(stockname);
 
GfxSetBkMode(0);
GfxTextOut(Name(),Status("pxwidth")/2, Status("pxheight")/18 );
 
GfxSelectFont("Time news roman", Status("pxheight")/26 );
GfxTextOut(FullName(), Status("pxwidth")/2, Status("pxheight")/3.9 );
 
GfxSelectFont("Time news roman", Status("pxheight")/25 );
GfxTextOut("Market: " + MarketID(1), Status("pxwidth")/2, Status("pxheight")/3 );
}
}
_SECTION_END();
 
_SECTION_BEGIN("Background text");
//C11=ParamColor("up panel",colorBlack );
//C12=ParamColor("dn panel",colorBlack );
C13=Param("fonts",20,10,30,1 );
C14=Param("left-right",2.1,1.0,5.0,0.1 );
C15=Param("up-down",12,1,20,1 );
Miny = Status("axisminy");
Maxy = Status("axismaxy");
lvb = Status("lastvisiblebar");
fvb = Status("firstvisiblebar");
pxwidth = Status("pxwidth");
pxheight = Status("pxheight");
GfxSetBkMode( 0 );
GfxSetOverlayMode(1);
//GfxGradientRect(0,0,pxwidth, pxheight, C11, C12 );
GfxSelectFont("Tahoma", Status("pxheight")/C13 );
GfxSetTextAlign( 6 );
GfxTextOut( Name(), Status("pxwidth")/C14, Status("pxheight")/C15 );
GfxSelectFont("Tahoma", Status("pxheight")/C13*0.5 );
GfxTextOut( "", Status("pxwidth")/C14, Status("pxheight")/C15*2.5 );
GfxSelectFont("Tahoma", Status("pxheight")/C13*0.5 );
GfxTextOut( "", Status("pxwidth")/C14, Status("pxheight")/C15*4 );
GfxSelectFont("MS Sans Serif", 10, 500, False, False, 0);
GfxSelectFont("Ariel",9, 700, False, False, 0);
GfxSetTextColor(colorYellow);
//axisarea = 56; // may need adjustment if you are using non-default font for axis
 
 
_SECTION_BEGIN(" J10SARbySAM ");
TimeFrameSet( inDaily   );
FS=Param("Font Size",20,11,100,1);
GfxSelectFont("Arial", FS, 700, True );
GfxSetBkMode( colorWhite ); 
GfxSetTextColor( ParamColor("Color",colorYellow) );
Hor=Param("Horizontal Position",373,1,1200,1);
Ver=Param("Vertical Position",16,1,830,1);
//SAR1=Prec((C+YC+DFYC+DFYC1+DFYC2)/5,5);
SAR1=EMA( Close, 10 );
GfxTextOut("J10SAR="+SAR1, Hor , Ver );
TimeFrameRestore();
 
_SECTION_END();
 
_SECTION_BEGIN("Magnified Market Price");
FS=Param("Font Size",30,11,100,1);
GfxSelectFont("Times New Roman", FS, 700, True );
GfxSetBkMode( colorWhite ); 
GfxSetTextColor( ParamColor("Color",colorLightOrange) );
Hor=Param("Horizontal Position",373,1,1200,1);
Ver=Param("Vertical Position",45,1,830,1);
GfxTextOut(""+C, Hor , Ver );
YC=TimeFrameGetPrice("C",inDaily,-1);
DD=Prec(C-YC,2);
xx=Prec((DD/YC)*100,2);
GfxSelectFont("Times New Roman", 11, 700, True );
GfxSetBkMode( colorWhite ); 
GfxSetTextColor(ParamColor("Color",colorBlack) );
GfxTextOut(""+DD+"  ("+xx+"%)", Hor , Ver+45 );
 
_SECTION_END();
 
_SECTION_BEGIN("Title");
if( Status("action") == actionIndicator )
(
Title = EncodeColor(colorWhite)+ "SAM()JN AFL V1.0 " + " - " Name() + " - " + EncodeColor(colorRed)+ Interval(2) + EncodeColor(colorWhite) +
 "  - " + Date() +" - "+"\n" +EncodeColor(colorYellow) +"Op-"+O+"  "+"Hi-"+H+"  "+"Lo-"+L+"  "+
"Cl-"+C+"  "+ "Vol= "+ WriteVal(V)+"\n"+
EncodeColor(colorLime));
//WriteIf (Buy , " GO LONG / Reverse Signal at "+C+"  ","")+
//WriteIf (Sell , " EXIT LONG / Reverse Signal at "+C+"  ","")+"\n"+EncodeColor(colorWhite)+
//WriteIf(Sell , "Total Profit/Loss for the Last Trade Rs."+(C-BuyPrice)+"","")+
//WriteIf(Buy  , "Total Profit/Loss for the Last trade Rs."+(SellPrice-C)+"","")+
//WriteIf(Long AND NOT Buy, "Trade : Long - Entry price Rs."+(BuyPrice),"")+
//WriteIf(shrt AND NOT Sell, "Trade : Short - Entry price Rs."+(SellPrice),"")+"\n"+
//WriteIf(Long AND NOT Buy, "Current Profit/Loss Rs."+(C-BuyPrice)+"","")+
//WriteIf(shrt AND NOT Sell, "Current Profit/Loss Rs."+(SellPrice-C)+"",""));
_SECTION_END();
 
_SECTION_BEGIN("Price1");
SetChartOptions(0,chartShowArrows|chartShowDates);
Plot( C, "Close", ParamColor("Color", colorRed ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();
//_SECTION_BEGIN("Pivot")
    YH = TimeFrameGetPrice("H", inDaily, -1);       // yesterdays high
    YL = TimeFrameGetPrice("L", inDaily, -1);       //              low
    YC = TimeFrameGetPrice("C", inDaily, -1);       //              close
    YO = TimeFrameGetPrice("O", inDaily);           // current day open
 
    //Normal Pivot
    PP = (YH + YL + YC) / 3;
    R1 = (2 * PP) - YL;
    R2 = PP + (YH - YL);
    R3 = YH + 2*(PP-YL);
    S1 = (2 * PP) - YH;
    S2 = PP - (YH - YL);
    S3 = YL - 2*(YH - PP) ;
 
 
GfxSetOverlayMode( mode = 0 ); 
GfxSelectPen( colorYellow, 3 ); 
GfxSelectSolidBrush( colorBlack  ); 
GfxRoundRect( 20, 72, 117, 205, 100, 25 ); 
GfxSetBkMode(1); 
GfxSelectFont( "Arial", 10, 900, False );
GfxSetTextColor( colorWhite  );
GfxSetTextAlign(0);
GfxTextOut( WriteIf(YH, "D.Piv.: "+(PP),""), 25, 85);
GfxSetTextColor( colorRed  );
GfxTextOut( WriteIf(R1, "R1: "+(R1),""), 30, 105);
GfxTextOut( WriteIf(R2, "R2: "+(R2),""), 30, 120);
GfxTextOut( WriteIf(R3, "R3: "+(R3),""), 30, 135);
GfxSetTextColor( colorLime   ); 
GfxTextOut( WriteIf(S1, "S1: "+(S1),""), 30, 150);
GfxTextOut( WriteIf(S2, "S2: "+(S2),""), 30, 165);
GfxTextOut( WriteIf(S3, "S3: "+(S3),""), 30, 180);
 
    WYH = TimeFrameGetPrice("H", inWeekly, -1);    
    WYL = TimeFrameGetPrice("L", inWeekly, -1);    
    WYC = TimeFrameGetPrice("C", inWeekly, -1);    
    WYO = TimeFrameGetPrice("O", inWeekly);        
 
    //Week Pivot
    WPP = (WYH + WYL + WYC) / 3;
    WR1 = (2 * WPP) - WYL;
    WR2 = WPP + (WYH - WYL);
    WR3 = WYH + 2*(WPP-WYL);
    WS1 = (2 * WPP) - WYH;
    WS2 = WPP - (WYH - WYL);
    WS3 = WYL - 2*(WYH - WPP) ;
 
 
 
GfxSetOverlayMode( mode = 0 ); 
GfxSelectPen( colorYellow, 3 ); 
GfxSelectSolidBrush( colorBlack  ); 
GfxRoundRect( 130, 72, 232, 205, 100, 25 );
GfxSetBkMode(1); 
GfxSelectFont( "Arial", 10, 900, False );
GfxSetTextColor( colorWhite  );
GfxSetTextAlign(0);
  
GfxTextOut( WriteIf(YH, "W.Piv.: "+(WPP),""), 135, 85);
GfxSetTextColor( colorRed  );
GfxTextOut( WriteIf(R1, "R1: "+(WR1),""), 140, 105);
GfxTextOut( WriteIf(R2, "R2: "+(WR2),""), 140, 120);
GfxTextOut( WriteIf(R3, "R3: "+(WR3),""), 140, 135);
GfxSetTextColor( colorLime   ); 
 
GfxTextOut( WriteIf(S1, "S1: "+(WS1),""), 140, 150);
GfxTextOut( WriteIf(S2, "S2: "+(WS2),""), 140, 165);
GfxTextOut( WriteIf(S3, "S3: "+(WS3),""), 140, 180); 
 
 
 
GfxSetOverlayMode( mode = 0 ); 
GfxSelectPen( colorYellow, 3 ); 
GfxSelectSolidBrush( colorBlack  ); 
GfxRoundRect( 20, 480, 160, 230, 100, 25 ); 
GfxSetBkMode(1); 
GfxSelectFont( "Arial", 10, 900, False );
GfxSetTextColor( colorWhite  );
GfxSetTextAlign(0);
 
 
TimeFrameSet( inDaily   );
EMADH = EMA(H,   5);
TimeFrameExpand( EMADH , inDaily );
EMADL = EMA(L,   5);
TimeFrameExpand( EMADL , inDaily );
EMADC = EMA(C,   5);
TimeFrameExpand( EMADC , inDaily );
TimeFrameRestore();
 
 
TimeFrameSet( inHourly   );
EMAHH = EMA(H,   5);
TimeFrameExpand( EMAHH , inHourly );
EMAHL = EMA(L,   5);
TimeFrameExpand( EMAHL , inHourly );
EMAHC = EMA(C,   5);
TimeFrameExpand( EMAHC , inHourly );
TimeFrameRestore();
 
 
GfxSetTextColor( colorRed);
GfxTextOut( WriteIf(S3 , "Hour High : "+EMAHH,""), 30, 250);
GfxSetTextColor( colorGreen );
GfxTextOut( WriteIf(S3 , "Hour Low: "+EMAHL,""), 30, 270);
GfxSetTextColor( colorWhite );
GfxTextOut( WriteIf(S3 , "Hour Close: "+EMAHC,""), 30, 290);
 
 
GfxSetTextColor( colorRed);
GfxTextOut( WriteIf(S3 , "Day High : "+EMADH,""), 30, 320);
GfxSetTextColor( colorGreen );
GfxTextOut( WriteIf(S3 , "Day Low : "+EMADL,""), 30, 340);
GfxSetTextColor( colorWhite );
GfxTextOut( WriteIf(S3 , "Day Close : "+EMADc,""), 30, 360);
 
TimeFrameSet( inWeekly );
WEEKH = EMA(H,   5);
TimeFrameExpand( WEEKH , inWeekly );
WEEKL = EMA(L,   5);
TimeFrameExpand( WEEKL , inWeekly );
WEEKC = EMA(C,   5);
TimeFrameExpand( WEEKC , inWeekly );
TimeFrameRestore();
 
GfxSetTextColor( colorRed);
GfxTextOut( WriteIf(S3 , "Week High : "+WEEKH ,""), 30, 390);
GfxSetTextColor( colorGreen );
GfxTextOut( WriteIf(S3 , "Week Low : "+WEEKL ,""), 30, 410);
GfxSetTextColor( colorWhite );
GfxTextOut( WriteIf(S3 , "Week Clo. : "+WEEKC ,""), 30, 430);
 
TimeFrameSet(inDaily);
DayHigh = LastValue(H);
DayLow = LastValue(L);
TimeFrameRestore();
 
Title = Date() + ", Op=" + Open + ", Hi=" + High + ", Lo=" + Low + ", LTP=" + Close + ", Change= " + SelectedValue( ROC( C, 1 ) ) + "%" + "\n Today`s High=" + DayHigh + ", Today`s Low=" + DayLow + " © KUMARAN SWING TADING SYSTEM" ;
 
 
prev=AMA2(C,1,0);
d=IIf(C>Ref(Max(Max(H,Ref(H,-20)),Max(Ref(H,-10),Ref(H,-15))),-1),Min(Min(L,Ref(L,-20)),Min(Ref(L,-10),Ref(L,-15))),
IIf(C<Ref(Min(Min(L,Ref(L,-20)),Min(Ref(L,-10),Ref(L,-15))),-1),Max(Max(H,Ref(H,-20)),Max(Ref(H,-10),Ref(H,-15))),PREV));
a=Cross(Close,d);
b=Cross(d,Close);
state=IIf(BarsSince(a)<BarsSince(b),1,0);
s=state>Ref(state,-1);
ss=state<Ref(state,-1);
sss=state==Ref(state,-1);
col=IIf(state == 1 ,51,IIf(state ==0,4,1));
Plot(C,"",Col,64);
Buy = s;
Sell = ss;
shape = Buy * shapeUpArrow + Sell * shapeDownArrow;
PlotShapes(shape, IIf(Buy,colorGreen,colorRed), 0, IIf(Buy,Low,High));
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0, L, Offset=-10);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorLime, 0,L, Offset=-20);                     
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-15);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorRed, 0, H, Offset=20);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorOrange, 0,H, Offset=30);                     
PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-25);
//WriteIf(s,"EXIT all Short positions\nif trading long positions, enter long Now-\nOR at the market price on tomorrow's Open with stop="+EncodeColor(4)+WriteVal(L+.75*ATR(5),1.4)+" ,","");
//WriteIf(ss,"exit all long positions today with a Market On Close (MOC) order\nOR at the market price on tomorrow's Open with stop="+EncodeColor(4)+WriteVal(Ref(H+.75*ATR(5), -1),1.4)+",","");
//WriteIf( sss ,"No trading signals today.","") ;
 
 
dist = 0.8*ATR(10);
dist1 = 2*ATR(10);
for( i = 0; i < BarCount; i++ )
{
 if( Buy[i] )
 {
  PlotText( "\nBuy:" + H[ i ] + "\nT= " + (H[i]*1.005) + "\nSL= " + (H[i]*0.9975), i, H[ i ]-dist[i], colorWhite, colorGreen );
 }
 if( Sell[i] )
 {
  PlotText( "Sell:" + L[ i ] + "\nT= " + (L[i]*0.995) + "\nSL= " + (L[i]*1.0025), i, L[ i ]+dist1[i], colorWhite, colorRed );
 }
}
 
 
Filter = s OR sss OR sss ;
AddColumn(C,"close",1.2);
AddColumn( IIf( s, 66,1 ), "buy", formatChar, 1, bkcolor =IIf (s,colorYellow, colorPink ));
AddColumn( IIf( Ss, 83,1 ), "sell", formatChar, 1, bkcolor =IIf (Ss,colorPink, colorWhite ));
AddColumn( IIf( sss, 87,1 ), "wait", formatChar, 1, bkcolor =IIf (sss,colorYellow, colorRed ));
 
 
_SECTION_BEGIN("swing1");
no=20;
res=HHV(H,no);
sup=LLV(L,no);
avd=IIf(C>Ref(res,-1),1,IIf(C<Ref(sup,-1),-1,0));
avn=ValueWhen(avd!=0,avd,1);
supres=IIf(avn==1,sup,res);
a=Cross(C,supres);
b=Cross(supres,C);
style = a * styleStaircase + b * styleStaircase;
PlotShapes(a,style, IIf(a,colorGreen,colorRed), 0, IIf(a,Low,High));
Plot(supres,"Swing",colorBlue,styleStaircase);
_SECTION_END();
 
 
 
_SECTION_BEGIN("trend");
uptrend=PDI(20)>MDI(10)AND Signal(29)<MACD(13);
downtrend=MDI(10)>PDI(20)AND Signal(29)>MACD(13);
Plot( 2, /* defines the height of the ribbon in percent of pane width */"ribbon",
IIf( uptrend, colorGreen, IIf( downtrend, colorRed, 0 )), /* choose color */
styleOwnScale|styleArea|styleNoLabel, -0.5, 100 );
_SECTION_END();
 
Buy = s AND a AND uptrend ;
Short = ss AND b AND downtrend ;
Sell = ss AND b AND downtrend ;
Cover = s AND a AND uptrend ;
 
Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);
Cover=ExRem(Cover,Short);
Short=ExRem(Short,Cover);
 
Filter=Buy OR Sell;
Filter= Cover OR Short;
 
AddColumn( Buy, "Buy", 1);
AddColumn(Sell, "Sell", 1);
AddColumn(Close,"Close",1.2);
AddColumn(Volume,"Volume",1.0);
 
 
// Plot the Buy and Sell arrows.
shape = Buy * shapeUpArrow + Sell * shapeDownArrow;
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0, L, Offset=-10);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorLime, 0,L, Offset=-20);                     
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-15);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorRed, 0, H, Offset=20);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorOrange, 0,H, Offset=30);                     
PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-25);
 
 
 
 
 
//plot volume graph
 
// set background gradient colours
SetChartBkGradientFill( ParamColor("BgTop", ColorRGB( 172,172,172 )),ParamColor("BgBottom", ColorRGB( 102,136,187 )),ParamColor("titleblock",ColorRGB( 255,255,255 )));
 
GraphXSpace = 5;
 
//Previous Days HI LO //
 
DayH = TimeFrameGetPrice("H", inDaily, -1);  DayHI = LastValue (DayH,1);// yesterdays high
DayL = TimeFrameGetPrice("L", inDaily, -1);  DayLI = LastValue (DayL,1);    // yesterdays low
DayC = TimeFrameGetPrice("C", inDaily, -1);     // yesterdays close
DayO = TimeFrameGetPrice("O", inDaily);         // current day open
DayH2= TimeFrameGetPrice("H", inDaily, -2);  DayH2I = LastValue (DayH2,1); // Two days before high
DayL2= TimeFrameGetPrice("L", inDaily, -2);  DayL2I = LastValue (DayL2,1);  // Two days before low
DayH3= TimeFrameGetPrice("H", inDaily, -3);  DayH3I = LastValue (DayH3,1);  // Three days before high
DayL3= TimeFrameGetPrice("L", inDaily, -3);  DayL3I = LastValue (DayL3,1);  // Three days before low
 
numbars = LastValue(Cum(Status("barvisible")));
hts  = -33.5;
 
YHL = ParamToggle("Yesterday HI LO","Show|Hide",1);
if(YHL==1) {
  Plot(DayL,"YL",colorRed,styleLine|styleLine|styleNoRescale|styleNoTitle);
  Plot(DayH,"YH",colorGreen,styleLine|styleLine|styleNoRescale|styleNoTitle);
  PlotText(" YH " ,     LastValue(BarIndex())-(numbars/Hts), DayHI, colorGreen);
  PlotText(" YL " ,     LastValue(BarIndex())-(numbars/Hts), DayLI, colorRed); 
}

11 comments

1. sreedharkadam

Good One Need to Check in Real time, Thanks
Requesting to send me some good afls to my mail id sreedhar.nseeq@gmail.com

2. macerina

Hi can you pls upload the code for the two lines red and green which are attached with the price

Thanks in advance

3. rcraja2001

nice one i am analysing alongwith another formula…waiting for the success rate…
Anyhow thanks for post

4. tuananh.ueh173

good job!

5. VIJAYD

good one i like it but i have to test it with live data

6. nareshpriya

@vijayD : there is a feature in amibroker called “tick bar replay” with which u can check how this indicator wud have behaved in live environment. check amiboker help to see how to use the same. if u still want, help i can help u too.

7. VIJAYD

@nareshpriya thks very much

8. VIJAYD

can u explain what is J10SAR on this chart

9. absistla9

Not able see the date, time, price etc details on the top of the chart like it looks on other charts. Please help me how to do this

10. acchiang

If i want to remove the title of instrument ( it is located on the top of the chart), Please advise ?

11. ankit

Hey,
can u please add Monthly Pivot levels i.e. Monthly pivot , Monthly S1 S2 & S3 and MonthLy R1 R2 & R3 as well as Monthly High Low and Close if Possible ??

Leave Comment

Please login here to leave a comment.

Back