EA opens SELL orders but no BUY orders
You don't tell us whether the EA tries to place orders and fails or whether no attempts to buy are made.
What does getlasterror() return?
A buy order is opened at Ask, not bid.
Oh, sorry, I really didn't know about that haha. My code is basically snippets of other EAs and indicators.
getlasterror() returns:
2016.05.29 03:53:24.731 2016.05.27 22:50 IchiCloudScalp DAX30,M1: Error opening BUY order : 138
2016.05.29 03:53:24.731 2016.05.27 22:50 IchiCloudScalp DAX30,M1: OrderSend error 138
Thanks for the hint, I switched out those Asks and Bids simply for iOpen(NULL,0,0) now.
Oh my goodness.. nevermind, now I understand what you meant. I just switched out the Bid in OrderSend with Ask, and it opened a BUY position. It works fine now.
Thank you!
Hello everybody,
I've been trying to make my very first self-made EA, but I've been failing to get it to open BUY orders. It seems to open SELL orders just without a problem, and since the code for both OrderSend() are identical, I can't grasp what is going wrong.
This is the relevant part of my code:
You can see that both if(...) have the same content, but switched relational operators... What am I doing wrong?
Thank you for taking your time to read all of this.
Regards,
onefai