Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

strategy not in use is producing error

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    strategy not in use is producing error

    yesterday I reinstalled NT to solve a clock sync issue

    since then when I start NT and load one of my strategies to a chart, I get an error in the Log related to another of my strategies which is not even loaded/running in any chart....in fact I have not used it for more than a year.

    corrupt workspace? not likely as this is a new install with no saved workspaces and at no time have I loaded the old strategy to a chart

    to test that theory, I closed all workspaces, closed NT, opened NT in empty/blank default workspace....opened new chart...connected to MarketReplay....right click in the chart and select Strategies....instantaneously with the opening of the Strategies dialog, I get the error in the Log....i.e. without even getting to the point of selecting any strategy to load to the chart

    corrupt chart template? no...because I opened a chart with 'none' for template and same error to log on opening Strategies dialog

    the error is ''....strategy has called the Add() method with an invalid instrument....''

    so I edit the old strategy and change the 'YM 06-08' instrument to 'YM 12-08' and the error goes away.

    I am assuming this is similar to compiling one cs and getting errors detected in another cs....i.e. NT checks all cs code when compiling

    NT must also check all code when preparing to load a strategy....thorough, however is this really necessary if the cs is not going to be used? ...or is this a bug?

    I do not want to manually update the Add() method in the old strategy so is there code I can use to check automatically if the instrument is valid before adding?

    thanks.

    #2
    of course the code solution is to change the default parameter setting to "none" instead of an instrument which can become invalid and then...

    if ( FilterSymbol != "none" )
    Add(FilterSymbol, PeriodType.Minute, FilterInterval);

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Jonafare, 12-06-2012, 03:48 PM
    5 responses
    3,986 views
    0 likes
    Last Post rene69851  
    Started by Fitspressorest, Today, 01:38 PM
    0 responses
    2 views
    0 likes
    Last Post Fitspressorest  
    Started by Jonker, Today, 01:19 PM
    0 responses
    2 views
    0 likes
    Last Post Jonker
    by Jonker
     
    Started by futtrader, Today, 01:16 PM
    0 responses
    8 views
    0 likes
    Last Post futtrader  
    Started by Segwin, 05-07-2018, 02:15 PM
    14 responses
    1,792 views
    0 likes
    Last Post aligator  
    Working...
    X