Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Flatten ALL Email Strategy

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

    Flatten ALL Email Strategy

    I use a strategy with $Profit & $Loss Limit.
    Strategy will stop trading if either are met & I receive email.

    I set FLATTEN ALL at 11:00AM (Set from Tools, Options, Misc).

    At times, Profit/Loss Limit may not be reached by 11:00AM.

    I don't want to change original strategy.

    This will be a New Strategy.
    Looking for Very Simple Script:
    Receive an EMAIL for REALIZED PnL when FLATTEN ALL occurs at 11:00AM.

    I would put this strategy to same chart as other strategy.

    #2
    Hello santafe,

    Thank you for your post.

    You would use ToTime(Time[0]) and check against 110000 and then use the SendMail() method.

    For example:
    Code:
    			if(ToTime(Time[0]) == ToTime(11,0,0))
    			{
    				SendMail("[email protected]", "[email protected]", "PnL", "Average cumulative profit of all trades is: " + Performance.AllTrades.TradesPerformance.Currency.CumProfit); 
    			}
    For information on ToTime and SendMail please visit the following links:
    ToTime: http://ninjatrader.com/support/helpG...nt7/totime.htm
    SendMail: http://ninjatrader.com/support/helpG...7/sendmail.htm

    Comment


      #3
      Another note here, the code I provided would have to be inside the strategy that is trading.

      Comment


        #4
        Flatten IF fails to meet target after a bar or two?

        I have a strategy that would work best if I could use a limit, rather than market order. The key is whether that order can be cancelled, and it's corresponding stops, IF the target is not hit w/in the next bar or two. Is that possible? So far, my script is constructed via the Wizard. Thanks for any ideas

        Comment


          #5
          Hello spmcc33,

          This would have to be manually coded in your strategy.

          You could use the BarsSinceEntry() method to return the number of bars that have elapsed since the last specified entry.
          Here is an example that will exit if the conditions aren't met within 2 bars.

          Code:
             if (BarsSinceEntry() > 2 && CrossAbove(SMA( 10), SMA( 20), 1))
                 ExitLong();

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          85 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          47 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          29 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          32 views
          0 likes
          Last Post TheRealMorford  
          Started by Mindset, 02-28-2026, 06:16 AM
          0 responses
          67 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Working...
          X