[129RC2] Difference between MT4/MT5 code

Not sure bug or intentional feature but would like report difference between MT4 and MT5 code.

MT4 seems to lag behind MT5/Java code. Or I am misinterpreting ? There are other similar cases.

Pseudo code:
//--------------------------------------------------------------------
// Trading rule: Trading signals (On Bar Open)
//--------------------------------------------------------------------                   
LongEntrySignal = (Abs(5) > 2);

ShortEntrySignal = (Abs(5) > 2);


MT4 Code:
   //------------------------
   // Rule: Trading signals
   //------------------------
if (sqIsBarOpen()) {
     // init signals only on bar open 
     LongEntrySignal = (MathAbs(5) > 2);

     ShortEntrySignal = (MathAbs(5) > 2);

   }

MT5 Code:
if (_sqIsBarOpen == true) {
     // init signals only on bar open 
     LongEntrySignal = (NormalizeDouble((double) MathAbs(5), 6) > NormalizeDouble((double26));

     ShortEntrySignal = (NormalizeDouble((double) MathAbs(5), 6) > NormalizeDouble((double26));

   }


FM Code:


diff -r MetaTrader4/blocks/IsGreater.tpl MetaTrader5/blocks/IsGreater.tpl 1c1 < (<@printBlockChild block "#Left#" shift /> > <@printBlockChild block "#Right#" shift />) \ No newline at end of file --- > (NormalizeDouble((double) <@printBlockChild block "#Left#" "0" true />, 6) > NormalizeDouble((double) <@printBlockChild block "#Right#" "0" true />, 6)) \ No newline at end of file



Java Code:


@Override public boolean OnEvaluateComparison() throws TradingException { double val1 = SQUtils.round(Left.evaluateBlock(), 6); double val2 = SQUtils.round(Right.evaluateBlock(), 6); return val1 > val2; }




Attachments
No attachments
  • Votes 0
  • Project StrategyQuant X
  • Type Bug
  • Status Refused
  • Priority Normal

History

DB
#1

Enyx

04.08.2020 16:51

Task created

MF
#2

Mark Fric

05.08.2020 09:01

Status changed from New to Refused

it causes no difference in backtesting
DB
#3

Enyx

05.08.2020 09:21

It's perfectly clear it will not make a big difference in general but it also does not exclude/prove lack of differences. It's question of consistency.


The issue is rounding is gradually introduced/implemented in Java code, MT5 code but MT4 code does not follow up.


Thank you for you comment.




Votes: 0

Drop files to upload

or

choose files

Max size: 5MB

Not allowed: exe, msi, application, reg, php, js, htaccess, htpasswd, gitignore

...
Wait please