Forum

Different value of indicator received from API compared to value shown on tester during backtest

Hi, I am using ADX indicator and the values I received at the time of execution of trade was 69 and 72 for 2 consecutive bars (increasing), while the values shown in tester for that trade was 62.5 and 58 (reducing). I have observed the same for other indicators also ( Bollinger bands , MACD, EMA

Invalid stops

Hi, I want to set the stop loss for the trade to a particular % of the price. For making it multiple of the ticks, I used the below code: double tickValue = SymbolInfoDouble(_Symbol, SYMBOL_TRADE_TICK_SIZE ); double price = (type == ORDER_TYPE_BUY) ? SymbolInfoDouble(_Symbol, SYMBOL_ASK)

Error 4756 when for Buy or Sell or modify trade

Hi, I get error 4756 everytime I Buy or Sell. Here is the code for using sell status = trade.Sell(Lots, _Symbol, price, sl, tp, "Sell Order"); Below are the values which are used in the above function. Could you please help. I get the same error when trying to modify the trade to set the SL