HeikenAshi[High/Low/Close/Open] Multicharts Implementation

The HeikenAshi[High/Low/Close/Open] implementation in SQX differs from that of MultiCharts.

In MultiCharts the open is computed without shift:
haOpen = (haOpen [1] + haClose [1])/2 ; ////avg open/close 1 bar ago

Note that this misses the Shift parameter.

In SQX:
    public double OnBlockEvaluate(int relativeShift) throws TradingException {
        return Math.min(Chart.Low(relativeShift + Shift), 
                Math.min(Strategy.Indicators.HeikenAshi(Chart).HAOpen.getRounded(relativeShift + Shift), 
                        Strategy.Indicators.HeikenAshi(Chart).HAClose.getRounded(relativeShift + Shift)));  
    }

Note that this uses shift in its computation.

I suspect this one evaded because the HeikenAshi[High/Low/Close/Open] are not testable in SQX. They extend ValueBlock, which does not allow for indicator tests.
I've tested by constructing a class extending IndicatorBlock (that also uses the logic in HeikenAshi base class), then using exported file + import. I've also confirmed with plots of the indicator in MultiCharts and SQX.
Attachments
No attachments
  • Votes +3
  • Project StrategyQuant X
  • Type Bug
  • Status Fixed
  • Priority Normal

History

AS
#1

andreis

14.11.2022 19:55

Task created

E
#2

Emmanuel

14.11.2022 20:18
Voted for this task.
JB
#3

0xjoeblack@proton.me

14.11.2022 20:23
Voted for this task.
b
#4

binhsir

10.02.2023 10:04
Voted for this task.
g
#5

Lee Guan Chuan

14.02.2023 08:31

Status changed from New to Fixed


Votes: +3

Drop files to upload

or

choose files

Max size: 5MB

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

...
Wait please