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 argusthome, 03-08-2026, 10:06 AM
      0 responses
      71 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      43 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      25 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      28 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      56 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X