Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

mailing alert messages

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

    #16
    HI Patrick,

    I'm having issues trying to use the OnExecution Method. However given I run simple strategies, hadling only 1 entry per instrument couldn't I use something like this:
    Code:
    if(CrossAbove(EMA(50), EMA(100), 1)) { EnterLong(); SendMail("[email protected]", "[email protected]", "Trade Alert", "Long Entry at"+Position.AvgPrice); }
    It appears to work, the only issue I currently have, is that the prices I am sent via email don't reflect the last entry. should I solve this by using FIFO for position avg. price calculations' at Tools-->Options-->General-tab?

    Comment


      #17
      Hello sburtt,

      Thank you for your post.

      The incorrect price is due to the fact the EnterLong() has not even been processed yet before you send out an e-mail.

      This is why OnExecution() in important, so that you send the e-mail out when the order is filled.

      Please let me know if you are still running into items with OnExecution().

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      87 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      47 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      66 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      69 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      59 views
      0 likes
      Last Post CarlTrading  
      Working...
      X