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

extract data from a custom indicator

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

    extract data from a custom indicator

    I have a strategy that i want to extract data from a custom indicator. I have been reading different posts and been trying to extract the information with no success. I tried the print command on the indicator to see if any information exists, and it does show, but when I try to get the same information it only gives me zero values.

    Heere is some of the code below:

    private double Strength =0.0, SweepA = 0.0, SweepB = 0.0;

    public int Switch = 0, Switch2 = 0,SwitchA = 0, SwitchB = 0, SwitchC = 0, SwitchD = 0, SwitchE = 0, SwitchAA = 0, SwitchBB = 0;

    the above information I even made the int Switch a public value and a function

    public int getDaActiveSwitch
    {
    get { return Switch; }

    }


    In the strategy i even tried this

    int asdf= CustomIndicator(Name(21, 12, 3, 4, 1, false,1).getDaActiveSwitch;
    Print("Active switch " + asdf);




    The Switch value does change numbers on OnBarUpdate from 1 to 5 in the indicator but I can not get a result in the strategy.

    I can only retrieve the Parameter values only.

    what do I do.

    The indicator is NOT a dll.

    #2
    Can you view the source code or is it protected?

    If protected - Can you request to the developer to make it accessible?

    Comment


      #3
      Hello ballboy,

      Thank you for your post.

      You can expose values that are not plots by using Data Series or Update(). We have a reference sample at the following link that provides an example of both: http://ninjatrader.com/support/forum...ead.php?t=4991

      For information on Data Series please visit the following link: http://ninjatrader.com/support/helpG...ries_class.htm

      For information on Update() please visit the following link: http://ninjatrader.com/support/helpG...nt7/update.htm

      Please let me know if you have any questions.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Skifree, Today, 03:41 AM
      3 responses
      12 views
      0 likes
      Last Post Skifree
      by Skifree
       
      Started by traderqz, Yesterday, 09:06 AM
      5 responses
      32 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by guillembm, Today, 11:25 AM
      1 response
      6 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by owensd, 04-21-2024, 11:34 PM
      9 responses
      34 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by trilliantrader, 04-10-2024, 09:33 PM
      7 responses
      25 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Working...
      X