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.
    BertrandNinjaTrader Customer Service

    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 JohnZee, Today, 04:14 PM
      0 responses
      4 views
      0 likes
      Last Post JohnZee
      by JohnZee
       
      Started by timmbbo, Today, 04:11 PM
      0 responses
      3 views
      0 likes
      Last Post timmbbo
      by timmbbo
       
      Started by rexsole, Today, 03:21 PM
      0 responses
      5 views
      0 likes
      Last Post rexsole
      by rexsole
       
      Started by michelz, 02-18-2025, 08:30 AM
      39 responses
      1,133 views
      0 likes
      Last Post MiCe1999  
      Started by lacharp, 03-31-2025, 10:10 PM
      6 responses
      45 views
      0 likes
      Last Post richlink  
      Working...
      X