Intraday ORB system I want only daily two signals required or required numbers of signals (1st two signals only or 3 like that)

Hi Experts,
I have intraday ORB trading system of my desired time frame on chart . But smaller time frame like 1 min and 5 min giving me more buy and sell signals (not repeated) like if my first condition buy or sell giving signal and next after reversal giving signal like that every time that giving signal. I want to retrict signals daily my desired numbers: I am posting my code please suggest me how to add the other lines as my required thing.

 _SECTION_BEGIN("ORB");
SetChartOptions(0,chartShowArrows|chartShowDates);
F=Param("Filter for ORB",0,0,100,0.05);
T =Param("Target in Points ",1,0,100,0.05);
_N(Ta=ParamList(" Target Line ","SHOW|HIDE"));
_N(BL=ParamList(" Bre.Out Line ","SHOW|HIDE"));
BOTS =ParamTime("Bre.OutStartTime","09:15:00",0);
BOTE=ParamTime("Bre.OutEndTime","09:15:00",0);
TCT = ParamTime("Trade Close Time","15:15:00",0);
dec = (Param("Decimals",2,0,7,1)/10)+1;
SetChartBkColor(ParamColor("Outer panel",colorBlack)); 
SetChartBkGradientFill(ParamColor("Inner panel upper",colorBlack),ParamColor("Inner panel lower",colorBlack));
NewDay = Day()!= Ref(Day(), -1);
EndDay = (Day()!= Ref(Day(), 1));
Breakoutstart=TimeNum()>BOTS-100 AND TimeNum()<=BOTS;
BreakoutEnd=TimeNum()>BOTE-100 AND TimeNum()<=BOTE;
TradeCloseTime = TimeNum()>TCT-100 AND TimeNum()<=TCT;
ORBHigh = ValueWhen(TimeNum()<=BOTE,HighestSince(BreakoutStart,H));
ORBLow = ValueWhen(TimeNum()<=BOTE,LowestSince(Breakoutstart,L));
ABHIGH = ValueWhen(TimeNum()<=TCT ,HighestSince(BreakoutEnd,H));
ABLOW = ValueWhen(TimeNum()<=TCT,LowestSince(BreakoutEnd,L));
Range = ORBHigh-ORBLow;
BuyFirst= ORBHigh+F;
SellFirst=ORBLow-F;
Range1 = BuyFirst-SellFirst;
DayHigh = TimeFrameGetPrice("H",inDaily);
DayLow  = TimeFrameGetPrice("L", inDaily);
Buycond = H >BuyFirst;
Sellcond= L <SellFirst;
Buy =  Buycond AND TimeNum()>BOTE AND TimeNum()<TCT;
Short= Sellcond AND TimeNum()>BOTE AND TimeNum()<TCT;
Cover = Buy OR TimeNum()==TCT;
Sell = Short OR TimeNum()==TCT;
Buy = ExRem(Buy,Sell);
Sell= ExRem(Sell,Buy);
Short= ExRem(Short,Cover);
Cover=ExRem(Cover,Short);
Bp = BuyFirst;
Sp = SellFirst;
BuyTar1 = Bp+Range;
Selltar1=Sp-Range;

Buy = Buy;
Short = Short;
Sell = H>BuyTar1 OR Sell ;
Cover= L<SellTar1 OR Cover;

Buy = ExRem(Buy,Sell);
Sell= ExRem(Sell,Buy);
Short= ExRem(Short,Cover);
Cover=ExRem(Cover,Short);


PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0, L, Offset=-20);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorLime, 0,L, Offset=-30);                      
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-25); 
PlotShapes(IIf(Short, shapeSquare, shapeNone),colorRed, 0, H, Offset=20);
PlotShapes(IIf(Short, shapeSquare, shapeNone),colorOrange, 0,H, Offset=30);                      
PlotShapes(IIf(Short, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-25);
//PlotShapes(IIf(Sell1, shapeSquare, shapeNone),colorGreen, 0, H, Offset=40);
//PlotShapes(IIf(Sell1, shapeSquare, shapeNone),colorLime, 0,H, Offset=50);                      
PlotShapes(IIf(Sell, shapeStar, shapeNone),colorWhite, 0,H, Offset=45);
//PlotShapes(IIf(Cover1, shapeSquare, shapeNone),colorRed, 0, L, Offset=-55);
//PlotShapes(IIf(Cover1, shapeSquare, shapeNone),colorOrange, 0,L, Offset=-65);                      
PlotShapes(IIf(Cover, shapeStar, shapeNone),colorWhite, 0,L, Offset=-60); 
TrendColor = IIf(TimeNum()<=BOTE,colorPaleBlue,IIf(TimeNum()>TCT,colorPaleBlue,IIf(C>BuyFirst,colorBrightGreen, IIf(C<SellFirst ,colorRed,IIf(H>=BuyFirst AND L<=SellFirst ,colorGold,colorWhite))))); 
SetBarFillColor(TrendColor);
Plot(C,"",TrendColor,styleCandle);
Plot(TradeCloseTime,"",colorWhite,styleHistogram|styleOwnScale);
if(Ta=="SHOW")
{
Plot(BuyTar1,"",colorLime,styleDashed);
Plot(SellTar1,"",colorRed,styleDashed);
}
else
{
}
if(BL=="SHOW")
{
Plot(BuyFirst,"",colorLime,styleThick);
Plot(SellFirst,"",colorRed,styleThick);
}
else
{
}

3 Likes

@Cmiriyala I agree with @Milosz, please do not mess up the forum with duplicate posts. You will NOT get faster help that way , in fact it makes the most helpful members of this forum less likely to help you.

For your question about limiting your number of trades try reading and implementing code found in this official Knowledge Base article,

http://www.amibroker.com/kb/2015/09/26/limit-number-of-trades-per-day-in-a-backtest/

2 Likes

Sorry for the repost. I thought both are different. Next time it wont happen

Sorry for the repost . I though it may reach different groups as I was memeber in other website need to post different groups different thought like that.

It wont happen in future . And thanx for your link for me

Please give me idea of that code where to post in my existing code???

@Cmiriyala the article is self-explanatory. What codes have you tried to implement and what is not working? Show us a couple of different attempts you have written using the article's information that have been unsuccessful for you.

Try building your code gradually, start with perhaps the Long only signals. Once you have that working properly then add in your Short selling signals.

1 Like