Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Run only once

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

    Run only once

    Is it possible to have a strategy only allow an order to be placed once per day (from that strategy...)? In other words, if the strategy conditions were met and an order was placed, no other orders would be placed by this strategy for the remainder of the trading session.

    #2
    imported post

    There are no NinjaScript methods or UI options to control this however, you can do that programatically.


    Ray
    RayNinjaTrader Customer Service

    Comment


      #3
      imported post

      That's what I'm looking for, how/what can I check that would tell me if THIS strategy had opened an order already that trading session? Even if it had met it's target and was now closed...

      Comment


        #4
        imported post

        Try something like:

        private bool orderPlaced = false;

        protected override void OnBarUpdate()
        {
        // Reseton newday
        if (Bars.DayBreak)
        orderPlaced = false;

        if (orderPlaced == fase&& yourCondition == true)
        {
        EnterLong();
        orderPlaced = true;
        }
        }

        Ray
        RayNinjaTrader Customer Service

        Comment


          #5
          imported post

          Makes sense...thanks Ray.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by charlesugo_1, 05-26-2026, 05:03 PM
          0 responses
          56 views
          0 likes
          Last Post charlesugo_1  
          Started by DannyP96, 05-18-2026, 02:38 PM
          1 response
          143 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 05-11-2026, 05:56 AM
          0 responses
          160 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 05-10-2026, 08:12 PM
          0 responses
          96 views
          0 likes
          Last Post CarlTrading  
          Started by Hwop38, 05-04-2026, 07:02 PM
          0 responses
          276 views
          0 likes
          Last Post Hwop38
          by Hwop38
           
          Working...
          X