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

Starting Ninja Trader

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

    Starting Ninja Trader

    I am not sure how to control when the strategy start running. As you might see from below. I just start NinjaTrader and start a new chart. I have not loaded a strategy. But it show on the chart that I have bought n sold. Why is that happening.

    (Please see the attachmentg StartNinjaTrader.jpg)


    And I notice that when I start Ninja Trader in a new section or I start a new strategy (right click to 'New Strategy' under the Strategies tab of Control Center), it seems to be automatically run the iniitialization code of my strategy (I did start the strategy in my previous session with Ninja Trader). And when I click on 'start' for the strategy it execute the initialization code one more time. I find this out by having a Print() inside the initialization code (initialize()). Is this the normal behaviour?
    Attached Files

    #2
    xewoox,

    If you have not loaded your strategy you are just viewing trades that were stored in your database already. If you do not wish to view these you need to clear them from your database. Tools->Options->Simulator->Reset.

    That is correct. You should never use Initialize() to do anything but set specific strategy defaults. You should never do any strategy logic in there or any user created variable setting in there. This is a link of pretty much the only things you should ever do in Initialize(): http://www.ninjatrader-support2.com/...06&postcount=5
    I would not recommend using prints in Initialize() though because it will make your Output Window messy if you have this in all of your strategies.

    Note: That list is not a comprehensive list. You can do things like Add() in Initialize() as well.
    Josh P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by carnitron, Today, 08:42 PM
    0 responses
    6 views
    0 likes
    Last Post carnitron  
    Started by strategist007, Today, 07:51 PM
    0 responses
    8 views
    0 likes
    Last Post strategist007  
    Started by StockTrader88, 03-06-2021, 08:58 AM
    44 responses
    3,974 views
    3 likes
    Last Post jhudas88  
    Started by rbeckmann05, Today, 06:48 PM
    0 responses
    9 views
    0 likes
    Last Post rbeckmann05  
    Started by rhyminkevin, Today, 04:58 PM
    4 responses
    58 views
    0 likes
    Last Post dp8282
    by dp8282
     
    Working...
    X