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

Custom indicator not displaying on lower timeframes

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

    Custom indicator not displaying on lower timeframes

    Hello!

    I recently created a custom indicator that plots a horizontal line at the open price for the current bar on the following timeframes:

    15 Minute
    2 Hour
    U.S. Open
    Daily
    Weekly

    The indicator works as expected if I apply it to the Daily timeframe but it won't work on the 15 minute or 1 minute time frames. Is there a specific way to get this indicator to work on a low timeframe such as 1 minute?

    I thought "IsAutoScale" being set to true would fix this but it didn't.

    Thank you,
    Ben


    #2
    Hello benjamin$,

    Thanks for your post.

    To clarify, are you assigning the Open[0] price to the plot in the script and applying it to a chart?

    Do you see any error messages appear in the Log tab of the Control Center when applying the indicator to a 15-minute or 1-minute timeframe? If so, what do the error messages report?

    Please see the attached example script which demonstrates assigning the Open[0] to a plot. The example script could then be added to any timeframe interval.

    See this help guide page for more information about using AddPlot() and assigning values to the plot: https://ninjatrader.com/support/help...t8/addplot.htm

    Let us know if we may assist further.
    Attached Files
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_BrandonH View Post
      Hello benjamin$,

      Thanks for your post.

      To clarify, are you assigning the Open[0] price to the plot in the script and applying it to a chart?

      Do you see any error messages appear in the Log tab of the Control Center when applying the indicator to a 15-minute or 1-minute timeframe? If so, what do the error messages report?

      Please see the attached example script which demonstrates assigning the Open[0] to a plot. The example script could then be added to any timeframe interval.

      See this help guide page for more information about using AddPlot() and assigning values to the plot: https://ninjatrader.com/support/help...t8/addplot.htm

      Let us know if we may assist further.
      Thank you for your response. I discovered the issue.

      I was using:

      if (CurrentBars[0] <= BarsRequiredToPlot || CurrentBars[1] <= BarsRequiredToPlot || CurrentBars[2] <= BarsRequiredToPlot || CurrentBars[3] <= BarsRequiredToPlot || CurrentBars[4] <= BarsRequiredToPlot || CurrentBars[5] <= BarsRequiredToPlot)

      and when I changed it to:

      if (CurrentBars[0] < 1 || CurrentBars[1] < 1 || CurrentBars[2] < 1 || CurrentBars[3] < 1 || CurrentBars[4] < 1 || CurrentBars[5] < 1)


      the appropriate lines showed up on all charts.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by ZenCortexAuCost, Today, 04:24 AM
      0 responses
      3 views
      0 likes
      Last Post ZenCortexAuCost  
      Started by ZenCortexAuCost, Today, 04:22 AM
      0 responses
      0 views
      0 likes
      Last Post ZenCortexAuCost  
      Started by SantoshXX, Today, 03:09 AM
      0 responses
      13 views
      0 likes
      Last Post SantoshXX  
      Started by DanielTynera, Today, 01:14 AM
      0 responses
      2 views
      0 likes
      Last Post DanielTynera  
      Started by yertle, 04-18-2024, 08:38 AM
      9 responses
      42 views
      0 likes
      Last Post yertle
      by yertle
       
      Working...
      X