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 problem

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

    Custom Indicator problem

    Hi

    I have a custom indicator attached. If I add this indicator to a chart it all works as expected, however if I try to call it from another indicator or Strategy the indicator does not seem to work.

    If I try to debug with Visual Studio OnBarUpdate in the indicator does not seem to be triggered when called from another indicator or strategy but does if just run from chart.

    I am using some custom data types that are stored in Generic Lists and was wondering if this had something to do with it.

    Would appreciate any help.

    Thanks

    Mike


    To Test you can try and add the following to a new Indicator

    protected override void Initialize() {

    Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Plot0"));
    Overlay = false;
    }

    protected override void OnBarUpdate() {

    HiLowSwing swing = HiLowSwing(5);
    Plot0.Set(swing.LastHigh.Value);
    }
    Last edited by upshon; 02-08-2011, 05:57 AM.

    #2
    Nice work Mike, it looks to me like there's no series or variable exposed for externally accessing any of the calc'ed values?

    BertrandNinjaTrader Customer Service

    Comment


      #3
      Thanks for your reply Bertrand.

      I have added a DataSeries property and have set it every time in the OnBarUpdate method.

      I now seem to have a timing issue, as when I step through using Visual Studio in debug mode it works however when I let it run normally It does not.

      Thanks

      Mike

      Comment


        #4
        Sorry My Mistake, I had not called Update() on the get of the property.

        All working now. Thanks for your help.

        Thanks

        Mike

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by LiamTwine, Today, 08:10 AM
        0 responses
        2 views
        0 likes
        Last Post LiamTwine  
        Started by Balage0922, Today, 07:38 AM
        0 responses
        5 views
        0 likes
        Last Post Balage0922  
        Started by JoMoon2024, Today, 06:56 AM
        0 responses
        6 views
        0 likes
        Last Post JoMoon2024  
        Started by Haiasi, 04-25-2024, 06:53 PM
        2 responses
        19 views
        0 likes
        Last Post Massinisa  
        Started by Creamers, Today, 05:32 AM
        0 responses
        6 views
        0 likes
        Last Post Creamers  
        Working...
        X