need help for email alert on a target and stopLoss
how do i add a email alert to a my target and my stop loss when its triggered. i did the entery long and i get the email alert for that, but dont know how to do the other 2. \this is what i have so far. thanks all
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).
I think you need to use the OnExecution NT function to access the executions you'll get from fireing the target and/or stop loss functions. You will probably need to set the signal name in the target and stop loss orders so that you can determine in OnExecution which execution it has gotten. You would then put your email alert code in the OnExecution function at the point where you determine which execution you've gotten.
Here is some sample code of mine (the NT manual talks about this also:
For stop loss orders, I'm fairly certain that you need to call your code from the OnExecution function (really anytime you want to do something on a fill). The reason being that fills are somewhat asynchronous. I'm not as sure about the target, but I believe so also, because it requires something being done on a fill.
The private function was just my wrapper around the ExitLongStop function. It would be good for you to consult the NT manual pages, especially the OnExecution, EnterLongStop, EnterShortStop, etc pages.
The following user says Thank You to kandlekid for this post: