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

Indicator reverts to defaults when reopening NT. Also, no AutoScale.

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

    Indicator reverts to defaults when reopening NT. Also, no AutoScale.

    This indicator was made from a sample file from "SampleOnRenderCandlesticks" from https://ninjatraderecosystem.com/use...cators-sample/
    It pulls O,H,L,C from a .dll that measures liquidity being added and subtracted to the market and creates candlesticks. (line 80)

    1. Indicator reverts back to boolean default (Cumulate = true) when reopening NinjaTrader. (line 61)
    Why won't it stay "false" after saving workspace and reopening NT the next day?

    2. IsAutoScale is set to "true". (line 58) (I not familiar/proficient with OnRender(Chart Control))
    Why does this indicator not Auto Scale (see attached .png)​ ? I even tried plotting the highs and lows with separate line Plots - they don't show up or help.
    I am currently using a totally separate indicator in the same chart panel and scale justification to enable seeing bar highs and lows.

    The only changes I made to the OnBarUpdate section are lines 101-106.

    Thanks!
    Robotman

    Attached Files

    #2
    Hello Robotman,

    Thanks for your post.

    Unfortunately, since the script requires a third-party dll I cannot test the script on my end since I do not have access to that third-party dll.

    Are you seeing any errors appear in the Log tab of the Control Center when attempting to save the template or workspace?

    For this bool property to be saved to a template or workspace the XmlIgnore attribute may need to be removed from the input property.

    XmlIgnore: https://ninjatrader.com/support/help...eattribute.htm

    When adding the indicator to a chart window do you see the 'Auto scale' property is checked (enabled)?

    Is your Data Series 'Auto scale' property checked (enabled) in the Data Series window?

    When testing the IndicatorCandlestick indicator from the User App Share page you linked to I am seeign that the "Auto scale" property is enabled and the indicator seems to be auto scaling as expected.

    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Hi NinjaTrader_BrandonH

      No errors in log.

      I feel silly for not remembering the XmlIgnore trick. I cut and paste a lot and just now deleted those lines that are needed to be remembered by the Xml.

      The data series is ES 03-24 but the indicator is what is drawing the candles. Both the ES data series and the indicator have "Auto Scale" checked.

      Thank you for your help!
      Robotman

      Comment


        #4
        Hello Robotman,

        Thanks for your notes.

        To clarify, if you test the User App Share script that you shared a link to do you see the indicator auto-scale working as expected?

        If you add the third-party indicator you are using in your script to a New > Chart window, do you see the indicator is auto scaling? Is the Auto Scale property for this indicator enabled by default?

        If the User App Share script that you shared a link to is working as expected then it is likely some custom logic in your script causing the reported behavior to occur.

        You would need to reduce the code of your script and add debugging prints to find the exact line of code causing the reported behavior.

        First, its great to create a copy of the script so that the original work is kept safe.

        Below is a link to a publicly available video that demonstrates making a copy of script.
        https://www.youtube.com/watch?v=BA0W...utu.be&t=8m15s

        Once the copy is created, the copy can be modified in any way without losing the original work.

        The next step is to start commenting out code and adding debugging prints to locate the exact line of code causing the behavior to occur.​
        Brandon H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by futtrader, 04-21-2024, 01:50 AM
        4 responses
        41 views
        0 likes
        Last Post futtrader  
        Started by Option Whisperer, Today, 09:55 AM
        1 response
        11 views
        0 likes
        Last Post bltdavid  
        Started by port119, Today, 02:43 PM
        0 responses
        7 views
        0 likes
        Last Post port119
        by port119
         
        Started by Philippe56140, Today, 02:35 PM
        0 responses
        7 views
        0 likes
        Last Post Philippe56140  
        Started by 00nevest, Today, 02:27 PM
        0 responses
        7 views
        0 likes
        Last Post 00nevest  
        Working...
        X