Hello Ravi
This is just a quick patch up, try it and maybe you will be able to modify it to suit your exact requirements,
If you need any further modifications, will be able to do so only next week . . .
Cheers
Happy
can try this another version also
This is just a quick patch up, try it and maybe you will be able to modify it to suit your exact requirements,
Code:
MyTF = Param("Time Frame in Minutes",15,1,60*24,1);
TimeFrameSet(in1Minute*MyTF);
e3 = EMA(C,3); e15 = EMA(C,15); e34 = EMA(C,34); e100= EMA(C,100);
Xe3 = H > e3 AND L < e3; Xe15 = H > e15 AND L < e15;
Xe34 = H > e34 AND L < e34; Xe100= H > e100 AND L < e100;
Be3 = BarsSince(xe3); Be15 = BarsSince(xe15);
Be34 = BarsSince(xe34); Be100= BarsSince(xe100);
TimeFrameRestore();
e3Bars = TimeFrameExpand(Be3,in1Minute*MyTF);
e15Bars = TimeFrameExpand(Be15,in1Minute*MyTF);
e34Bars = TimeFrameExpand(Be34,in1Minute*MyTF);
e100Bars = TimeFrameExpand(Be100,in1Minute*MyTF);
GfxSetOverlayMode(0); GfxSetBkMode(2);
GfxSelectFont("Comic Sans MS",10,600);
GfxSetBkColor( colorBlack); GfxSetTextColor(colorBrightGreen);
GfxDrawText("TIME FRAME: " + NumToStr(MyTF,2.0) + " Minutes ",10,15, 1150, 50, 0);
GfxDrawText( "EMA 03: " + NumToStr(e3Bars,2.0) + " Bars, EMA 15: " + NumToStr(e15Bars,2.0) + " Bars ",10,30, 1150, 50, 0);
GfxDrawText( "EMA 34: " + NumToStr(e34Bars,2.0) + " Bars, EMA 100: " + NumToStr(e100Bars,2.0) + " Bars ",10,45, 1150, 75, 0);
Cheers
Happy
can try this another version also
Code:
GfxSetOverlayMode(0); GfxSetBkMode(2);
GfxSelectFont("Comic Sans MS",10,600);
GfxSetBkColor( colorBlack); GfxSetTextColor(colorBrightGreen);
MyTF = Param("Time Frame in Minutes",15,1,1440,1);
TimeFrameSet(in1Minute* MyTF);
e3 = EMA(C,3); e15 = EMA(C,15); e34 = EMA(C,34); e100= EMA(C,100);
Xe3 = H > e3 AND L < e3; Xe15 = H > e15 AND L < e15;
Xe34 = H > e34 AND L < e34; Xe100= H > e100 AND L < e100;
Be3 = BarsSince(xe3); Be15 = BarsSince(xe15);
Be34 = BarsSince(xe34); Be100= BarsSince(xe100);
GfxDrawText("TIME FRAME: " + NumToStr(MyTF,3.0) + " Minutes ",10,15, 1150, 50, 0);
GfxDrawText( "EMA 03: " + NumToStr(Be3,2.0) + " Bars, EMA 15: " + NumToStr(Be15,2.0) + " Bars ",10,30, 1150, 50, 0);
GfxDrawText( "EMA 34: " + NumToStr(Be34,2.0) + " Bars, EMA 100: " + NumToStr(Be100,2.0) + " Bars ",10,45, 1150, 75, 0);
TimeFrameRestore();
Last edited: