![]() |
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Sep 2009
Posts: 562
Thanks: 40
Thanked 5 times in 4 posts
|
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 at 02:52 AM.
|
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Mar 2009
Posts: 442
Thanks: 0
Thanked 25 times in 16 posts
|
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 |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Sep 2009
Posts: 562
Thanks: 40
Thanked 5 times in 4 posts
|
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...
|
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,555
Thanks: 261
Thanked 1,013 times in 994 posts
|
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.
Bertrand
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Why regions not collapsable any more? | saroj | Indicator Development | 2 | 10-02-2009 05:56 PM |
| Increase private message storage on forum | ctrlbrk | Suggestions And Feedback | 4 | 03-23-2009 05:54 PM |
| Variables: "public" vs. "private"?? | zeller4 | General Programming | 2 | 12-01-2008 09:52 AM |
| Is it possible to create a private indicator? | ooppie | General Programming | 2 | 05-26-2008 11:36 PM |