Help - about variables
- How to define global variables for each open position?
- [ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3.
- Help set delay on open new order
double x; //Your variable if ((x == your_price) && (//insert condition to detect no current position)) { //insert your trading code }
I didnt understand. I will try to explain my problem in other way.
"x" is changing with time.
"price" should take value of x when all conditions are met.
Example:
x is always changes and my program start first trade when x = 1.205. And my "price" is equal to 1.205.
Trade 1:
x = always changes
price = 1.205 and during the trade its value must be same
Trade 2:
x = always changes
price = 1.228 (assume conditions for second trade were met at that value) and during the trade "price" value must be same as before.
double x; //Your variable if ((x == your_price) && (//insert condition to detect no current position))
Doubles are rarely equal. Understand the links in:
The == operand. - MQL4 programming forum #2 2013.06.07