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
I am wondering if it is possible to stop a strategy after a certain amount of $ loss to your Cumulative profit.
I have read and used the settings for stopping if the CumProfit is > $ amount.
ie Performance.RealtimeTrades.TradesPerformance.Currency.CumProfit - priorTradesCumProfit >= 1000
But can't get my head around how to achieve what I would like
ie. Can I store the highest daily profit achieved and then stop the strategy once a predetermined $ amount is lost from this value.
Thanks
Can you help answer these questions from other members on NexusFi?
Good idea zeller. Here's some code I came up with from various samples to give me some peace of mind if you were to run your strategies unattended. (in case I ever have a strategy that makes money!!!)
Thank you once again. Will have a look.
I am wanting to stop the risk of losing all the profits of the day . So I was thinking of this method. I think that it makes good money management. ie. If I get up to $500 cumulative profit and then get on a string of losers or low trades, I don't want to whittle it down to zero. I am willing to keep trading until I lose a set amount form this highest total. So if I am willing to risk a loss of $300 from my highest point then the strat stops at that point.
Hi Mike
I tried the code and had a few errors. come up.
It didn't like the [0] is this:
int _highestcumprofit_bar = HighestBar(mycumprofit, Bars.BarsSinceSession - 1)[0];
Also had to add (double) after the = signs.
double _highestcumprofit = (double) MAX(mycumprofit, Bars.BarsSinceSession - 1)[0];
But now when I apply the strat it just freezes up.
Thanks forth ehelp so far though.
Regards