Professional Documents
Culture Documents
People those who come across the JFT indicator are always amazed by
the price action happening at these zones.
I also was curious when I first came across this indicator and wanted to
know the logic as I bit knowledgeable in various programming
languages.
It was told that by spending lakhs this indicator was developed and so
the source code is locked by the seller of the course and indicator.
Somehow my curiosity was pushing me to find the logic so on a
weekend analyzed 60 days of “Reliance” price and the daily zones top
and bottom and figured out the logic.
The logic is nothing but ADR (Average Daily Range)
Let us see how to make the zones (same logic applies to week and
month zones)
o Daily Range = High – Low
o Take previous 10 days daily range and divide by 10 == ADR10
o Take previous 5 days daily range and divide by 5 == ADR5
o Now to form the zone we need the open price of the Day == Open
o We have 2 lines at the top and 2 lines at the bottom
o Top line 1 = Open + ADR10/2
o Top line 2 = Open + ADR5/2
o Bottom line 1 = Open - ADR5/2
o Bottom line 2 = Open - ADR5/2
The source code in version4 of pine is below.
//@version=4
study(title="DzonesV4", shorttitle="DZV4", overlay=true)
//*****************DAILY*****************//
DR = input(true, title="Show Daily Ranges")
WR = input(true, title="Show Week Ranges")
MR = input(false, title="Show Month Ranges")
OPEN=security(syminfo.tickerid, 'D',
open,lookahead=barmerge.lookahead_on)
dayrange=(high - low)
r1 = security(syminfo.tickerid, 'D',
dayrange[1],lookahead=barmerge.lookahead_on)
r2 = security(syminfo.tickerid, 'D',
dayrange[2],lookahead=barmerge.lookahead_on)
r3 = security(syminfo.tickerid, 'D',
dayrange[3],lookahead=barmerge.lookahead_on)
r4= security(syminfo.tickerid, 'D',
dayrange[4],lookahead=barmerge.lookahead_on)
r5= security(syminfo.tickerid, 'D',
dayrange[5],lookahead=barmerge.lookahead_on)
r6 = security(syminfo.tickerid, 'D',
dayrange[6],lookahead=barmerge.lookahead_on)
r7 = security(syminfo.tickerid, 'D',
dayrange[7],lookahead=barmerge.lookahead_on)
r8 = security(syminfo.tickerid, 'D',
dayrange[8],lookahead=barmerge.lookahead_on)
r9= security(syminfo.tickerid, 'D',
dayrange[9],lookahead=barmerge.lookahead_on)
r10= security(syminfo.tickerid, 'D',
dayrange[10],lookahead=barmerge.lookahead_on)
DailyL1=plot(DR?(OPEN-(adr_10/2)):na,
title="DailyL1",style=plot.style_circles,
color=color.green,linewidth=2)
DailyL2=plot(DR?(OPEN-(adr_5/2)):na,
title="DailyL2",style=plot.style_circles,
color=color.green,linewidth=2)
fill(DailyL1,DailyL2,color=color.lime)
fill(DailyH1,DailyH2,color=color.maroon)
//**********//////////WEEKLY///////****************
WOPEN=security(syminfo.tickerid, 'W',
open,lookahead=barmerge.lookahead_on)
weekrange=(high - low)
w1 = security(syminfo.tickerid, 'W',
weekrange[1],lookahead=barmerge.lookahead_on)
w2 = security(syminfo.tickerid, 'W',
weekrange[2],lookahead=barmerge.lookahead_on)
w3 = security(syminfo.tickerid, 'W',
weekrange[3],lookahead=barmerge.lookahead_on)
w4= security(syminfo.tickerid, 'W',
weekrange[4],lookahead=barmerge.lookahead_on)
w5= security(syminfo.tickerid, 'W',
weekrange[5],lookahead=barmerge.lookahead_on)
w6 = security(syminfo.tickerid, 'W',
weekrange[6],lookahead=barmerge.lookahead_on)
w7 = security(syminfo.tickerid, 'W',
weekrange[7],lookahead=barmerge.lookahead_on)
w8 = security(syminfo.tickerid, 'W',
weekrange[8],lookahead=barmerge.lookahead_on)
w9= security(syminfo.tickerid, 'W',
weekrange[9],lookahead=barmerge.lookahead_on)
w10= security(syminfo.tickerid, 'W',
weekrange[10],lookahead=barmerge.lookahead_on)
//plot
// WeekH1=plot((WOPEN+(awr_10/2)) ,
title="WeekH1",style=circles,color=red,linewidth=2)
// WeekH2=plot((WOPEN+(awr_5/2)) ,
title="WeekH2",style=circles,color=red,linewidth=2)
// WeekL1=plot((WOPEN-(awr_10/2)), title="WeekL1",style=circles,
color=green,linewidth=2)
// WeekL2=plot((WOPEN-(awr_5/2)), title="WeekL2",style=circles,
color=green,linewidth=2)
WeekH1=plot(WR?(WOPEN+(awr_10/2)):na ,
title="WeekH1",style=plot.style_circles,color=color.fuchsia,linewidth=
2)
WeekH2=plot(WR?(WOPEN+(awr_5/2)):na ,
title="WeekH2",style=plot.style_circles,color=color.fuchsia,linewidth=
2)
WeekL1=plot(WR?(WOPEN-(awr_10/2)):na,
title="WeekL1",style=plot.style_circles,
color=color.fuchsia,linewidth=2)
WeekL2=plot(WR?(WOPEN-(awr_5/2)):na,
title="WeekL2",style=plot.style_circles,
color=color.fuchsia,linewidth=2)
fill(WeekL1,WeekL2,color=color.lime)
fill(WeekH1,WeekH2,color=color.maroon)
//**********//////////MONTHLY///////****************
MOPEN=security(syminfo.tickerid, 'M',
open,lookahead=barmerge.lookahead_on)
MONrange=(high - low)
M1 = security(syminfo.tickerid, 'M',
MONrange[1],lookahead=barmerge.lookahead_on)
M2 = security(syminfo.tickerid, 'M',
MONrange[2],lookahead=barmerge.lookahead_on)
M3 = security(syminfo.tickerid, 'M',
MONrange[3],lookahead=barmerge.lookahead_on)
M4= security(syminfo.tickerid, 'M',
MONrange[4],lookahead=barmerge.lookahead_on)
M5= security(syminfo.tickerid, 'M',
MONrange[5],lookahead=barmerge.lookahead_on)
M6 = security(syminfo.tickerid, 'M',
MONrange[6],lookahead=barmerge.lookahead_on)
M7 = security(syminfo.tickerid, 'M',
MONrange[7],lookahead=barmerge.lookahead_on)
M8 = security(syminfo.tickerid, 'M',
MONrange[8],lookahead=barmerge.lookahead_on)
M9= security(syminfo.tickerid, 'M',
MONrange[9],lookahead=barmerge.lookahead_on)
M10= security(syminfo.tickerid, 'M',
MONrange[10],lookahead=barmerge.lookahead_on)
aMr_10 = (M1+M2+M3+M4+M5+M6+M7+M8+M9+M10) /10
aMr_5 = (M1+M2+M3+M4+M5) /5
MONH1=plot(MR?(MOPEN+(aMr_10/2)):na ,
title="MONH1",style=plot.style_circles,color=color.black,linewidth=2)
MONH2=plot(MR?(MOPEN+(aMr_5/2)):na ,
title="MONH2",style=plot.style_circles,color=color.black,linewidth=2)
MONL1=plot(MR?(MOPEN-(aMr_10/2)):na,
title="MONL1",style=plot.style_circles, color=color.black,linewidth=2)
MONL2=plot(MR?(MOPEN-(aMr_5/2)):na,
title="MONL2",style=plot.style_circles, color=color.black,linewidth=2)
fill(MONL1,MONL2,color=color.lime)
fill(MONH1,MONH2,color=color.maroon)
===========