Need help for ea envelope
-
Guys can someone help me i totally messed up somewhere in my project. Ea doesn't open orders, and i cannot see where the problem is. Here is my project share:
shared/hZ7Ns1v1bIdea is that EA trades on touching envelope lines.
Buy conditions:
Price touches lower red envelope needs to open buy order(market order)Sell Condition:
Price touches upper Blue envelope line, ea opens sell order( market)Ea has trailing stop break even
I want to choose type of order
IN settings should be Choose Type f order Market or Stop order
In case that market order is selected, order should be executed as soon as price touch line
In case that Stop order is selected , as soon a Buy condition is met ea will place buy stop at x pips from current price, and if Sell condition is met ea should place Sell stop at x pips from price.Spread control...dont send order if maximum spread is bigger then x.
-
When you are using == to compare two prices, don't forget that the price of everything (candles, indicators) depends on the ticks, but those ticks are coming when they want and the Ask/Bid price is always different. So it's practically wrong to use ==, because you will most likely miss the exact price, and you can miss the price with 0.00001 difference. Simply don't use == to compare prices, use anything else. Use == to check exact values, for example to check whether something is 1 or 0, or some other known value.
-
Thanks, maybe its better to use candle body then price