Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Chart not showing trades

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

    Chart not showing trades

    I'm trying to run this strategy on a daily Dec ES contract chart. NT isn't showing any of the trades on the chart is that because its using historical data ?


    /// A Spike above or below the BB more than 3 pts on the Daily
    /// </summary>
    [Description("A Spike above or below the BB more than 3 pts on the Daily")]
    public class BBspike : Strategy
    {
    #region Variables
    // Wizard generated variables
    private int myInput0 = 3; // Default setting for MyInput0
    // User defined variables (add any user defined variables below)
    #endregion

    /// <summary>
    /// This method is used to configure the strategy and is called once before any strategy method is called.
    /// </summary>
    protected override void Initialize()
    {
    Add(Bollinger(2, 14));
    Add(Bollinger(2, 14));
    SetProfitTarget("Long1", CalculationMode.Ticks, 16);
    SetProfitTarget("Short1", CalculationMode.Ticks, 16);
    SetStopLoss("", CalculationMode.Ticks, 16, false);

    CalculateOnBarClose = false;
    }

    /// <summary>
    /// Called on each bar update event (incoming tick)
    /// </summary>
    protected override void OnBarUpdate()
    {
    // Condition set 1
    if (GetCurrentBid() >= Bollinger(2, 14).Upper[1] + 12 * TickSize)
    {
    EnterShort(DefaultQuantity, "Short1");
    }

    // Condition set 2
    if (GetCurrentBid() <= Bollinger(2, 14).Lower[1] + (-12 * TickSize))
    {
    EnterLong(DefaultQuantity, "Long1");
    }
    }

    #region Properties
    [Description("")]
    [GridCategory("Parameters")]
    public int MyInput0
    {
    get { return myInput0; }
    set { myInput0 = Math.Max(1, value); }
    }
    #endregion
    }
    }

    #2
    Hello Joe,

    Thank you for your post.

    GetCurrentBid() does not work historically and the Close price will be substituted instead. This maybe where the issue lies as the conditions may not be true running historically.
    Cal H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Segwin, 05-07-2018, 02:15 PM
    10 responses
    1,767 views
    0 likes
    Last Post Leafcutter  
    Started by Rapine Heihei, 04-23-2024, 07:51 PM
    2 responses
    30 views
    0 likes
    Last Post Max238
    by Max238
     
    Started by Shansen, 08-30-2019, 10:18 PM
    24 responses
    943 views
    0 likes
    Last Post spwizard  
    Started by Max238, Today, 01:28 AM
    0 responses
    9 views
    0 likes
    Last Post Max238
    by Max238
     
    Started by rocketman7, Today, 01:00 AM
    0 responses
    7 views
    0 likes
    Last Post rocketman7  
    Working...
    X