Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

I Have No Trades Showing

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

    I Have No Trades Showing

    hi, can someone please tell me why i don't even get 1 trade with this strategy:


    // This namespace holds all strategies and is required. Do not change it.
    namespace NinjaTrader.Strategy
    {
    /// <summary>
    /// buy high, sell low
    /// </summary>
    [Description("buy high, sell low")]
    public class marco : Strategy
    {
    #region Variables
    // Wizard generated variables
    // 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()
    {

    CalculateOnBarClose = false;
    }

    /// <summary>
    /// Called on each bar update event (incoming tick)
    /// </summary>
    protected override void OnBarUpdate()
    {
    // Condition set 1
    if (SMA(14)[1] > SMA(14)[2]
    && Close[2] > Open[2]
    && Close[1] < Open[1]
    && Low[0] > Low[1]
    && GetCurrentAsk() == High[1])
    {
    EnterLong(DefaultQuantity, "long");
    }

    // Condition set 2
    if (SMA(14)[1] < SMA(14)[2]
    && Close[2] < Open[2]
    && Close[1] > Open[1]
    && High[0] < High[1]
    && GetCurrentBid() == Low[1])
    {
    EnterShort(DefaultQuantity, "");
    }

    // Condition set 3
    if (GetCurrentBid() == Low[1])
    {
    ExitLong("stoploss", "");
    }

    // Condition set 4
    if (GetCurrentAsk() == High[1])
    {
    ExitShort("stoploss", "");
    }
    }

    #2
    donatella, thanks for your post and welcome to the NinjaTrader support forums! Your rules set might be too hard to generates any trades, remove all but the basic one and check if trades are generated - then add those back and see the effect those have on your strategy behavior. From a quick view your combination is pretty though to fulfill.

    Comment


      #3
      actually, the calendar in the account performance page was set to march 2006 as starting and ending date!! i think it will work now, if not i'll try your suggestion thanks

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      144 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      71 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      125 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      79 views
      0 likes
      Last Post PaulMohn  
      Working...
      X