Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Thanks for taking a look at this. I'm losing my mind.
Dave
EDIT: Added the zip in case that's easier. Ideally, I'd like to see the following but don't know if it's possible. Would love to only get one email for each upon fill:
I've just read it, can play with Ninja now, but some quick remarks:
- I don't see any boolean flag, to avoid multiple emails, and
- maybe using entryOrder1.AvgFillPrice instead of Position.AvgPrice
In this example, it will only send one mail, the boolean variable have to be re-initialized to false, when needed.
The first steps is, imho, to write, on a piece of paper, what you want to do, because the logic might be very clear first, as you'll have to play with multiple booleans values here.
And do some Print() first, instead of sirect sendmail, it'll be easier to debug.
Apologies for not thanking you sooner for your last post but I'm afraid I just can't get this thing to work properly, even when trying to follow your instructions verbatim. I'm having the following issues:
1. Sometimes it enters upon a cross. Sometimes it doesn't.
2. Sometimes it emails on entry and exit. Sometimes it doesn't.
3. Filling of Target or Stop Loss results in no email.
4. Filling of Exit results in "ES Long Exit Filled 1170: 0" (instead of actual profit/loss).
5. In the output window, lastProfit only works with the first trade and doesn't change thereafter.
My guess is that some things are resetting after the first trade and some thing aren't but I'm currently at a loss. If you have a few minutes (and don't yet want to kill me) maybe you can see what the problem is?
To anyone following along, I now have my strat emailing when the stop or target is filled. If interested, here's the code:
The only thing left to do is to turn "ES Cross2050 Target Filled: 0" into "ES Cross2050 Target Filled: +20". I'm pretty close but not quite sure how to declare PnL as a variable. If anyone has an example and would like to post, great. Otherwise, I'll post the rest when I figure it out.