romrob:
Select the order and use iBarShift
iBarShift(Symbol(),0,OrderOpenTime() )
Thanks Rob, will try it.
Or do it yourself
int start() { static datetime Time.newBar; // Or test EACH tick (Volume[0]<=1) bool newBar = (Time[0] > Time.newBar); if (newBar) { // A new bar began. Time.newBar = Time[0]; static int order.bars;// = 0 // Initialized after the OrderSend(). order.bars++; // How many bars has order been open. //... } //... OrderSend(...); order.bars = 0; // Reset for next bar. }
WHRoeder:
Or do it yourself
Or do it yourself
WHRoeder Thanks a lot buddy, I will try this too.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi All
I need help on EA programming.
How to identify How many Bar(s) have passed from my opening position.
Thank you
Regards
Willy