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

BarsArray Question

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

    BarsArray Question

    Hello.

    I'm using a custom Datatype in a multi time frame indicator. The datatype is called BWTPrecisionRenko

    There are two parameters, as input. to this datatype: The "bricksize" and the "reversal percentage"

    On the primary bar object the following statement compiles cleanly.

    _rcsFT_p = FeltonTrigger(100000,"dummy");

    On the secondary bar object the following statement throws errors.

    _rcsFT_s = FeltonTrigger(BarsArray[1].Period.Value2=125,100000,"dummy")

    The developer says the above syntax is required to define the "reversal percentage" on the custom datatype.

    The error messages indicate that the indicator, Felton Trigger, is "seeing" BarsArray as a parameter value.

    If I code the following, it compiles cleanly.

    _rcsFT_s = FeltonTrigger(BarsArray[1],100000,"dummy")

    So the problem is definitely the "..Period.Value2=125".

    Does that syntax look correct?

    I'm including my code and the following two error messages.

    The best overloaded method match for 'NinjaTrader.Indicator.Indicator.FeltonTrigger(Nin jaTrader.Data.IDataSeries, int, string)' has some invalid arguments

    Argument '1': cannot convert from 'int' to 'NinjaTrader.Data.IDataSeries'
    Attached Files

    #2
    I've never seen such syntax, but it looks like you are assigning 125 to value2 which is also being passed in at the same time?

    But it looks like the compiler is correct in this case. You ARE trying to pass an INT as an iDataSeries.

    Try doing the blahblah.Value2=125 before the FeltonTrigger line, then doing like you have in the commented section?




    Originally posted by rcsingleton View Post
    Hello.

    I'm using a custom Datatype in a multi time frame indicator. The datatype is called BWTPrecisionRenko

    There are two parameters, as input. to this datatype: The "bricksize" and the "reversal percentage"

    On the primary bar object the following statement compiles cleanly.

    _rcsFT_p = FeltonTrigger(100000,"dummy");

    On the secondary bar object the following statement throws errors.

    _rcsFT_s = FeltonTrigger(BarsArray[1].Period.Value2=125,100000,"dummy")

    The developer says the above syntax is required to define the "reversal percentage" on the custom datatype.

    The error messages indicate that the indicator, Felton Trigger, is "seeing" BarsArray as a parameter value.

    If I code the following, it compiles cleanly.

    _rcsFT_s = FeltonTrigger(BarsArray[1],100000,"dummy")

    So the problem is definitely the "..Period.Value2=125".

    Does that syntax look correct?

    I'm including my code and the following two error messages.

    The best overloaded method match for 'NinjaTrader.Indicator.Indicator.FeltonTrigger(Nin jaTrader.Data.IDataSeries, int, string)' has some invalid arguments

    Argument '1': cannot convert from 'int' to 'NinjaTrader.Data.IDataSeries'

    Comment


      #3
      Sledge, thanks for your reply.

      //Secondary Felton Trigger Object
      BarsArray[1].Period.Value2=125;
      _rcsFT_s = FeltonTrigger(BarsArray[1],100000,"dummy");

      The above is compiling cleanly.

      I'll try this out tomorrow, and let you know.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by kaywai, 09-01-2023, 08:44 PM
      5 responses
      602 views
      0 likes
      Last Post NinjaTrader_Jason  
      Started by xiinteractive, 04-09-2024, 08:08 AM
      6 responses
      22 views
      0 likes
      Last Post xiinteractive  
      Started by Pattontje, Yesterday, 02:10 PM
      2 responses
      20 views
      0 likes
      Last Post Pattontje  
      Started by flybuzz, 04-21-2024, 04:07 PM
      17 responses
      230 views
      0 likes
      Last Post TradingLoss  
      Started by agclub, 04-21-2024, 08:57 PM
      3 responses
      17 views
      0 likes
      Last Post TradingLoss  
      Working...
      X