Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Modifying NT SampleScaleOut

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

    Modifying NT SampleScaleOut

    hello, I was trying to modify (adding short entries) this NT system, but after I compiled the code the system does NOT gives any short entries, why is that? Here is the code, hope you can help me:

    ///<summary>
    /// Called on each bar update event (incoming tick)
    ///</summary>
    protectedoverridevoid OnBarUpdate()
    {
    // Entry Condition: When the Low crosses below the lower bollinger band, enter long
    if (CrossBelow(Low, Bollinger(2, 14).Lower, 1))
    {
    // Only allow entries if we have no current positions open
    if (Position.MarketPosition == MarketPosition.Flat)
    {
    /* Enters two long positions.
    We submit two orders to allow us to be able to scale out half of the position at a time in the future.
    With individual entry names we can differentiate between the first half and the second half of our long position.
    This lets us place a Profit Target order only for the first half and Trail Stops for both. */
    EnterLong("Long 1a");
    EnterLong(
    "Long 1b");
    }
    }
    //Entry Condition: When the High crosses above the higher bollinger band, enter short
    if (CrossAbove(High, Bollinger(2, 14).High, 1))
    {
    // Only allow entries if we have no current positions open
    if (Position.MarketPosition == MarketPosition.Flat)
    {
    /* Enters two short positions.
    We submit two orders to allow us to be able to scale out half of the position at a time in the future.
    With individual entry names we can differentiate between the first half and the second half of our long position.
    This lets us place a Profit Target order only for the first half and Trail Stops for both. */
    EnterShort("Short 1a");
    EnterShort(
    "Short 1b");
    }
    }
    }

    #2
    futuros, which EntryHandling / EntriesPerDirection are you using with this modification? Would you see shorts if you let the strategy reverse, too (so without the check for being flat)?

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    60 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    145 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    161 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    97 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    283 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X