Different Zones for MCX Trading

amitrandive

Well-Known Member
#1
Dear All

I need an AFL which marks different timing zones as line for MCX Markets,preferably in different colours.

If possible each time zone should be able to mark its high and low.

Times Zones

10:00 to 13:00 Zone I (Any Colour)
13:01 to 17:30 Zone II (Different colour than Zone I )
17:30 to 23:55 Zone III (Different colour than Zone I and Zone II)

Have attached a conceptual sketch for this.



Thanks in advance for all help.
 

sr114

Well-Known Member
#2
define 3 time window and plot those time window as style area

now the respective hi lo can be plotted as line or may be plotted as shapes

[ i have no mcx data so experimented on banknifty plot]

 

mastermind007

Well-Known Member
#4
f (Interval() < inDaily)
{
if (ParamToggle("Plot Time Shadows?", "No|Yes",1))
{
//10:00 to 13:00 Zone I (Any Colour)
//13:01 to 17:30 Zone II (Different colour than Zone I )
//17:30 to 23:55 Zone III (Different colour than Zone I AND Zone II)
// MCX Setting ; Amit R
zone0 = (TimeNum() <= 130000);
zone1 = (TimeNum() > 130000) AND (TimeNum() <= 173000);
zone2 = (TimeNum() > 173000) AND (TimeNum() <= 235600);

// NSE Market MM07
// Uncomment next 3 lines for NSE market
//zone0 = (TimeNum() <= 110000);
//zone1 = (TimeNum() > 110000) AND (TimeNum() <= 140000);
//zone2 = (TimeNum() > 140000) AND (TimeNum() <= 160000);

HighOfZone0 = IIf(zone0, HHV(High, BarsSince(zone2)), Null);
HighOfZone1 = IIf(zone1, HHV(High, BarsSince(zone0)), Null);
HighOfZone2 = IIf(zone2, HHV(High, BarsSince(zone1)), Null);

LowOfZone0 = IIf(zone0, LLV(Low, BarsSince(zone2)), Null);
LowOfZone1 = IIf(zone1, LLV(Low, BarsSince(zone0)), Null);
LowOfZone2 = IIf(zone2, LLV(Low, BarsSince(zone1)), Null);

//Plot(Close,"", colorBlack, styleCandle);
Plot(HighOfZone0, "", colorBlack, styleStaircase);
Plot(HighOfZone1, "", colorRed, styleStaircase);
Plot(HighOfZone2, "", colorBlue, styleStaircase);

Plot(LowOfZone0, "", colorBlack, styleStaircase);
Plot(LowOfZone1, "", colorRed, styleStaircase);
Plot(LowOfZone2, "", colorBlue, styleStaircase);

Plot(100, "", IIf(zone1, colorCustom15, IIf(zone2,colorPink,colorLightYellow)),
styleOwnScale|styleArea|styleNoLabel, -0.5,100,0,-2);
}
}
 

amitrandive

Well-Known Member
#5
f (Interval() < inDaily)
{
if (ParamToggle("Plot Time Shadows?", "No|Yes",1))
{
//10:00 to 13:00 Zone I (Any Colour)
//13:01 to 17:30 Zone II (Different colour than Zone I )
//17:30 to 23:55 Zone III (Different colour than Zone I AND Zone II)
// MCX Setting ; Amit R
zone0 = (TimeNum() <= 130000);
zone1 = (TimeNum() > 130000) AND (TimeNum() <= 173000);
zone2 = (TimeNum() > 173000) AND (TimeNum() <= 235600);

// NSE Market MM07
// Uncomment next 3 lines for NSE market
//zone0 = (TimeNum() <= 110000);
//zone1 = (TimeNum() > 110000) AND (TimeNum() <= 140000);
//zone2 = (TimeNum() > 140000) AND (TimeNum() <= 160000);

HighOfZone0 = IIf(zone0, HHV(High, BarsSince(zone2)), Null);
HighOfZone1 = IIf(zone1, HHV(High, BarsSince(zone0)), Null);
HighOfZone2 = IIf(zone2, HHV(High, BarsSince(zone1)), Null);

LowOfZone0 = IIf(zone0, LLV(Low, BarsSince(zone2)), Null);
LowOfZone1 = IIf(zone1, LLV(Low, BarsSince(zone0)), Null);
LowOfZone2 = IIf(zone2, LLV(Low, BarsSince(zone1)), Null);

//Plot(Close,"", colorBlack, styleCandle);
Plot(HighOfZone0, "", colorBlack, styleStaircase);
Plot(HighOfZone1, "", colorRed, styleStaircase);
Plot(HighOfZone2, "", colorBlue, styleStaircase);

Plot(LowOfZone0, "", colorBlack, styleStaircase);
Plot(LowOfZone1, "", colorRed, styleStaircase);
Plot(LowOfZone2, "", colorBlue, styleStaircase);

Plot(100, "", IIf(zone1, colorCustom15, IIf(zone2,colorPink,colorLightYellow)),
styleOwnScale|styleArea|styleNoLabel, -0.5,100,0,-2);
}
}
Thanks Mastermind !!!
:clapping: