Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Get value from Variable in Indicator . . .

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

    Get value from Variable in Indicator . . .

    So here's where I am at. I created a Indicator that you can set variables for when you setup the Indicator. Settings like Colors, setting for
    the fequency for SMA and a few others. So when I try to get that information from the indicator like

    localSMAPeriod = MyIndicator.SMAPeriod;

    This fails. What I want to do is ultimately set the settings in the Indicator and then refence those in the Strategy so that I can plot those
    values on the Chart to help make buying decisions.

    The way I want to ultimately use it is:

    localSMA = SMA(MyIndicator.SMAPeriod);

    When I try to call the value from the Indicator I get an error. So clearly I am calling that value incorrectly.
    Can anyone point me in the right direction? The indicator is setting the values correctly as I have seen in the
    debug Print statement. This is my last hurdle and I will be happy.

    Thanks.

    #2
    Hello ATMtrader0001,

    You are getting an error?

    What is the error?


    The MyIndicator.SMAPeriod is throwing me off a bit.
    Is this in a different namespace or something?
    Is MyIndicator a variable holding an indicator and you are trying to get a property from it?

    Why is the MyIndicator. added to the front of this?

    Take a look at the SMA indicator to see how the public Period input is created and the attributes applied.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Sorry, I was not at my usual computer and could not post the error.

      After getting some sleep I found the issue. I am able to get the value from the parameters now.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Today, 05:17 AM
      0 responses
      20 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      119 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      63 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      41 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      45 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X