Multicharts .NET Preserves Certain Data in Optimizer in Error - futures io
futures io



Multicharts .NET Preserves Certain Data in Optimizer in Error


Discussion in MultiCharts

Updated
    1. trending_up 1,690 views
    2. thumb_up 1 thanks given
    3. group 2 followers
    1. forum 1 posts
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 150,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

Multicharts .NET Preserves Certain Data in Optimizer in Error

(login for full post details)
  #1 (permalink)
 BrianBacchus 
Las Vegas
 
Experience: Intermediate
Platform: MultiCharts .NET
Trading: CL
 
Posts: 26 since Oct 2015
Thanks: 7 given, 37 received

I've been programming in c#/.NET on Multicharts for a while. Once you start working with more complex, and larger datasets you can't really rely on the standard VariableSeries<> anymore. That type carries a value for every. single. bar.

So I started trying to be more efficient. I used the List<> type where I could insert values to keep the same [0] as most recent. You can also resize the list so it only carries relevant numbers of values and doesn't just continually expand. The results are pretty impressive, much faster load times for strategies, indicators, and the optimizer runs faster as well.

However, there's something I discovered that needs to be kept in mind:

When using things like lists or specifying doubles right under the public class level, MultiCharts .NET in general will pass previous values if you simply "recalculate" a study. For indicators it does this as well, you'll see it if you click click on the indicator title to "mute" it, then click it back on again. This issue persists into the optimizer as well. Whatever your previous parameter check had as values gets passed as the first values for the next iteration. That's a big problem because it starts showing results in the optimizer that are completely different even if you apply those specific parameters.

This appears to happen because MultiCharts .NET doesn't load the entire script each time it reloads. It fills in parameter values but then starts the reload process at the StartCalc override.

To solve this issue, you need to clear Lists or single declaration in the StartCalc override.

The end result looks something like this:

protected override void StartCalc(){

m_xaverage1.Price = Bars.Close;
m_xaverage1.Length = MacroTrendLength;
m_xaverage2.Price = Bars.Close;
m_xaverage2.Length = ShorterLengthAvg;

askEff.Clear();
bidAbsorbed.Clear();
bidEff.Clear();
askAbsorbed.Clear();

askEffAvg = 0;
bidAbsorbAvg = 0;
bidEffAvg = 0;
askAbsorbAvg = 0;
combineAsk.Value = 0;
combineBid.Value = 0;

}

Just putting this out there in case someone starts pulling their hair out with frustration because MC .NET isn't behaving the way it seems it should.

Started this thread Reply With Quote
The following user says Thank You to BrianBacchus for this post:

Can you help answer these questions
from other members on futures io?
NT8 - Footprint Chart adding on code
NinjaTrader
 
 
(login for full post details)
  #2 (permalink)
 FuManChou 
Saint Paul, Minnesota, United States
 
Experience: Beginner
Platform: MultiCharts
Broker: Edge Clear
Trading: Micros & Small Exchange Futures
 
FuManChou's Avatar
 
Posts: 92 since Jun 2019
Thanks: 1,012 given, 99 received

Just wondering. Have you reached out to the MultiCharts team and see what they say? Is it working as designed or a limitation in MC?

FYI. I have two licenses (MC + MC.NET) and have not used MC.NET much.

Reply With Quote


futures io Trading Community Platforms and Indicators MultiCharts > Multicharts .NET Preserves Certain Data in Optimizer in Error


Last Updated on November 16, 2021


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
     



Copyright © 2022 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada), info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts