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();
          Shawn B.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by RookieTrader, Today, 09:37 AM
          3 responses
          14 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by kulwinder73, Today, 10:31 AM
          0 responses
          5 views
          0 likes
          Last Post kulwinder73  
          Started by terofs, Yesterday, 04:18 PM
          1 response
          23 views
          0 likes
          Last Post terofs
          by terofs
           
          Started by CommonWhale, Today, 09:55 AM
          1 response
          3 views
          0 likes
          Last Post NinjaTrader_Erick  
          Started by Gerik, Today, 09:40 AM
          2 responses
          7 views
          0 likes
          Last Post Gerik
          by Gerik
           
          Working...
          X