Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Strategy wizard open order

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

    Strategy wizard open order

    Hi, I'm trying a very simple strategy to send a stop order without any condition, just to test, but this do not work.

    Here the code generated from strategy wizard:

    #region Using declarations
    using System;
    using System.ComponentModel;
    using System.Diagnostics;
    using System.Drawing;
    using System.Drawing.Drawing2D;
    using System.Xml.Serialization;
    using NinjaTrader.Cbi;
    using NinjaTrader.Data;
    using NinjaTrader.Indicator;
    using NinjaTrader.Gui.Chart;
    using NinjaTrader.Strategy;
    #endregion

    // This namespace holds all strategies and is required. Do not change it.
    namespace NinjaTrader.Strategy
    {
    /// <summary>
    /// Enter the description of your strategy here
    /// </summary>
    [Description("Enter the description of your strategy here")]
    public class OrderStart : 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()
    {
    EnterLongStop(DefaultQuantity, GetCurrentAsk() + 1 * TickSize, "");
    }

    #region Properties
    #endregion
    }
    }

    #2
    Hello federicoo, and thank you for your question.

    Please first visit the strategies tab of the control center, and make sure your strategy remains enabled. It is enabled when it is checked. Please next check to see if there are any messages in the logs tab of your control center related to your strategy. If there are, please let us know what they are.

    I look forward to assisting further.
    Jessica P.NinjaTrader Customer Service

    Comment


      #3
      Hi, the script is enable and the log only shows this:

      Enabling NinjaScript strategy 'OrderStart/f2346230055946aa95e95864ddd8893d' : On starting a real-time strategy - StrategySync=SubmitImmediately SyncAccountPosition=False EntryHandling=AllEntries EntriesPerDirection=1 StopTargetHandling=PerEntryExecution ErrorHandling=StopStrategyCancelOrdersClosePositio ns ExitOnClose=True/ triggering 30 before close Set order quantity by=Strategy ConnectionLossHandling=KeepRunning DisconnectDelaySeconds=10 CancelEntryOrdersOnDisable=True CancelExitOrdersOnDisable=True CalculateOnBarClose=False MaxRestarts=4 in 5 minutes

      Thanks

      Comment


        #4
        Thank you, I will need just one more piece of information to have a complete picture on my end. Are you able to start and run the SampleMACrossover strategy on your computer?

        I am testing with your strategy on my end and will report back with my findings.
        Jessica P.NinjaTrader Customer Service

        Comment


          #5
          Thank you, it is working now...

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by funk10101, Today, 09:43 PM
          0 responses
          6 views
          0 likes
          Last Post funk10101  
          Started by pkefal, 04-11-2024, 07:39 AM
          11 responses
          37 views
          0 likes
          Last Post jeronymite  
          Started by bill2023, Yesterday, 08:51 AM
          8 responses
          44 views
          0 likes
          Last Post bill2023  
          Started by yertle, Today, 08:38 AM
          6 responses
          26 views
          0 likes
          Last Post ryjoga
          by ryjoga
           
          Started by algospoke, Yesterday, 06:40 PM
          2 responses
          24 views
          0 likes
          Last Post algospoke  
          Working...
          X