Announcement

Collapse
No announcement yet.

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 Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    605 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    351 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    105 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    560 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    561 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X