![]() |
|
|||||||
| Automated Trading Support for automated trading systems using NinjaScript. Support for our ATI (Automated Trading Interface) used to link an external application such as TradeStation and eSignal to NinjaTrader. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Jul 2010
Posts: 415
Thanks: 1
Thanked 4 times in 4 posts
|
In programing I like to create bools to consolidate code, but I am concerned about doing this with NinjaTrader Internal Logic. I do not want to compromise the integrity of my strategy. Can you please tell me if the following code would have adverse reactions to a strategy.
Thanks Code:
private bool Long {get { return Position.MarketPosition == MarketPosition.Long; } }
or Code:
private bool Long1 {get { return Position1 == MarketPosition.Long; } }
|
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
Hello kenb2004,
NinjaTrader is basically C# and will use any standard C# logics/features. You can simply write a function. A sample code will be like Code:
private bool Long()
{
return Position.MarketPosition == MarketPosition.Long;
}
Joydeep M.
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Optimize with bools? Here's how! | jeronymite | General Programming | 6 | 09-20-2012 07:42 AM |
| Using Bars with Bools | CaptainAmericaXX | General Programming | 2 | 04-14-2011 11:29 AM |
| Bools and [] indexing | kenb2004 | Strategy Development | 5 | 02-28-2011 11:41 AM |
| Working with NinjaTrader internal database | Silence | Miscellaneous Support | 2 | 05-15-2010 11:01 AM |
| ints and bools??? | John833 | Strategy Development | 2 | 12-08-2008 09:40 AM |