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)
Stop strategy after a set $ amount lost from CumProfit
If your broker supports it and if you run more than 1 strategy, you might consider a stand-alone strategy that uses the GetAccountValue() method. You would need to manually enter your account value at the start of session as that method only works in OnBarDate.
You could then code a daily loss limit for that account, and a "trailing stop" on your equity curve that could trigger an alert or the FlattenEverything() command.
Just be careful if you invoke FlattenEverything() at the same time you are closing positions with other trade logic as you could get inflight issues. A way around it is to apply this stratgey to a different time series than the one you are trading on (say 3 minute bars, COBC=true, for example).
Well I did play with the idea for a bit, but gave up after I realised that I could never get a strategy to do what I wanted.
the money management side was ok, but I couldn't get an strategy that I was happy with. So I gave up, and went back to trading manually. This was the main part of the code.
I am a very basic programmer, and tend to use code from other users, then change it a bit.
Regards