I have added the debugging line as followsfxdaytrader wrote:An good idea could be the following for debugging:
Insert something like Print("price: "+price+" take: "+take+" stop: "+stop+" expiry: "+TimeToStr(expiry)); just before the SendSingleTrade-call.
We'll see next week. I am just an amateur-coder, so I may need longer to solve some problems (or to find my mistakes), ...
Code: Select all
if (SendTrade)
{
if (!SendAlertNotTrade)
{
int expiry=0;
Print("price: "+price+" take: "+take+" stop: "+stop+" expiry: "+TimeToStr(expiry));
result = SendSingleTrade(Symbol(), type, TradeComment, SendLots, price, stop, take);
if (result)
{
if (EmailTradeNotification) SendMail("Trade sent ", Symbol() + stype + "trade at " + TimeToStr(TimeCurrent(), TIME_DATE|TIME_MINUTES));
if (AlertPush) AlertNow(WindowExpertName() + " " + Symbol() + " " + stype + " " + DoubleToStr(price, Digits) );
OrderSelect(TicketNo, SELECT_BY_TICKET, MODE_TRADES);
CheckTpSlAreCorrect(type);
}//if (result)
}//if (!SendAlertNotTrade)