Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Cannot enable strategy

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

    Cannot enable strategy

    I have written a strategy, but there is some strange problem with its enabling.

    I did the following:

    1. Connected to Market Replay.
    2. added several copies of the strategy to a chart
    3. selected them all at "Strategy" tab of the Control Center window
    4. Enabled them all using pop up menu -> Enable

    everything works fine. but when I

    5. changed Market Replay time (Reply window -> pop up menu -> Go to ...)

    then all the strategies become disabled.

    I tried to enable them again, but I am unable to do so. Output window shows 10 lines similar to this:

    **NT** Enabling NinjaScript strategy 'MyRunSignalsTimeSL5/7fcae72d031f4c0e88aa138e487addd3' : On starting a real-time strategy - StrategySync=SubmitImmediately SyncAccountPosition=False EntryHandling=AllEntries EntriesPerDirection=1 StopTargetHandling=PerEntryExecution ErrorHandling=StopStrategyCancelOrdersClosePositio ns ExitOnClose=False Set order quantity by=Strategy ConnectionLossHandling=KeepRunning DisconnectDelaySeconds=961 CancelEntryOrdersOnDisable=False CancelExitOrdersOnDisable=True CalculateOnBarClose=False MaxRestarts=2006 in 1 minutes


    but strategies that I added to the chart do not become enabled.

    The strategy does not throw exceptions in Initialize or OnStartUp methods (and at any other methods).

    Sometimes it helps if I remove and re-add strategies to the chart. Sometimes it helps if I close NinjaTrader and start it again. Sometimes it helps if I create a new strategy & copy there code of my old strategy (without changing anything in the code except the name of the class that inherits from Strategy class). Sometimes nothing helps except restarting computer.


    At the same time, for example, SimpleMACrossOver (that come with NT) does not have such issues - it can be enabled even if my strategy cannot.


    What can be wrong?

    #2
    Hello Vasia.Pupkin,

    Thanks for your note.

    Are there any error messages in the log tab of the Control Center?

    If so, what do these messages say?


    Also may I have this script to test with on my end?

    If so, please send me an export of the script to support[at]ninjatrader[dot]com. In the body of the email please write Attn: Chelsea #882037.

    To export your script do the following:
    1. Click File -> Utilities -> Export NinjaScript
    2. Enter a unique name for the file in the value for 'File name:'
    3. Select the strategy from the objects list on the left -> click the right facing arrow ">" to add the strategy to the export
    4. Click the 'Export' button -> click 'yes' to add any referenced indicators to the export -> click OK to clear the export location message


    By default your exported file will be in the following location:
    • (My) Documents/NinjaTrader 7/bin/Custom/ExportNinjaScript/<export_file_name.zip>


    Below is a link to the help guide on Exporting NinjaScripts.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    634 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    364 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
    567 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    568 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X