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

Plotting text, needing to refresh NinjaScript

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

    #16
    Originally posted by NinjaTrader_Jim View Post
    Hello WalterSkinner,

    Looking at the code, the Draw.Text method in BarsInProgress == 1 is using CurrentBar with the tag, so each time there is a new secondary bar, this tag will change and a new drawing object will be placed.

    Following the recommendation from post #6, please consider using CurrentBars[0] with the tag instead, as CurrentBars[0] reflects the index of the primary data series and you want to have one drawing per primary bar.
    Thanks for your patience and help Jim, much appreciated.

    I gave that a shot a while back and it gave me the error below.

    When I try this:
    Code:
    Draw.Text(this, "deltaText"+CurrentBar[0], false, barDelta.ToString(), 0, High[0] + 2*plotVertPos*TickSize, 0, Brushes.Black, myFont2, TextAlignment.Center, Brushes.Black, null, 1);
    I get this error:
    Code:
    "cannot apply indexing with [] to an expression of type int"
    I've got to be doing something wrong.

    Since the primary data series is a range bar chart, and the second series is range based volumetric bars, I set the range of the volumetric bars equal to the range of the primary data series, hoping to make make it not matter which data series I was using to plot.

    Comment


      #17
      Hello WalterSkinner,

      You need to use CurrentBars[0].

      CurrentBar - https://ninjatrader.com/support/help...currentbar.htm

      CurrentBars - https://ninjatrader.com/support/help...urrentbars.htm

      Please also see the complete Multi Time Frame and Instruments documentation. Giving this a good once over will help when working with Multi Time Frame/Multi Series scripts.

      Multi Time Frame and Instruments - https://ninjatrader.com/support/help...nstruments.htm

      JimNinjaTrader Customer Service

      Comment


        #18
        Originally posted by NinjaTrader_Jim View Post
        Hello WalterSkinner,

        You need to use CurrentBars[0].

        CurrentBar - https://ninjatrader.com/support/help...currentbar.htm

        CurrentBars - https://ninjatrader.com/support/help...urrentbars.htm

        Please also see the complete Multi Time Frame and Instruments documentation. Giving this a good once over will help when working with Multi Time Frame/Multi Series scripts.

        Multi Time Frame and Instruments - https://ninjatrader.com/support/help...nstruments.htm

        Thank you so much that finally did it.

        You have the patience of a saint.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by alifarahani, Today, 09:40 AM
        6 responses
        36 views
        0 likes
        Last Post alifarahani  
        Started by Waxavi, Today, 02:10 AM
        1 response
        17 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Started by Kaledus, Today, 01:29 PM
        5 responses
        14 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by Waxavi, Today, 02:00 AM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Started by gentlebenthebear, Today, 01:30 AM
        3 responses
        17 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X