STRATEGY TESTER: MarketInfo(symbol,MODE_MARGINREQUIRED); New comment rob 2018.01.12 06:08 This code executes as it should in normal operation. In strategy tester the value in the print statement for marginRequired is zero. Anything I can do to the system to make it come alive in strategy tester?Metatrader4 version 4 build 1090 19th May 2017{it is a method of an object} //+------------------------------------------------------------------+ //|set variable values | //+------------------------------------------------------------------+ void setVariableData(int timeFrame=5,int period=14,int adxBefore=14,int mBars=2000,double risk=0.04,double am=100) { bid=MarketInfo(symbol,MODE_BID);//Update Bid and set initally spread=ask-bid; adx=iADX(symbol,timeFrame,period,PRICE_CLOSE,MODE_MAIN,1); adxr=iCustom(symbol,timeFrame,"ADXR",period,adxBefore,mBars,3,1); atr=iATR(symbol,timeFrame,period,1); atrMoney=atr*lotSize; marginRequired=MarketInfo(symbol,MODE_MARGINREQUIRED); Print(__FUNCTION__," margin required ????symbol ",symbol," ",marginRequired); if((adxr==EMPTY_VALUE) || (marginRequired<=0) || (spread<=0)) { descr="NOT ENOUGH DATA"; adx=0; adxr=0; atr=0; csi=0; return; } setCappedWTFData(risk); } Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes How can I get the marginrequired in mt5 Script will not close terminal New comment
This code executes as it should in normal operation. In strategy tester the value in the print statement for marginRequired is zero.
Anything I can do to the system to make it come alive in strategy tester?
Metatrader4 version 4 build 1090 19th May 2017
{it is a method of an object}