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 inanazsocial, Today, 01:15 AM
      1 response
      5 views
      0 likes
      Last Post NinjaTrader_Jason  
      Started by rocketman7, Today, 02:12 AM
      0 responses
      6 views
      0 likes
      Last Post rocketman7  
      Started by dustydbayer, Today, 01:59 AM
      0 responses
      1 view
      0 likes
      Last Post dustydbayer  
      Started by trilliantrader, 04-18-2024, 08:16 AM
      5 responses
      23 views
      0 likes
      Last Post trilliantrader  
      Started by Davidtowleii, Today, 12:15 AM
      0 responses
      3 views
      0 likes
      Last Post Davidtowleii  
      Working...
      X