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

NT7 Forum Indicators

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

    #16
    Originally posted by NinjaTrader_Tim View Post
    Hi p_mid,

    I have a reply to your latest response, which I need to confirm with a colleague, you can expect an answer shortly.
    I'm not in a hurry...

    Thanks a lot

    Comment


      #17
      Hi p_mid,


      I see, to clarify, Input[0] refers to something different. Accessing Input[0] is only useful when using PriceType. When you are not using PriceType, Close[0] and Input[0] show the same information by default.

      More info at - http://www.ninjatrader-support.com/H...ide.html?Input
      and - http://www.ninjatrader-support.com/H...html?PriceType

      If you want to access the close of your dataseries, you would use myDataSeries[0], this will get you the close of the the original dataseries.

      If you want to pass in the close price of the dataseries to another indicator from the Indicator GUI, you can do what I mentioned in post #11.
      Last edited by NinjaTrader_Tim; 04-21-2010, 09:47 AM.
      TimNinjaTrader Customer Service

      Comment


        #18
        Sorry,

        but this seems to take me far from what I'm trying to accomplish: myDataSeries should be assigned a DataSeries defined in code, not an user parameter).

        I just want to write an indicator which, when added to a graph containing a dataseries, takes the prices of the dataseries, and adds the value of an indicator defined by the user as a parameter in its Data/Input Series field.

        So, Data/Input Series will be, e.g., SMA(RIMM (Daily),14), and the code would look like this:

        protected override void OnBarUpdate()
        {
        ...
        double userIndicatorValue = Input[0]; // <<-- this will contain the user indicator value defined as a parameter (e.g. SMA(20))
        double originalDataSeriesValue = ??; // how do I retrieve this?

        Plot0.Set(userIndicatorValue + originalDataSeriesValue);
        ...
        }

        Very simple, but I just can't figure out how to retrieve the original dataseries value.
        I hope to have been able to clarify what I'm trying to obtain: the SMA(), or any other indicator to be added to the original dataseries, must not be defined in code, but must be a parameter entered by the user.


        Regards,

        Paolo

        Comment


          #19
          Hi p_mid,

          Unfortunately that is not how the value Input[0] works, please see my previous response.

          If you want to create a user-defined series, that will be added to your series. You can create enums that contain the series you wish to select from (for example, SMA values).

          More info at - http://www.ninjatrader-support2.com/...ead.php?t=3420
          TimNinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by geddyisodin, 04-25-2024, 05:20 AM
          8 responses
          61 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by jxs_xrj, 01-12-2020, 09:49 AM
          4 responses
          3,288 views
          1 like
          Last Post jgualdronc  
          Started by Option Whisperer, Today, 09:55 AM
          0 responses
          5 views
          0 likes
          Last Post Option Whisperer  
          Started by halgo_boulder, 04-20-2024, 08:44 AM
          2 responses
          22 views
          0 likes
          Last Post halgo_boulder  
          Started by mishhh, 05-25-2010, 08:54 AM
          19 responses
          6,189 views
          0 likes
          Last Post rene69851  
          Working...
          X