
Originally Posted by
saintmo
What code do I need to use in order to perform actions only when a bar changes instead of when there is a new tick?
Thanks,
saintmo
Hi saintmo and welcome,
You have to add a limitation per bar, when the actions have been applied.
At the top, add :
Code:
extern int MaxActionsPerBar=1;
int ActionsPerBar=0;
int BarCount=-1;
Before the actions add :
Code:
if(BarCount!=Bars){ActionsPerBar=0;BarCount=Bars;}
In line, after the conditions required to apply the actions :
Code:
&&(ActionsPerBar<=MaxActionsPerBar)
After the actions, add :