Originally Posted By: Spirit
Yes this will crash. when you look on the troubleshooting page under "crash" you see that its the third most frequent beginners mistake listed there.

The fix:

Code:
ThisTrade = enterShort(1, myEntryPriceShort, myATR, 0, Spread);
if(ThisTrade) {
  MyEntryPrice = myEntryPriceShort; // The script is crashing here. When I quote it there is no crash.
  MyTradeSetBreakEven = 0;
}



Yes, it's working when I am starting the script in "Trade"-Mode. But it differs from the Test-Mode. In the Test-Mode the lines in the If-Statement are skipped. In Trade-Mode they are executed. That's what I need. But it's confusing. It's not logic to me but working. Is it perhaps because of there is just a TradeID when the trade is opened with the broker which is not happening in Test-Mode?

Last edited by SnoopySniff; 02/22/19 19:02.