Iteration over same OHLCV data?

Questions about MultiCharts and user contributed studies.
lavalampmj
Posts: 8
Joined: 14 Nov 2013
Has thanked: 1 time
Been thanked: 1 time

Iteration over same OHLCV data?

Postby lavalampmj » 14 Nov 2013

Does MC provide a public class/method to enable programmatic iteration over the same OHLCV input data? Similar to how the brute or GA optimizer rewind and recalculate N times?

This capability would enable some research I'm doing into strategy development and optimization.

Thanks for your thoughts

User avatar
Andrew MultiCharts
Posts: 1587
Joined: 11 Oct 2011
Has thanked: 931 times
Been thanked: 559 times

Re: Iteration over same OHLCV data?

Postby Andrew MultiCharts » 15 Nov 2013

Hello lavalampmj,

I am not sure if i understand your question or not. Are you asking if brute force and genetic optimization is possible in MC? Please elaborate.

lavalampmj
Posts: 8
Joined: 14 Nov 2013
Has thanked: 1 time
Been thanked: 1 time

Re: Iteration over same OHLCV data?

Postby lavalampmj » 15 Nov 2013

No, I am asking whether I can in effect create my own optimizer. BTW, it would not be for param' optimization as you have good solutions for this, but for logic construction - something akin to genetic programming. Although the search process would be driven by various evolutionary algorithms, including GA, PSO etc.

To accomplish this task I'd need to be able to iterate studies, N times over the same input data.

Since posting, I see there is a ICalculationControl.Recalculate method which might do the job?

I have not had time to play with it. Can you tell me whether its use causes the chart to update or whether it just iterates the study in memory. The later is required for this work, as there would be way too much overhead if the chart is redrawn each iteration.

Your advice is much appreciated.

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: Iteration over same OHLCV data?

Postby JoshM » 15 Nov 2013

(....)
To accomplish this task I'd need to be able to iterate studies, N times over the same input data.

Since posting, I see there is a ICalculationControl.Recalculate method which might do the job?
(...)
You can iterate over the bars in a chart, so if you adjust your functions to accept the counter variable, you can calculate it different times for different parameters. Obviously, you'd need to calculate and export your own performance metrics after each iteration.

I wonder where you saw ICalculationControl.Recalculate. If you use regular MultiCharts, you need to use RecalcLastBarAfter and for MultiCharts .NET ExecControl.Recalculate() and implement the OnRecalcLastBarAfterEvent() method (but this thread is in the regular MultiCharts forum, so you probably don't use that version).

User avatar
Andrew MultiCharts
Posts: 1587
Joined: 11 Oct 2011
Has thanked: 931 times
Been thanked: 559 times

Re: Iteration over same OHLCV data?

Postby Andrew MultiCharts » 18 Nov 2013

JoshM is absolutely right in this case - the RecalLastBarAfter should help with multiple script recalculations on the same data series.
Also, if i understand your goal correctly, the following new feature may be helpful for you: https://www.multicharts.com/trading-sof ... _indicator


Return to “MultiCharts”