Quick question hoping for a quick answer.
Here is an excerpt from an EA I have been working on and it places trades just fine during backtesting, however when it comes to live trades everything is executed properly except no trade is taken. Also in the log file it doesnt even appear to attempt to place the trade. (no errors reported)
I have placed Print("Check"); on both top and bottom of the ordersend function and both are printed on the log. TradePair then is == to 3, and I recieve confirmation email.
I am sure I am having a brainfart and this is an easy fix so please help.
Here is an excerpt from an EA I have been working on and it places trades just fine during backtesting, however when it comes to live trades everything is executed properly except no trade is taken. Also in the log file it doesnt even appear to attempt to place the trade. (no errors reported)
I have placed Print("Check"); on both top and bottom of the ordersend function and both are printed on the log. TradePair then is == to 3, and I recieve confirmation email.
I am sure I am having a brainfart and this is an easy fix so please help.
Inserted Code
if (Ask<Price_Limit && SMA8signal()) { if(TradePair == 1) { OrderSend(Symbol(),OP_BUY,LotSize,Ask,3,StopLoss_Price,0,NULL,1,0,Blue); TradePair = 3; if (email_alerts) { string bodyText = "Pair: " + Symbol() + "\nPrice: " + openprice() + "\nStopLoss: " + StopLoss_Price + "\nLots: " + LotSize; SendMail("Buy Order Executed", bodyText); } } }