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

Why best practices says this?

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

    Why best practices says this?

    1) In "best practices"



    it's written, that AddPlot and etc,, are likely to be done in SetDefaults.
    However, SetDefaults is fired for all indicators, when you just right click on the chart and add indicator ABC on the chart (in that time ALL YOUR INDIS are firing setDefaults, causing NT to hand up for a while to load 40-50 indis setDefaults).

    So, I why it's not better to do that in `State.Configure`?

    freeing up the NT to load these initializations for all indis when those indis arent really added on chart.

    2) also, in https://ninjatrader.com/support/help...th_brushes.htm
    while defining custom color brush, it is not frozen - https://i.imgur.com/V8snOMc.png is that ok?

    3) and about `Not Guaranteed` - can you explain it better in docs, what means "Not guaranteed" - how code is executed can you tell us, so we could understand (As I cant understand that sometimes it "loads" sometimes "not" - on what it depends ? )
    Last edited by ttodua; 04-21-2018, 02:33 AM.

    #2
    Hello TazoTodua,

    Thank you for your note.

    You could Add Plot either in SetDefaults or State.Configure.

    While SetDefaults is called when you open an indicator dialog box, the addplot calls are ignored until the indicator is applied to a chart, so these AddPlot calls should not have a material influence on performance. A downside to adding plots within State.Configure is that if the indicator is applied to a market analyzer window, the MA window will not display the plot values.

    The helpguide under Creating a Custom Solid Color Brush, Note 1, states anytime you create a custom brush it must be frozen. If you were to use a predefined brush you could avoid having to freeze your brush. Please see,



    Regarding your Not Guaranteed question, so I may best answer your question, could you please provide a link to the section of the helpguide you are specifically referencing?

    I look forward to your reply.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      about not guaranteed:



      on that page, unfold the tabs and search for word "guaranteed" and you will see many cases.
      I cant understand why "not guarenteed" (i.e. bars or chartcontrol in COnfigure state, but guaranteed in DataLoaded state... shortly, why those "not guaranteed" situations exist at all, and why there is not one 100% standard when they are guaranteed )?

      Comment


        #4
        Hello TazoTodua,

        You could interpret “not guaranteed” as don’t do it, or don’t expect the behavior, but it may work under certain conditions. If it’s not “not guaranteed” then you could expect the behavior, so this would be the 100% standard.

        Whether an indicator is called by a market analyzer window, strategy, or chart would be just a simple example of the different environments where something like an AddDataSeries call could behave different.

        Please let us know if you need further assistance.
        Alan P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Aviram Y, Today, 05:29 AM
        0 responses
        1 view
        0 likes
        Last Post Aviram Y  
        Started by quantismo, 04-17-2024, 05:13 PM
        3 responses
        25 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by ScottWalsh, 04-16-2024, 04:29 PM
        7 responses
        34 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by cls71, Today, 04:45 AM
        0 responses
        5 views
        0 likes
        Last Post cls71
        by cls71
         
        Started by mjairg, 07-20-2023, 11:57 PM
        3 responses
        216 views
        1 like
        Last Post PaulMohn  
        Working...
        X