Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Value of previous Indicator-Value

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

    Value of previous Indicator-Value

    I have written a custom indi, working well.
    No i would like to write a second one, based on the first.
    The code below works fine and the Line of the orig is drawn.
    My Problem: I need the Value of the previous Bar but
    Code:
    [FONT=Courier New]  [COLOR=#0000ff]double[/COLOR][FONT=Courier New][SIZE=2] val = [/SIZE][/FONT]MyCustomIndi(var)[[SIZE=2][COLOR=#800080]1[/COLOR][/SIZE][SIZE=2]];[/SIZE][/FONT]
    doesn't work.
    Anybody knows about the problem?
    Thx in advance
    Chris

    Code:
    [FONT=Courier New][SIZE=2]
    [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]protected[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]override[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] OnBarUpdate()
    {
    [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]  double[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] val = MyCustomIndi(var)[[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]];
    [/SIZE][/FONT][FONT=Courier New][SIZE=2]   Line.Set(val); 
    [/SIZE][/FONT][FONT=Courier New][COLOR=#008000][/COLOR][/FONT][FONT=Courier New][SIZE=2][COLOR=#008000]
    [/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]}
    [/SIZE][/FONT]

    #2
    The problem you are facing is explained in the following tip - http://www.ninjatrader-support.com/v...ead.php?t=3170
    RayNinjaTrader Customer Service

    Comment


      #3
      Thx!
      Sorry my question was stupid

      Comment


        #4
        No problem at all...Not a stupid question..That's why we created a tip for it, many people run into this.
        RayNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by kujista, Today, 06:23 AM
        0 responses
        1 view
        0 likes
        Last Post kujista
        by kujista
         
        Started by traderqz, Yesterday, 04:32 PM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by f.saeidi, Today, 05:56 AM
        1 response
        4 views
        0 likes
        Last Post Jltarrau  
        Started by Jltarrau, Today, 05:57 AM
        0 responses
        4 views
        0 likes
        Last Post Jltarrau  
        Started by Stanfillirenfro, Yesterday, 09:19 AM
        7 responses
        52 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X