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

RAJASWAMY MULTI PIVIOT INTRADAY for Amibroker (AFL)

Rating:
3 / 5 (Votes 6)
Tags:
amibroker, pivot

THIS PIVIOT SPECIALY DESINED FOR INTRADAY TRADING IN NIFTY
FOR FURTHER DETAILS PLS ASK ME

//= RAJASWAMY MULTI PIVIOT INTRADAY ====//

Screenshots

Similar Indicators / Formulas

Previous Pivots
Submitted by Divyesh about 12 years ago
CAMARILLA hour -15min
Submitted by berusnet about 14 years ago
PIVOT+CDP+3LevelPrice
Submitted by eclife about 14 years ago
Pivot Breakout System
Submitted by iris1in over 11 years ago
Woodies Pivot
Submitted by Divyesh almost 13 years ago
NIFTYTIGER CAMARILLA LEVELS
Submitted by niftytiger almost 13 years ago

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
_SECTION_BEGIN
 
("HA");
 
//2 - IN - 1 PRICE CHART
 
Pstyle =
 
ParamToggle("Heikin Ashi","On|Off",1);
 
if
 
  
 
(Pstyle==0){
 
HaClose = (O+H+L+C)/
 
4;
 
HaOpen =
 
AMA( Ref( HaClose, -1 ), 0.5 );
 
HaHigh =
 
Max( H, Max( HaClose, HaOpen ) );
 
HaLow =
 
Min( L, Min( HaClose, HaOpen ) );
 
PlotOHLC
 
(HaOpen,HaHigh,HaLow,HaClose,"",IIf(HaClose >
 
HaOpen,colorGreen,colorBrown),styleCandle);
 
  
 
_N
 
(Title = StrFormat(
 
"{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g,
 
  
 
Close
 
%g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
 
}
 
else
 
  
 
{
 
_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() );
 
}
 
  
 
  
 
  
 
//TIME FRAME CALCULATION
 
H1 =
 
TimeFrameGetPrice("H", inDaily, -1); // yesterdays high
 
L1 =
 
TimeFrameGetPrice("L", inDaily, -1); // low
 
C1=
 
TimeFrameGetPrice("C", inDaily, -1); // close
 
DayO =
 
TimeFrameGetPrice("O", inDaily); // current day open
 
  
 
// PIVOT Calculation
 
P = ( H1+ L1 + C1 )/
 
3;
 
S1 = (
 
2*P)-H1;
 
R1 = (
 
2*P)-L1;
 
S2 = P -(H1 - L1);
 
S3 = S1 - (H1-L1);
 
R2 = P +(H1 - L1);
 
R3 = R1 +(H1-L1);
 
// PIVOT mid points
 
MIDR1 = (P+R1)/
 
2;
 
MIDR2 = (R1+R2)/
 
2;
 
MIDR3 = (R2+R3)/
 
2;
 
MIDS1 = (P+S1)/
 
2;
 
MIDS2 = (S1+S2)/
 
2;
 
MIDS3 = (S2+S3)/
 
2;
 
//PLOTS
 
Plot
 
(R1, "",colorBrightGreen,styleDots+styleNoRescale);
 
Plot
 
(R2, "",colorCustom12,styleDots);
 
Plot
 
(S1, "",colorPink,styleDots+styleNoRescale);
 
Plot
 
(S1, "",colorRed,styleDots+styleNoRescale);
 
Plot
 
(S2, "",colorBlue,styleDots+styleNoRescale);
 
Plot
 
(S3, "",colorOrange,styleDots+styleNoRescale);
 
Plot
 
(P, "",colorBlack,styleDots+styleNoRescale);
 
// text section
 
"HIGH /LOW /CLOSE = "
 
+H +" / "+ L+" / "+ C +"\n";
 
"H1 /L1 /C1 = "
 
+H1 +" / "+ L1+" / "+ C1 +"\n";
 
"R3 = "
 
+R3;
 
"midr3 = "
 
+MIDR3;
 
"R2 = "
 
+R2;
 
"midr2 = "
 
+MIDR2;
 
"R1 = "
 
+R1;
 
"midr1 = "
 
+MIDR1;
 
"*************"
 
;
 
"p = "
 
+p;
 
"*************"
 
;
 
"mids1 = "
 
+MIDS1;
 
"S1 = "
 
+S1;
 
"mids2 = "
 
+MIDS2;
 
"S2 = "
 
+S2;
 
"mids3 = "
 
+MIDS3;
 
"S3 = "
 
+S3;
 
_SECTION_END
 
();
 
//Topping Bar
 
//Range = H - L ;
 
//TPB = Volume > MA(Volume,9) AND Close < Low + Range/2 AND Range <= Ref(Range,-1);
 
//PlotShapes(shapeSmallCircle * TPB,colorYellow,0,H,20);
 
 
//======================================================= SWING TRADE ==============================
 
_SECTION_BEGIN("NICK MA Swing");
SetBarsRequired(200,0);
 
GraphXSpace = 5;
SetChartOptions(0,chartShowArrows|chartShowDates);
k =  Optimize("K",Param("K",1,0.25,5,0.25),0.25,5,0.25);
Per= Optimize("atr",Param("atr",4,3,20,1),3,20,1);
HACLOSE=(O+H+L+C)/4;
HaOpen = AMA( Ref( HaClose,  -1 ),  0.5 );
HaHigh = Max( HMax( HaClose,  HaOpen ) );
HaLow = Min( LMin( HaClose,  HaOpen ) );
PlotOHLC( HaOpen, HaHigh, HaLow, HaClose, "" + Name(), colorBlack, styleLine | styleNoLabel );
j=Haclose;
 
//=======================================================================================================================
//=========================Indicator==============================================================================================
f=ATR(14);
 
rfsctor = WMA(H-L, Per);
 
revers = k * rfsctor;
 
Trend = 1; 
NW[0] = 0; 
 
 
for(i = 1; i < BarCount; i++)
{
 if(Trend[i-1] == 1)               
 {
  if(j[i] < NW[i-1])                
  {
   Trend[i] = -1;                  
   NW[i] = j[i] + Revers[i];       
  }
  else                             
  {
   Trend[i] = 1;
   if((j[i] - Revers[i]) > NW[i-1])
   {
    NW[i] = j[i] - Revers[i];
   }
   else
   {
    NW[i] = NW[i-1];
   }
  }
 }
 if(Trend[i-1] == -1)              
 {
  if(j[i] > NW[i-1])               
  {
   Trend[i] = 1;                   
   NW[i] = j[i] - Revers[i];       
  }
  else                             
  {
   Trend[i] = -1;
   if((j[i] + Revers[i]) < NW[i-1])
   {
    NW[i] = j[i] + Revers[i];
   }
   else
   {
    NW[i] = NW[i-1];
   }
  }
 }
}
 
//===============system================
 
Plot(NW, "", IIf(Trend == 1, 27, 4), 4);
Buy=Cover=Cross(j,nw);
Sell=Short=Cross(nw,j);
SellPrice=ValueWhen(Sell,C,1);
BuyPrice=ValueWhen(Buy,C,1);
Long=Flip(Buy,Sell);
Shrt=Flip(Sell,Buy );
_SECTION_END();
//=================TITLE================================================================================================
_SECTION_BEGIN("Title");
if( Status("action") == actionIndicator )
(
Title = EncodeColor(colorGreen)+ "NICK MA Swing System" + " - " Name() + " - " + EncodeColor(colorRed)+ Interval(2) + EncodeColor(colorGreen) +
 "  - " + Date() +" - "+"\n" +EncodeColor(colorGreen) +"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(colorGreen)+
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)+"",""));
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0, L, Offset=-40);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorLime, 0,L, Offset=-50);                     
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-45);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorRed, 0, H, Offset=40);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorOrange, 0,H, Offset=50);                     
PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-45);
_SECTION_END();
 
_SECTION_BEGIN("Time Left");
function GetSecondNum()
{
Time = Now( 4 );
Seconds = int( Time % 100 );
Minutes = int( Time / 100 % 100 );
Hours = int( Time / 10000 % 100 );
SecondNum = int( Hours * 60 * 60 + Minutes * 60 + Seconds );
return SecondNum;
}
RequestTimedRefresh( 1 );
TimeFrame = Interval();
SecNumber = GetSecondNum();
Newperiod = SecNumber % TimeFrame == 0;
SecsLeft = SecNumber - int( SecNumber / TimeFrame ) * TimeFrame;
SecsToGo = TimeFrame - SecsLeft;
 
x=Param("xposn",300,0,1000,1);
y=Param("yposn",50,0,1000,1);
 
GfxSelectSolidBrush( ColorRGB( 230, 230, 230 ) );
GfxSelectPen( ColorRGB( 230, 230, 230 ), 2 );
if ( NewPeriod )
{
GfxSelectSolidBrush( colorYellow );
GfxSelectPen( colorYellow, 2 );
Say( "New period" );
}
GfxRoundRect( x+45, y+17, x-3, y-2, 0, 0 );
GfxSetBkMode(1);
GfxSelectFont( "Arial", 12, 700, False );
GfxSetTextColor( colorBlack );
GfxTextOut( ""+SecsToGo+" / "+NumToStr( TimeFrame, 1.0 ), x, y );
_SECTION_END();
 
 
_SECTION_BEGIN("Volume");
Plot( Volume, _DEFAULT_NAME(), ParamColor("Color", colorBlueGrey ), ParamStyle( "Style", styleHistogram | styleOwnScale | styleThick, maskHistogram  ), 2 );
_SECTION_END();

8 comments

1. anandnst

good one

2. godisbogus

Sir can you please explain how to fix the targets and also let me know the best time frame for intraday trades in nifty future.

3. kushal

sir its not showing anything, everything is blank,
its a blank chart
kindly help.
even it same for other of ur formuale
think it needs sme setting to b done
plz help

4. kanavai

Well Done.Keep it up. Thanks.

5. bhavikdhroove

excellent formula too good

7. Bernd

Hi RAJASWAMY,

Really nice work. I like the idea to use HA for triggering but real candles for close price. I did something similar with the ATR based trigger line to go long/short. I thought thats more or less called SuperTend formula. Unfortunately I haven’t found any settings (parameter) to make the system profitable. I tried your system on several time basis (1min, 5min, 15min etc) but also couldn’t find a reasonable setting (have not use Pivots). I guess I have to use some pre filter etc here also.
Have you found some settings or additional filters to make the code profitable? Thanks for Help.

Regards,
Bernd :-)

8. JF_Derzi

Very good work!!!

9. mystock

Can i have your email id? I want some pivot afl changes or contact me asap on saeeavinash@gmail.com

Leave Comment

Please login here to leave a comment.

Back