Can anyone see why this EA only goes short?
-
https://fxdreema.com/shared/fcMEPv6Wd
I've probably done something stupid, but been looking at this far too long now and can't spot my error

-
You are using the exact same variable for the stop loss value for buys and sells. That means buys and sells are overwriting their different prices on the same place and I can't see where and when that variable is reset to 0. I recommend you to duplicate it, one for buys and another one for sells, and then reset the proper one to 0 every time a new pendit order is launched.
-

@specialfx I think the "price of the last deal" is actually not what you want. It doesn't refer to your trades, but instead all of the market. Actually it doesn't seem to work at all, at least on demo account - the value is always 0.It doesn't open buys, because 0 is never above MA.
It does open sells, because 0 is always below MA. -
@roar Is that the "Depth of market" view? I don't think it works in mt4. mt5 maybe if broker provides it.
-
@trader-philipps Yeah, I think youre right
-
Thanks all!