Anyone else having a problem with the print command all of the sudden?

 

None of my print code has changed in quite a while. However, within the last month or so the expert hasn't been printing to the log file during a trade execution.


However, I can take the same code and just print some data to the log file at the time the tick goes through and everything prints to the log file like it should.


I've included my code here below. If the trade opens, there shouldn't be any reason why the Print command isn't triggered as well.


void openOrder(string tradesymbol, int tradechart, int idno)

{

string openname, tradename;

int ticket, direction;

double takeprofit = 0;

double stoploss = 0;

int result;

string type;

tradename = TradeChart;

if (idno == TRENDING + tradechart) type = "Trend";

if (idno == RETRACING + tradechart) type = "Retracement";

if (Trade > 0)

{

openname = Name + ": " + tradename + " B on " + type;

if (TakeProfit <= 0) takeprofit = 0;

else takeprofit = NormalizeDouble(MarketInfo(tradesymbol, MODE_ASK) + (TakeProfit * MarketInfo(tradesymbol, MODE_POINT)), MarketInfo(tradesymbol, MODE_DIGITS));

stoploss = NormalizeDouble(iSAR(tradesymbol, tradechart, OpenStep, OpenMax, 0) - (StopBuffer * MarketInfo(tradesymbol, MODE_POINT)), MarketInfo(tradesymbol, MODE_DIGITS));

if (MaxStop > 0)

if ((MarketInfo(tradesymbol, MODE_ASK) - stoploss) / MarketInfo(tradesymbol, MODE_POINT) > MaxStop) return;


printStatus("OpenOrder: " + Name + ", " + Version, tradechart, 0);

Print("-----------------------------------");

Print("Order Info");

Print("-----------------------------------");

Print("Symbol: ", tradesymbol);

Print("OrderType: ", OP_BUY);

Print("LotSize: ", lotSize(tradesymbol, tradechart));

Print("OpenPrice: ", MarketInfo(tradesymbol, MODE_ASK));

Print("OpenSlippage: ", 0);

Print("StopLoss: ", stoploss);

Print("TakeProfit: ", takeprofit);

Print("OpenName: ", openname);

Print("idno: ", idno);

Print("Expiration: ", 0);

Print("Color: ", Green);

result = OrderSend(tradesymbol, OP_BUY, lotSize(tradesymbol, tradechart), MarketInfo(tradesymbol, MODE_ASK), 0, stoploss, takeprofit, openname, idno, 0, Green);

Sleep(2000);

} // Open Buy Order

if (Trade < 0)

{

openname = Name + ": " + tradename + " S on " + type;

if (TakeProfit <= 0) takeprofit = 0;

else takeprofit = NormalizeDouble(MarketInfo(tradesymbol, MODE_BID) - (TakeProfit * MarketInfo(tradesymbol, MODE_POINT)), MarketInfo(tradesymbol, MODE_DIGITS));

stoploss = NormalizeDouble(iSAR(tradesymbol, tradechart, OpenStep, OpenMax, 0) + (StopBuffer * MarketInfo(tradesymbol, MODE_POINT)), MarketInfo(tradesymbol, MODE_DIGITS));

if (MaxStop > 0)

if ((stoploss - MarketInfo(tradesymbol, MODE_BID)) / MarketInfo(tradesymbol, MODE_POINT) > MaxStop) return;

printStatus("OpenOrder: " + Name + ", " + Version, tradechart, 0);

Print("-----------------------------------");

Print("Order Info");

Print("-----------------------------------");

Print("Symbol: ", tradesymbol);

Print("OrderType: ", OP_SELL);

Print("LotSize: ", lotSize(tradesymbol, tradechart));

Print("OpenPrice: ", MarketInfo(tradesymbol, MODE_BID));

Print("OpenSlippage: ", 0);

Print("StopLoss: ", stoploss);

Print("TakeProfit: ", takeprofit);

Print("OpenName: ", openname);

Print("idno: ", idno);

Print("Expiration: ", 0);

Print("Color: ", Green);

result = OrderSend(tradesymbol, OP_SELL, lotSize(tradesymbol, tradechart), MarketInfo(tradesymbol, MODE_BID), 0, stoploss, takeprofit, openname, idno, 0, Red);

Sleep(2000);

} // Open Sell Order

} // OpenOrder

 
I started having a similar problem recently, not related to any change in the system that I could fine, Tech Web | Desktop PCs | Sony Ericsson although not long after getting a replacement battery under the recent apple safety program.
Reason: