Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Pairs trading

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

    #16
    Freddy, yes that would work if you're trying to place a bracket with 2 limits at the same time, then you would run into the order handling rules of the managed approach detailed here :



    BarsSinceExit can be used as well - http://www.ninjatrader.com/support/h...ssinceexit.htm

    Comment


      #17
      Thanks,

      Does anything like BarsSinceTakeProfit exist?

      I am trying to make a system that will not re enter during the day after it has take a profit, do you know how this could be done?

      thanks!

      Freddy

      Comment


        #18
        BarsSinceExit could work on a profit target exit as well if you link it up with the lastTrade performance for example - http://www.ninjatrader.com/support/h.../nt7/trade.htm

        So if the last trade was a winner (target hit) and BarsSinceEntry is at a cetain barcount do something....

        Comment


          #19
          Sorry to be an amateur but could you please write this sentence in ninjascript for me?

          if profit of last trade > 1%

          if you could tell how to do that would be amazing!

          Thanks

          Freddy

          Comment


            #20
            Freddy, you can try for example this snippet :

            Code:
            if (Performance.RealtimeTrades.Count > 0)
            {
            
            	// Get the last completed real-time trade (at index 0)
            	Trade lastTrade = Performance.RealtimeTrades[Performance.RealtimeTrades.Count - 1];
            	
            	// Calculate the PnL for the last completed real-time trade in %
            	double lastProfit = lastTrade.ProfitPercent;
            	
            	// Pring the PnL to the Output window
            	Print("The last trade's % profit is " + lastProfit);
            
            }
            Last edited by NinjaTrader_Bertrand; 08-25-2011, 10:18 AM.

            Comment


              #21
              Thanks,

              If i have a condition that is met how can i make a statement that says 'do not enter for the rest of the day'

              Thanks a lot

              Freddy
              Last edited by freddy250; 08-25-2011, 04:05 PM.

              Comment


                #22
                Hi Freddy,

                You can do this with a bool flag. Include a check to this bool flag within your entry conditions. After the order is submitted, set to the opposite direction so that your condition no longer evaluates true.

                You can use Bars.FirstBarOfSession to reset this bool flag for each new trading session.
                Ryan M.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by argusthome, 03-08-2026, 10:06 AM
                0 responses
                110 views
                0 likes
                Last Post argusthome  
                Started by NabilKhattabi, 03-06-2026, 11:18 AM
                0 responses
                59 views
                0 likes
                Last Post NabilKhattabi  
                Started by Deep42, 03-06-2026, 12:28 AM
                0 responses
                37 views
                0 likes
                Last Post Deep42
                by Deep42
                 
                Started by TheRealMorford, 03-05-2026, 06:15 PM
                0 responses
                41 views
                0 likes
                Last Post TheRealMorford  
                Started by Mindset, 02-28-2026, 06:16 AM
                0 responses
                78 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Working...
                X