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 rtwave, 04-12-2024, 09:30 AM
      5 responses
      37 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by funk10101, Today, 12:02 AM
      1 response
      11 views
      0 likes
      Last Post NinjaTrader_LuisH  
      Started by GLFX005, Today, 03:23 AM
      1 response
      6 views
      0 likes
      Last Post NinjaTrader_Erick  
      Started by nandhumca, Yesterday, 03:41 PM
      1 response
      13 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by The_Sec, Yesterday, 03:37 PM
      1 response
      11 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Working...
      X