Hi
I'm currently trying to code an EA and since I'm a newbie I have some problems
1. Is it possible to define stop loss or close order, with some thing like this: "if (next bar=bull) {closeorder....}" (this is just so you will get the idea)
is it possible some how to refer to future bar's info? e.g "if Close[0]>someprice ....
2.sometimes my EA opens and close position on the same candle, the problem is, since the terms for opening a position are sill valid, it open another position. I'm preventing this by this line:
if (TimeCurrent()-Time[0]<5)
the general idea is that order open only when a new candle opens...do you see any problem with this?
Any help much appreciated!
Cheers,
Nati
I'm currently trying to code an EA and since I'm a newbie I have some problems
1. Is it possible to define stop loss or close order, with some thing like this: "if (next bar=bull) {closeorder....}" (this is just so you will get the idea)
is it possible some how to refer to future bar's info? e.g "if Close[0]>someprice ....
2.sometimes my EA opens and close position on the same candle, the problem is, since the terms for opening a position are sill valid, it open another position. I'm preventing this by this line:
if (TimeCurrent()-Time[0]<5)
the general idea is that order open only when a new candle opens...do you see any problem with this?
Any help much appreciated!
Cheers,
Nati