Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnStateChange -> calling in other class outside namespace

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

    OnStateChange -> calling in other class outside namespace

    ​​Hello

    I am developing quit complex project. It consists of 2 parts
    1. Golem (Folder on left) - which is Golem : Strategy object
    2. GolemApp (folder on left).

    In Golem I want to call o.OnStateChange -> which represents OnStateChange in classic strategy. In right panel you can see, how this method looks like. You can mention variable _s, which is Golem Strategy. and the issue is, when I try to call

    _s.AddDataSeries(ins.FullName, periodType, serie.barsPeriod.value);

    It crashes because of protection of AddDataSeries method. Is there a way to call this method the way i show on the right panel?

    The only solution is for me now is to keep the foreach cycle inside OnStateChange of Golem Strategy, but this suxx... GolemApp will be compiled to dll and user should not access it. In golem strategy he should call only:

    protected override void OnStateChange() { o.OnStateChange(this); }

    Can anyone guide me?


    Click image for larger version

Name:	image.png
Views:	62
Size:	791.7 KB
ID:	1300009

    #2
    Hello kujista,

    This would be outside of what is supported by NinjaTrader and not something I would be able to assist with.

    This thread will remain open for any community members that would like to provide unsupported advanced c# advice.

    That said, you may want to consider a partial class within the NinjaTrader.NinjaScript.Indicators namespace.
    Explanation: I wrote a base class Indicator class that I'm using to inherit all my other indicators from. So this baseclass is defined as: namespace NinjaTrader.NinjaScript.Indicators.AssistedTrades { public class ATBaseIndicator: Indicator { ... } } And any other indicator is defined as: namespace NinjaTrader.NinjaScr



    You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like a list of affiliate consultants who would be happy to create this script or any others at your request or provide one on one educational services.

    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello,

      Yes I would like to contact some consultant to solve this. Thanks a lot.

      Comment


        #4
        Hello kujista,

        You can search our extensive library of NinjaScript consultants through the link below. Simply enter a consultant name or search by using our filter categories. Once you have identified your consultants of choice, please visit each consultant's site for more information or contact them directly to learn more!
        Programming Services - https://ninjatraderecosystem.com/sea...mming-services
        Educators - https://ninjatraderecosystem.com/sea...ures=education

        You can locate the contact information for the consultants on their direct websites for any additional questions you may have. Since these consultants are third party services for NinjaTrader all pricing and support information will need to be obtained through the consultant.

        This NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The companies and services listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.

        Please let me know if you have any questions, or if I can provide any further assistance.​
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        65 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        139 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        75 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        45 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        50 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X