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 GussJ, 03-04-2020, 03:11 PM
        16 responses
        3,281 views
        0 likes
        Last Post Leafcutter  
        Started by WHICKED, Today, 12:45 PM
        2 responses
        19 views
        0 likes
        Last Post WHICKED
        by WHICKED
         
        Started by Tim-c, Today, 02:10 PM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by Taddypole, Today, 02:47 PM
        0 responses
        5 views
        0 likes
        Last Post Taddypole  
        Started by chbruno, 04-24-2024, 04:10 PM
        4 responses
        53 views
        0 likes
        Last Post chbruno
        by chbruno
         
        Working...
        X