Help needed from seniors.

johnnypareek

Well-Known Member
#11
Hello seniors,
This is scanner afl but when i scanning not able to get Current date data.
It is giving previous trading day data.

Help needed - it should scan for same day and previous dates too.

(Current date data not coming).





Code below
Code:
_SECTION_BEGIN("PRICE CHART");
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", colorWhite , styleNoTitle | styleCandle | GetPriceStyle() ); 
//



 x =  DEMA(C,2);
Plot(x,"",colorBrightGreen,styleLine);


Hld = IIf( x > Ref( EMA(H, 10), -1), 1, IIf( x < Ref( EMA(C, 10), -1), -1, 0));
Hlv = ValueWhen(Hld != 0, Hld, 1);
Hilo = IIf(Hlv == -1, EMA(H, 10),  EMA(L, 10));
Trigger = IIf( x > Hilo, colorCustom11, colorOrange);
Plot(Hilo,"SUPPORT OR RESISTANCE",Trigger,styleStaircase);
Lohi = IIf(Hlv == -1, EMA(H, 10),  EMA(L, 10));
LOHITrigger = IIf ( X > Lohi, colorGreen, colorRed); 
Plot(Lohi,"LOHI",LOHITrigger, styleStaircase);

GraphXSpace=15;


per1=Param ("per1", 2.0,0.1,50,0.10);

per=per1;
x = Cum(1);
s1=L;
s11=H;
pS = TroughBars( s1, per, 1 ) == 0;
endt= SelectedValue(ValueWhen( pS, x, 1 ));
startt=SelectedValue(ValueWhen( pS, x, 2 ));
dtS =endt-startt;
endS = SelectedValue(ValueWhen( pS, s1, 1 ) );
startS = SelectedValue( ValueWhen( pS, s1, 1 ));
aS = (endS-startS)/dtS;
bS = endS;
trendlineS = aS * ( x -endt ) + bS;
g3= IIf(x>startt-10,trendlineS,-1e10);
//Plot(g3,"",colorRed,styleDashed);

pR = PeakBars( s11, per, 1 ) == 0;
endt1= SelectedValue(ValueWhen( pR, x, 1 ));
startt1=SelectedValue(ValueWhen( pR, x, 2 ));
dtR =endt1-startt1;
endR = SelectedValue(ValueWhen( pR, s11, 1 ) );
startR = SelectedValue( ValueWhen( pR, s11, 1 ));
aR = (endR-startR)/dtR;
bR = endR;
trendlineR = aR * ( x -endt1 ) + bR;
g4= IIf(x>startT1-10,trendlineR,-1e10);
//Plot(g4,"",colorGreen,styleDashed);
//////////////////////////////////////////////////////////////////////////////////////////////////
perc=per1;
x=BarIndex();xx=SelectedValue(x);
t1=SelectedValue(ValueWhen(PeakBars(C,perc)==0,x)) ;
H1=SelectedValue(ValueWhen(PeakBars(C,perc)==0,C)) ;
t11=SelectedValue(ValueWhen(TroughBars(C,perc)==0, x));
H11=SelectedValue(ValueWhen(TroughBars(C,perc)==0, C));
g=t1>t11;
/////////////////////////////////////////////////////////////////////////////////////////////////

per=per1;

x = Cum(1);
s1=C;
s11=C;
pS = TroughBars( s1, per, 1 ) == 0;
endt= SelectedValue(ValueWhen( pS, x, 1 ));
startt=SelectedValue(ValueWhen( pS, x, 2 ));
dtS =endt-startt;
endS = SelectedValue(ValueWhen( pS, s1, 1 ) );
startS = SelectedValue( ValueWhen( pS, s1, 2 ));
aS = (endS-startS)/dtS;
bS = endS;
trendlineS = aS * ( x -endt ) + bS;
g3= IIf(x>startt-10,trendlineS,-1e10);

pR = PeakBars( s11, per, 1 ) == 0;
endt1= SelectedValue(ValueWhen( pR, x, 1 ));
startt1=SelectedValue(ValueWhen( pR, x, 2 ));
dtR =endt1-startt1;
endR = SelectedValue(ValueWhen( pR, s11, 1 ) );
startR = SelectedValue( ValueWhen( pR, s11, 2 ));
aR = (endR-startR)/dtR;
bR = endR;
trendlineR = aR * ( x -endt1 ) + bR;
g4= IIf(x>startT1-10,trendlineR,-1e10);


SBuy = pS;
RSell= pR;


Buy =  PS;
Sell = PR;
 


Filter=Buy OR Sell; 
Sell=ExRem(Sell,Buy); 
Buy=ExRem(Buy,Sell);


Shape = (Buy * shapeSmallUpTriangle + Sell * shapeSmallDownTriangle);
PlotShapes( shape, IIf( Buy, colorYellow, colorYellow ),0, IIf( Buy, Low,High ) );

dist = 0.5*ATR(10); 
for( i = 0; i < BarCount; i++ ) 
{ 
if( Buy[i] ) PlotText( " BUY " + L[ i ], i, L[ i ]-dist[i], colorCustom11); 
if( Sell[i] ) PlotText( " SELL " + H[ i ], i, H[ i ]+dist[i], colorCustom12); 
}


Thanx you in advance.


hmm

Was unable to chk thruly but please note that it looks into future. now check in setting , check that "Range" is selected as last bar

try it out
 
#12
hmm

Was unable to chk thruly but please note that it looks into future. now check in setting , check that "Range" is selected as last bar

try it out
hello Johnny, Good morning..

I m using this since long.. i didnt feel it as future Quote.

Kindly pls help me to Plot the code for Same day exploration.

WAITING FOR UR HELP.



THANX YOU
 

johnnypareek

Well-Known Member
#13
Hi Shruti,

When I scan in daily time frame, its gave me sell on spot nifty. and it was all right. Explain clearly.

Hmm okay u said explore. added exploration. chk if it works for u.

HTML:
_SECTION_BEGIN("PRICE CHART");
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", colorWhite , styleNoTitle | styleCandle | GetPriceStyle() ); 
//



 x =  DEMA(C,2);
Plot(x,"",colorBrightGreen,styleLine);


Hld = IIf( x > Ref( EMA(H, 10), -1), 1, IIf( x < Ref( EMA(C, 10), -1), -1, 0));
Hlv = ValueWhen(Hld != 0, Hld, 1);
Hilo = IIf(Hlv == -1, EMA(H, 10),  EMA(L, 10));
Trigger = IIf( x > Hilo, colorCustom11, colorOrange);
Plot(Hilo,"SUPPORT OR RESISTANCE",Trigger,styleStaircase);
Lohi = IIf(Hlv == -1, EMA(H, 10),  EMA(L, 10));
LOHITrigger = IIf ( X > Lohi, colorGreen, colorRed); 
Plot(Lohi,"LOHI",LOHITrigger, styleStaircase);

GraphXSpace=15;


per1=Param ("per1", 2.0,0.1,50,0.10);

per=per1;
x = Cum(1);
s1=L;
s11=H;
pS = TroughBars( s1, per, 1 ) == 0;
endt= SelectedValue(ValueWhen( pS, x, 1 ));
startt=SelectedValue(ValueWhen( pS, x, 2 ));
dtS =endt-startt;
endS = SelectedValue(ValueWhen( pS, s1, 1 ) );
startS = SelectedValue( ValueWhen( pS, s1, 1 ));
aS = (endS-startS)/dtS;
bS = endS;
trendlineS = aS * ( x -endt ) + bS;
g3= IIf(x>startt-10,trendlineS,-1e10);
//Plot(g3,"",colorRed,styleDashed);

pR = PeakBars( s11, per, 1 ) == 0;
endt1= SelectedValue(ValueWhen( pR, x, 1 ));
startt1=SelectedValue(ValueWhen( pR, x, 2 ));
dtR =endt1-startt1;
endR = SelectedValue(ValueWhen( pR, s11, 1 ) );
startR = SelectedValue( ValueWhen( pR, s11, 1 ));
aR = (endR-startR)/dtR;
bR = endR;
trendlineR = aR * ( x -endt1 ) + bR;
g4= IIf(x>startT1-10,trendlineR,-1e10);
//Plot(g4,"",colorGreen,styleDashed);
//////////////////////////////////////////////////////////////////////////////////////////////////
perc=per1;
x=BarIndex();xx=SelectedValue(x);
t1=SelectedValue(ValueWhen(PeakBars(C,perc)==0,x)) ;
H1=SelectedValue(ValueWhen(PeakBars(C,perc)==0,C)) ;
t11=SelectedValue(ValueWhen(TroughBars(C,perc)==0, x));
H11=SelectedValue(ValueWhen(TroughBars(C,perc)==0, C));
g=t1>t11;
/////////////////////////////////////////////////////////////////////////////////////////////////

per=per1;

x = Cum(1);
s1=C;
s11=C;
pS = TroughBars( s1, per, 1 ) == 0;
endt= SelectedValue(ValueWhen( pS, x, 1 ));
startt=SelectedValue(ValueWhen( pS, x, 2 ));
dtS =endt-startt;
endS = SelectedValue(ValueWhen( pS, s1, 1 ) );
startS = SelectedValue( ValueWhen( pS, s1, 2 ));
aS = (endS-startS)/dtS;
bS = endS;
trendlineS = aS * ( x -endt ) + bS;
g3= IIf(x>startt-10,trendlineS,-1e10);

pR = PeakBars( s11, per, 1 ) == 0;
endt1= SelectedValue(ValueWhen( pR, x, 1 ));
startt1=SelectedValue(ValueWhen( pR, x, 2 ));
dtR =endt1-startt1;
endR = SelectedValue(ValueWhen( pR, s11, 1 ) );
startR = SelectedValue( ValueWhen( pR, s11, 2 ));
aR = (endR-startR)/dtR;
bR = endR;
trendlineR = aR * ( x -endt1 ) + bR;
g4= IIf(x>startT1-10,trendlineR,-1e10);


SBuy = pS;
RSell= pR;


Buy =  PS;
Sell = PR;
 


Filter=Buy OR Sell; 
Sell=ExRem(Sell,Buy); 
Buy=ExRem(Buy,Sell);
AddColumn( C, "Closing,", 1.2, IIf( C > Ref( C, -1 ), colorBlue, colorRed ) );
AddColumn( Buy, "buy,", 1.2);
AddColumn( Sell, "sell,", 1.2 );


Shape = (Buy * shapeSmallUpTriangle + Sell * shapeSmallDownTriangle);
PlotShapes( shape, IIf( Buy, colorYellow, colorYellow ),0, IIf( Buy, Low,High ) );

dist = 0.5*ATR(10); 
for( i = 0; i < BarCount; i++ ) 
{ 
if( Buy[i] ) PlotText( " BUY " + L[ i ], i, L[ i ]-dist[i], colorCustom11); 
if( Sell[i] ) PlotText( " SELL " + H[ i ], i, H[ i ]+dist[i], colorCustom12); 
}
 
Last edited:

hmsanil

Active Member
#14
Hi Shruti,

When I scan in daily time frame, its gave me sell on spot nifty. and it was all right. Explain clearly.

Hmm okay u said explore. added exploration. chk if it works for u.

HTML:
_SECTION_BEGIN("PRICE CHART");
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", colorWhite , styleNoTitle | styleCandle | GetPriceStyle() ); 
//



 x =  DEMA(C,2);
Plot(x,"",colorBrightGreen,styleLine);


Hld = IIf( x > Ref( EMA(H, 10), -1), 1, IIf( x < Ref( EMA(C, 10), -1), -1, 0));
Hlv = ValueWhen(Hld != 0, Hld, 1);
Hilo = IIf(Hlv == -1, EMA(H, 10),  EMA(L, 10));
Trigger = IIf( x > Hilo, colorCustom11, colorOrange);
Plot(Hilo,"SUPPORT OR RESISTANCE",Trigger,styleStaircase);
Lohi = IIf(Hlv == -1, EMA(H, 10),  EMA(L, 10));
LOHITrigger = IIf ( X > Lohi, colorGreen, colorRed); 
Plot(Lohi,"LOHI",LOHITrigger, styleStaircase);

GraphXSpace=15;


per1=Param ("per1", 2.0,0.1,50,0.10);

per=per1;
x = Cum(1);
s1=L;
s11=H;
pS = TroughBars( s1, per, 1 ) == 0;
endt= SelectedValue(ValueWhen( pS, x, 1 ));
startt=SelectedValue(ValueWhen( pS, x, 2 ));
dtS =endt-startt;
endS = SelectedValue(ValueWhen( pS, s1, 1 ) );
startS = SelectedValue( ValueWhen( pS, s1, 1 ));
aS = (endS-startS)/dtS;
bS = endS;
trendlineS = aS * ( x -endt ) + bS;
g3= IIf(x>startt-10,trendlineS,-1e10);
//Plot(g3,"",colorRed,styleDashed);

pR = PeakBars( s11, per, 1 ) == 0;
endt1= SelectedValue(ValueWhen( pR, x, 1 ));
startt1=SelectedValue(ValueWhen( pR, x, 2 ));
dtR =endt1-startt1;
endR = SelectedValue(ValueWhen( pR, s11, 1 ) );
startR = SelectedValue( ValueWhen( pR, s11, 1 ));
aR = (endR-startR)/dtR;
bR = endR;
trendlineR = aR * ( x -endt1 ) + bR;
g4= IIf(x>startT1-10,trendlineR,-1e10);
//Plot(g4,"",colorGreen,styleDashed);
//////////////////////////////////////////////////////////////////////////////////////////////////
perc=per1;
x=BarIndex();xx=SelectedValue(x);
t1=SelectedValue(ValueWhen(PeakBars(C,perc)==0,x)) ;
H1=SelectedValue(ValueWhen(PeakBars(C,perc)==0,C)) ;
t11=SelectedValue(ValueWhen(TroughBars(C,perc)==0, x));
H11=SelectedValue(ValueWhen(TroughBars(C,perc)==0, C));
g=t1>t11;
/////////////////////////////////////////////////////////////////////////////////////////////////

per=per1;

x = Cum(1);
s1=C;
s11=C;
pS = TroughBars( s1, per, 1 ) == 0;
endt= SelectedValue(ValueWhen( pS, x, 1 ));
startt=SelectedValue(ValueWhen( pS, x, 2 ));
dtS =endt-startt;
endS = SelectedValue(ValueWhen( pS, s1, 1 ) );
startS = SelectedValue( ValueWhen( pS, s1, 2 ));
aS = (endS-startS)/dtS;
bS = endS;
trendlineS = aS * ( x -endt ) + bS;
g3= IIf(x>startt-10,trendlineS,-1e10);

pR = PeakBars( s11, per, 1 ) == 0;
endt1= SelectedValue(ValueWhen( pR, x, 1 ));
startt1=SelectedValue(ValueWhen( pR, x, 2 ));
dtR =endt1-startt1;
endR = SelectedValue(ValueWhen( pR, s11, 1 ) );
startR = SelectedValue( ValueWhen( pR, s11, 2 ));
aR = (endR-startR)/dtR;
bR = endR;
trendlineR = aR * ( x -endt1 ) + bR;
g4= IIf(x>startT1-10,trendlineR,-1e10);


SBuy = pS;
RSell= pR;


Buy =  PS;
Sell = PR;
 


Filter=Buy OR Sell; 
Sell=ExRem(Sell,Buy); 
Buy=ExRem(Buy,Sell);
AddColumn( C, "Closing,", 1.2, IIf( C > Ref( C, -1 ), colorBlue, colorRed ) );
AddColumn( Buy, "buy,", 1.2);
AddColumn( Sell, "sell,", 1.2 );


Shape = (Buy * shapeSmallUpTriangle + Sell * shapeSmallDownTriangle);
PlotShapes( shape, IIf( Buy, colorYellow, colorYellow ),0, IIf( Buy, Low,High ) );

dist = 0.5*ATR(10); 
for( i = 0; i < BarCount; i++ ) 
{ 
if( Buy[i] ) PlotText( " BUY " + L[ i ], i, L[ i ]-dist[i], colorCustom11); 
if( Sell[i] ) PlotText( " SELL " + H[ i ], i, H[ i ]+dist[i], colorCustom12); 
}


Hello Johnny,

Does this indicator looks into future

Thanks
 

johnnypareek

Well-Known Member
#15
Hi,

Yes peak is used which looks into future.

HTML:
73082 data bars used during this check. Total execution time: 0.0716105 sec.
Approximately 4704 past and 4000 future quotes are needed to calculate the formula properly
The buy sell arrow will come after it has moved. and that will come at low high.
 

hmsanil

Active Member
#16
Hi,

Yes peak is used which looks into future.

HTML:
73082 data bars used during this check. Total execution time: 0.0716105 sec.
Approximately 4704 past and 4000 future quotes are needed to calculate the formula properly
The buy sell arrow will come after it has moved. and that will come at low high.
Thanks Genius Johnny
 

mastermind007

Well-Known Member
#17
there was charts and layout pinned on left side below symbol and laye but i delete it how to recover ? thanks
johnnypareek; said:
I assume that u r using ver 5.60. go to window menu and select layers and layout
and click on the Pushpin to keep it upright (RHS top) for pane to stay put!! If pin is horizontal, pane will hide and emerge only if you mouse over it.
 

Similar threads