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 lightsun47, Today, 03:51 PM
        0 responses
        5 views
        0 likes
        Last Post lightsun47  
        Started by 00nevest, Today, 02:27 PM
        1 response
        10 views
        0 likes
        Last Post 00nevest  
        Started by futtrader, 04-21-2024, 01:50 AM
        4 responses
        46 views
        0 likes
        Last Post futtrader  
        Started by Option Whisperer, Today, 09:55 AM
        1 response
        14 views
        0 likes
        Last Post bltdavid  
        Started by port119, Today, 02:43 PM
        0 responses
        10 views
        0 likes
        Last Post port119
        by port119
         
        Working...
        X