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 DJ888, 04-16-2024, 06:09 PM
          4 responses
          12 views
          0 likes
          Last Post DJ888
          by DJ888
           
          Started by terofs, Today, 04:18 PM
          0 responses
          8 views
          0 likes
          Last Post terofs
          by terofs
           
          Started by nandhumca, Today, 03:41 PM
          0 responses
          6 views
          0 likes
          Last Post nandhumca  
          Started by The_Sec, Today, 03:37 PM
          0 responses
          3 views
          0 likes
          Last Post The_Sec
          by The_Sec
           
          Started by GwFutures1988, Today, 02:48 PM
          1 response
          9 views
          0 likes
          Last Post NinjaTrader_Clayton  
          Working...
          X