Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Need some help debuging my first basic strategy

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

    #16
    Does the strategy make any trades at all ?

    Code:
     
    // Condition set 1
    if (CrossAbove(T3(MyInput0, 3, 0.7), T3(MyInput1, 3, 0.7), 1)
    && Close[0] < Bollinger(2, MyInput2).Lower[0])
    {
    EnterLong(DefaultQuantity, "");
    }
    After looking more into your code it seems very unlikely that the condition for a long entry will ever occur because you have a relative long period T3 crossover and a relatively fast Bollinger setting.
    If the T3 crossover occurs, there's a strong uptrend and Close[0] will in most cases be in -or- above the upper range of the Bollingerbands, and not below the lower band.

    Therefore I suggest you increase the CrossAbove lookback period to 10 or more depending on your timeframe settings.
    That way, if a crossover occurs, the code will look if Close[0] goes below the lower BollingerBand for the next 10 bars, and not only at exactly the time (ie. the same bar) the crossover occurs.

    like this:

    Code:
     
    if (CrossAbove(T3(MyInput0, 3, 0.7), T3(MyInput1, 3, 0.7), [B][SIZE=3][COLOR=red]10[/COLOR][/SIZE][/B])
    && Close[0] < Bollinger(2, MyInput2).Lower[0])
    {
    EnterLong(DefaultQuantity, "");
    }

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    67 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    36 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    60 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    62 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    53 views
    0 likes
    Last Post CarlTrading  
    Working...
    X