Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SetProfitTarget() in Initialize(), OnStartUp(), or OnBarUpdate()

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

    SetProfitTarget() in Initialize(), OnStartUp(), or OnBarUpdate()

    Why is it suggested that SetProfitTarget (example only) be called from Initialize() where it may run more than once rather than OnStartUp() if it is to be static?



    quote: It is suggested to call this method from within the strategy Initialize() method if your profit target price/offset is static

    #2
    You can put a static SetProfitTarget in either place - the only reason the docs mention Initialize() is because this is an auto generated event handler that everyone should have access to in their strategy. Otherwise a user would need to add OnStartUp() and could potentially not be familiar with this method.
    MatthewNinjaTrader Product Management

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    67 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    150 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    162 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    99 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    286 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X