Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Does this look finished in the coding

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

    Does this look finished in the coding

    This code below is for a stop and reverse type of trading for price movement only, no indicators.I will always be in the market, going short,than closing the short and than going long, than closing the long and than going short, just following the price movement,always in the market. Does this look finished and complete or am I omitting something.


    /// <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 (High[0] > High[1])
    {
    EnterLong(DefaultQuantity, "");
    }

    // Condition set 2
    if (Low[0] < Low[1])
    {
    EnterShort(DefaultQuantity, "");
    }
    }

    #region Properties
    #endregion
    }
    }

    There cannot be much missing, if there is something missing, this type of stop and reverse is a very simple and short code.

    Thanx,
    Steve

    #2
    Your code below does not look unreasonable. However, you need to test and verify. Note: Due to bandwidth reasons we can not provide support to a level of "does my strategy work as I would expect".
    DierkNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by POTTER16, Today, 03:31 PM
    0 responses
    4 views
    0 likes
    Last Post POTTER16  
    Started by enricbcn, 05-08-2018, 01:36 AM
    78 responses
    43,512 views
    1 like
    Last Post Wessel
    by Wessel
     
    Started by Wessel, Today, 12:50 PM
    0 responses
    8 views
    0 likes
    Last Post Wessel
    by Wessel
     
    Started by asmmbillah, Today, 12:39 PM
    0 responses
    8 views
    0 likes
    Last Post asmmbillah  
    Started by dtmtradingco, Today, 12:30 PM
    0 responses
    7 views
    0 likes
    Last Post dtmtradingco  
    Working...
    X