Hello,
I finally wrote the multiinstrument indicator (correlation between two instruments) as I was asking you here
viewtopic.php?f=6&t=23861without any response from your side...
So the indicator is done, I created my own algorithm how to synchronize data of two instrument for the calculation.
The indicator is working fine, you can try it (code is in attachment LS_I_DirectionalCorrelation_vs_GBPUSD.java)
indicator is calculating correlation index between GBPUSD instrument and instrument of chart where the indicator is added.
I just dont know how to correctly use the indicator in code of strategy for live trading or backtesting to access the values of indicator. How to calculate values of this my indicator inside of some strategy...?
In attachment is code of test stretegy what I tried "LS_S_UsingIndicatorInStrategy.java" the strategy is just trying to calculate values of the indicator.
But when I am trying to do backtest there is still exception:¨
13:21:24 Strategy tester: java.lang.ArrayIndexOutOfBoundsException: 1 @ jforex.LS_S_UsingIndicatorInStrategy.onBar(LS_S_UsingIndicatorInStrategy.java:20)Can you please advice me how to create strategy code to access values from this my indicator??
Thank you