MetaTrader 5 Build 1700: Synthetic Instruments, Shared Projects and MQL5 Cloud Protector - page 3

 

 
Alain Verleyen:

It's negative exponent, not negative weights.

Is  : 1 / EURUSD_ASK0.576 


Thank you for this pedantry, which has failed to address my original question.

Regardless of correct terminology, as stated, in order to arrive at a correctly formed composite chart, the components of the calculation with negative exponents require their high/low values swapping.

When I've ported my code to MT5, I'll show you the difference between doing so, and not doing so.

 
Hoodlum:

Thank you for this pedantry, which has failed to address my original question.

Regardless of correct terminology, as stated, in order to arrive at a correctly formed composite chart, the components of the calculation with negative exponents require their high/low values swapping.

When I've ported my code to MT5, I'll show you the difference between doing so, and not doing so.


It's a common problem in some cases, but a simple if else statement usually solves that problem.

 
Hoodlum: Thank you for this pedantry, which has failed to address my original question. Regardless of correct terminology, as stated, in order to arrive at a correctly formed composite chart, the components of the calculation with negative exponents require their high/low values swapping. When I've ported my code to MT5, I'll show you the difference between doing so, and not doing so.

Well, might I suggest that instead of waiting for a response from MetaQuotes, that it might just be quicker for you to just use this build and setup a Synthetic USDX and verify for yourself if it is being calculated as you expect it to be.

Then, once you know for certain, then you can post the result. And if not to your expectations, then contact the Service Desk with the information.

There is no point in arguing the point with us users (as we are not privy to the internal workings of MetaQuotes), when a simple test will give you (and us all) the answer you have requested!

EDIT: Remember that you will only be able to detect the discrepancy on the very old bars of a M1 Chart, as all subsequent bars will be based on tick data, nor will you be able to detect the problem on the higher time-frames either.

 
Marco vd Heijden: It's a common problem in some cases, but a simple if else statement usually solves that problem.

Switching the High/Low of the M1 History Bars used by the the calculation is not under user control, so one cannot just use an "if" to solve the problem (if it exists).

Only after testing it will we know if MetaQuotes has implemented it correctly or not. If not, then we will have to use the Service Desk (or the Russian forum) to try convince them to fix it.

 

The main problem with calculation by formula on history is that highs and lows occure at different moments on different instruments mentioned in the formula, in other words they do not correspond to each other.

 
Stanislav Korotky: The main problem with calculation by formula on history is that highs and lows occure at different moments on different instruments mentioned in the formula, in other words they do not correspond to each other.

Since the History Calculations are based on M1 bars, at least the time discrepancies will only be off by a maximum of 60 seconds.

 
Fernando Carreiro:

Since the History Calculations are based on M1 bars, at least the time discrepancies will only be off by a maximum of 60 seconds.

Yes, of course, but this makes a bit senseless all appeals to high/low swaps, because highs/lows are also inside this 60 seconds - at arbitrary moments.

 

Correct approach is to build higher timeframe data from the most granular period available - applying a formula to H1 bars will give a somewhat useful, but ultimately incorrect composite as compared to building it from M1 (or tick if available), with the correct swapping of high/low values for negative exponents, and having corrected for missing bars in any of the components.

My original comment was merely intended to be in the nature of an enquiry if this would be available - I've presumed not, I guess this will work the same as the calculation function on TradingView. It's a nice addition for sure, and can be useful when looking at momentum on synthetics, but not much use when needing to find precise levels.

Will post back when I have more info, trying to get the beta build of 1700 now so I can test.

 
Fernando Carreiro:

Switching the High/Low of the M1 History Bars used by the the calculation is not under user control, so one cannot just use an "if" to solve the problem (if it exists).

Only after testing it will we know if MetaQuotes has implemented it correctly or not. If not, then we will have to use the Service Desk (or the Russian forum) to try convince them to fix it.


That's odd because i have been doing that for years now.

When you send the data to external third party API it will need to know because the color of the candle depends on this data.

So if it wasn't possible my stuff would not work.

I usually multiply or add by a large number to move the decimal point until it becomes a whole (positive) integer.

Maybe i didn't fully understand the question but there sure are a lot of these things that you will have to adapt to make it work properly in MQL.
Reason: