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

Regions and private voids

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

    Regions and private voids

    Hi
    1) if I break up my code into regions, how do I instruct the code to move for example from region A to region B?
    2) can regions and their code be written under the protected override void OnBarUpdate section?
    3) are private void subsections of regions?
    4) how do I instruct code to move from private void A to private void B if conditions are fulfilled?

    Thanks

    Kay Wai
    Last edited by kaywai; 01-29-2010, 03:52 AM.

    #2
    Hi,
    You need functions not regions. Regions are just some code that you wrap to make it visualy nicer. It does nothing!
    You need functions. Like in OnBarUpdate you put ABC();
    and outside the OnBarUpdate you write the function with its logic:
    protected void ABC()
    {
    here is your logic
    }

    Baruch

    Comment


      #3
      Thanks Baruch! I see them in some ninjascripts that some guys have written and some of them have it done like nothing i've seen before. One programmer had "this" almost on every line as well as a few regions and private voids and it seemed that he was using "this" to move from private void to private void. Another thing is when i put in a region under OnBarUpdate, i tend to get an error message...

      Comment


        #4
        Kay, this is unfortunately out of the scope that we can provide support for (more general C#), so if you want to dive into those concepts further we would suggest to review a C# introductory book.
        BertrandNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by funk10101, Today, 11:35 AM
        0 responses
        0 views
        0 likes
        Last Post funk10101  
        Started by samish18, Today, 11:26 AM
        0 responses
        1 view
        0 likes
        Last Post samish18  
        Started by Trader146, 03-29-2024, 01:22 PM
        2 responses
        14 views
        0 likes
        Last Post Trader146  
        Started by tsantospinto, 04-12-2024, 07:04 PM
        7 responses
        127 views
        0 likes
        Last Post aligator  
        Started by futtrader, 04-21-2024, 01:50 AM
        5 responses
        56 views
        0 likes
        Last Post NinjaTrader_Eduardo  
        Working...
        X