Dear Seniors,
I am a working professional and want to have a code wherein i can place buy and sell orders.
Strategy name is “Previous day range breakout”
Buy above yesterdays high and Sell below yesterdays low.
If gapup then Sell below yesterdays high
If gapdown then Buy above yesterdays low.
i Have an AFL but it is not giving proper signals.
Prob 1. If Buy signal is generated then if i am on 5 Min TF every 5 Min , after candle closes, Iam getting a buy signal, same for sell signal.
Prob 2. The scanner is skipping some scripts.
Prob3. How to meet Gap up and Gap Down condition.
Thanks in advance for your help.
_SECTION_BEGIN( "PDHL" );
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", ParamColor( "Color", colorBrightGreen ), styleNoTitle | ParamStyle( "Style" ) | GetPriceStyle() );
_SECTION_END();
_SECTION_BEGIN("Previous Days High & Low");
SetPositionSize(1,spsShares);
function CDL( array )
{
doy = DayOfYear();
Lastdoy = doy == LastValue( doy );
Dayline = array * Lastdoy;
return IIf( Dayline, Dayline, Null );
}
H1 = TimeFrameGetPrice( "H", inDaily, -1 );
L1 = TimeFrameGetPrice( "L", inDaily, -1 );
Buy = C > H1;
Sell = C < L1;
Short=Sell;
Cover=Buy;
Buy = ExRem( Buy, Sell );
Sell = ExRem( Sell, Buy );
_SECTION_END();
PlotShapes(Buy*shapeUpArrow,colorWhite,0,H,Offset=-40);
PlotShapes(Sell*shapeDownArrow,colorYellow,0,L,Offset=-40);
I am a working professional and want to have a code wherein i can place buy and sell orders.
Strategy name is “Previous day range breakout”
Buy above yesterdays high and Sell below yesterdays low.
If gapup then Sell below yesterdays high
If gapdown then Buy above yesterdays low.
i Have an AFL but it is not giving proper signals.
Prob 1. If Buy signal is generated then if i am on 5 Min TF every 5 Min , after candle closes, Iam getting a buy signal, same for sell signal.
Prob 2. The scanner is skipping some scripts.
Prob3. How to meet Gap up and Gap Down condition.
Thanks in advance for your help.
_SECTION_BEGIN( "PDHL" );
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", ParamColor( "Color", colorBrightGreen ), styleNoTitle | ParamStyle( "Style" ) | GetPriceStyle() );
_SECTION_END();
_SECTION_BEGIN("Previous Days High & Low");
SetPositionSize(1,spsShares);
function CDL( array )
{
doy = DayOfYear();
Lastdoy = doy == LastValue( doy );
Dayline = array * Lastdoy;
return IIf( Dayline, Dayline, Null );
}
H1 = TimeFrameGetPrice( "H", inDaily, -1 );
L1 = TimeFrameGetPrice( "L", inDaily, -1 );
Buy = C > H1;
Sell = C < L1;
Short=Sell;
Cover=Buy;
Buy = ExRem( Buy, Sell );
Sell = ExRem( Sell, Buy );
_SECTION_END();
PlotShapes(Buy*shapeUpArrow,colorWhite,0,H,Offset=-40);
PlotShapes(Sell*shapeDownArrow,colorYellow,0,L,Offset=-40);