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 Rotdabbel, 07-17-2024, 10:00 AM
      2 responses
      11 views
      0 likes
      Last Post Rotdabbel  
      Started by pattyarston, Today, 03:33 AM
      0 responses
      3 views
      0 likes
      Last Post pattyarston  
      Started by sarahastin11, Today, 03:16 AM
      0 responses
      4 views
      0 likes
      Last Post sarahastin11  
      Started by sarahastin11, Today, 03:13 AM
      0 responses
      4 views
      0 likes
      Last Post sarahastin11  
      Started by sarahastin11, Today, 03:05 AM
      0 responses
      4 views
      0 likes
      Last Post sarahastin11  
      Working...
      X