Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Testing

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

    Strategy Testing

    Can someone tell me if a stategy still works OK on a market replay chart and do you need all the indicators on the chart that you have built into the strategy?

    Also can someone please have a look at this strategy and tell me why it wont work, it is my first time at arranging a strategy.
    #region Variables
    // Wizard generated variables
    privateint mA10 = 10; // Default setting for MA10
    // 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>
    protectedoverridevoid Initialize()
    {
    CalculateOnBarClose =
    true;
    }
    ///<summary>
    /// Called on each bar update event (incoming tick)
    ///</summary>
    protectedoverridevoid OnBarUpdate()
    {
    // Condition set 1
    if (Close[0] > EMA(10)[0]
    && CrossAbove(Stochastics(
    10, 3, 2).K, Stochastics(10, 3, 2).D, 1)
    && CrossAbove(MACD(
    12, 26, 3), MACD(12, 26, 3).Avg, 1))
    {
    DrawArrowUp(
    "My up arrow" + CurrentBar, false, 0, 0, Color.Lime);
    EnterLong(DefaultQuantity,
    "");
    }
    // Condition set 2
    if (Close[0] < EMA(10)[0]
    && CrossBelow(Stochastics(
    10, 3, 2).K, Stochastics(10, 3, 2).D, 1)
    && CrossBelow(MACD(
    12, 26, 3), MACD(12, 26, 3).Avg, 1))
    {
    DrawArrowDown(
    "My down arrow" + CurrentBar, false, 0, 0, Color.Red);
    EnterShort(DefaultQuantity,
    "");
    }
    }
    Last edited by kipper; 01-07-2009, 03:21 AM.

    #2
    Hi kipper, congrats on the first strategy - you will want to check the Control Center logs for errors. If there are no errors your conditions are probably just not evaluating to true all at the exact same time.

    Yes, the strategies do work in Market Replay mode, you don't have to add the indicators, but it makes the trading signal accuracy check much easier...for a tip how to plot them from the strategy - http://www.ninjatrader-support2.com/...ead.php?t=3228

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    558 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    324 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    545 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    547 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X