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 mmckinnm, Today, 01:34 PM
        0 responses
        2 views
        0 likes
        Last Post mmckinnm  
        Started by f.saeidi, Today, 01:32 PM
        0 responses
        1 view
        0 likes
        Last Post f.saeidi  
        Started by traderqz, Today, 12:06 AM
        9 responses
        16 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by kevinenergy, 02-17-2023, 12:42 PM
        117 responses
        2,766 views
        1 like
        Last Post jculp
        by jculp
         
        Started by Mongo, Today, 11:05 AM
        5 responses
        15 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X