Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bools and NinjaTrader Internal Logic

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

    Bools and NinjaTrader Internal Logic

    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:
    [FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000]
    [COLOR=black][COLOR=blue]private bool[/COLOR] Long {get { return Position.MarketPosition == MarketPosition.Long; } }[/COLOR]
    [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][COLOR=black][/COLOR]

    or
    Code:
    [FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000]
    [COLOR=black][COLOR=blue]private bool[/COLOR] Long1 {get { return Position1 == MarketPosition.Long; } }[/COLOR]
    [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT]

    #2
    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;
    }
    JoydeepNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by inanazsocial, Today, 01:15 AM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_Jason  
    Started by rocketman7, Today, 02:12 AM
    0 responses
    10 views
    0 likes
    Last Post rocketman7  
    Started by dustydbayer, Today, 01:59 AM
    0 responses
    2 views
    0 likes
    Last Post dustydbayer  
    Started by trilliantrader, 04-18-2024, 08:16 AM
    5 responses
    23 views
    0 likes
    Last Post trilliantrader  
    Started by Davidtowleii, Today, 12:15 AM
    0 responses
    3 views
    0 likes
    Last Post Davidtowleii  
    Working...
    X