Discussion of article "Expert Advisor based on the "New Trading Dimensions" by Bill Williams" - page 3

 
Vladimir Karputov:

Cleaned it up, fixed it:


Version "1.002" - now "no money to open a position" errors are much less:

Files:
h_ts_bw.mqh  128 kb
 

Oh, great! Thanks ! Let's see !

 

This is how (in the attached file) the testing of the Expert Advisor in the terminal of a well-known broker looks sad. The trawl does not work, and since margin control is not provided, trades are opened but not closed until the end of testing, and then it's the end.

But it does not happen in all terminals, thank God! in adequate ones it happens correctly.

Thank you for keeping the Expert Advisor code up to date!

Files:
2017-08-13.png  116 kb
 
natyog:

This is how (in the attached file) the testing of the Expert Advisor in the terminal of a well-known broker looks sad. The trawl does not work, and since margin control is not provided, trades are opened but not closed until the end of testing, and then it's the end.

But it does not happen in all terminals, thank God! in adequate ones it happens correctly.

Thank you for keeping the Expert Advisor code up to date!


Position modification fixed: version "1.003"

Changes made:

Stop loss and take profit prices should be normalised using CSymbolInfo::NormalizePrice method, not NormalizeDouble. Important.


Files:
h_ts_bw.mqh  129 kb
 

if you replace line 422 if(exp_trade.PositionModify(m_Symbol,NormalizeDouble(StopLoss,s_info.Digits()),pos_info.TakeProfit())) in version "1.002" with

if(exp_trade.PositionModify(m_Symbol,s_info.NormalisePrice(StopLoss),pos_info.TakeProfit()))

same picture

Files:
 
natyog:

if you replace line 422 if(exp_trade.PositionModify(m_Symbol,NormalizeDouble(StopLoss,s_info.Digits()),pos_info.TakeProfit())) in version "1.002" with

if(exp_trade.PositionModify(m_Symbol,s_info.NormalisePrice(StopLoss),pos_info.TakeProfit()))

same picture


We need screenshots from you:

  1. Terminal -"Strategy Tester" window - "Settings" tab
  2. Terminal - "Strategy Tester" window - "Settings" tab.
  3. Type of trading account: netting or hedge
  4. Name of the trading server you are connecting to.
  5. Attach the tester log file.

 
natyog:

if you replace line 422 if(exp_trade.PositionModify(m_Symbol,NormalizeDouble(StopLoss,s_info.Digits()),pos_info.TakeProfit())) in version "1.002" with

if(exp_trade.PositionModify(m_Symbol,s_info.NormalisePrice(StopLoss),pos_info.TakeProfit()))

same picture


Just "replace" something in the file "h_ts_bw.mqh" is not enough. You also need to COMPILE the EA file "tc_bw_new_version_2-02.mq5".

 

Well, that's not serious. Do you really think it wasn't done!? Insulting.

RoboForex terminal, hedge account.

 
natyog:
Well, you're not serious. Do you really think it hasn't been done!? Insulting.

Yeah, great. So we'll just keep looking.

 
and magazine
Files: