How to get the Bar difference between two orders?

 

Hi :

 

I want to apply the rule that if an order is opened, then in the following, say 30 bars, no same direction order can be opened.

 

I tried to implement this using the Time difference between the two orders, but obviously when it comes to weekend, this will fail.

 

Anyone get any idea how to implement this idea please?

 

Thanks

 
asuralm:

Hi :

 

I want to apply the rule that if an order is opened, then in the following, say 30 bars, no same direction order can be opened.

 

I tried to implement this using the Time difference between the two orders, but obviously when it comes to weekend, this will fail.

 

Anyone get any idea how to implement this idea please?

 

Thanks

 


You can use iBarShift() with open time of your last order.
 
angevoyageur:

You can use iBarShift() with open time of your last order.


Brilliant, that's what I am looking for. 

Thanks