Negative Equity Loss Limiter – HELP PLEASE
Forums › ProRealTime English forum › ProOrder support › Negative Equity Loss Limiter – HELP PLEASE
- This topic has 11 replies, 3 voices, and was last updated 7 years ago by Derek.
-
-
03/26/2017 at 11:45 AM #29901
Following much discussion on the Thread below I’m trying to code into a Bot a ‘Daily Loss Limiter’ that limits starting equity to a loss of > £100 (or whatever) per day.
https://www.prorealcode.com/topic/bad-beginings/
I’ve got so far (see below) but when – next day – the Bot executes another trade Strategyprofit is still – £100 and so the Bot immediately exits (see attached).
I need to increment the ‘negative equity’ by £100 each day. I’ve tried loads after researching the site, I’ve tried a count and a loop, but can’t get it to run as needed. Please can somebody help?
(Mods, I cannot see the Insert PRT Code button, I’ve tried everything that has worked in the past (clear history, cookies etc, log out back in again) and also I did same on Firefox, Chrome and Edge … still cant see Insert PRT Code, even reduced my monitor resolution … so apologies for unformatted code.)
Below are the snippets that deal with my ‘negative equity loss limiter’.
If Strategyprofit < -100 then
Exitshort at market
Sell at Market
savedate = date
EndifIF condition and Bullish0 and c1 and date <> savedate THEN
BUY PositionSize CONTRACTS AT MARKET
a=1
ENDIF12345678910If Strategyprofit < -100 thenExitshort at marketSell at Marketsavedate = dateEndifIF condition and Bullish0 and c1 and date <> savedate THENBUY PositionSize CONTRACTS AT MARKETa=1ENDIFThank You in Anticipation
GraHal03/26/2017 at 12:35 PM #29906My first line above should read … limits starting equity to a loss of <= £100 (or whatever) per day.
If you want the full Bot code (to check out your ideas to help me) then it’s on the link below.
I didn’t want to paste it on this Thread as the Insert PRT Code is not available to me (again!?)
https://www.prorealcode.com/prorealtime-trading-strategies/ichimoku-exits-cloud/
I decided after reading below that ichimoku based Bots might be worth spending some time on.
GraHal
03/26/2017 at 9:14 PM #29925Isn’t it something like this? You can change StartTime depending on what timeframe you are using:
12345StartTime = 073000if time = StartTime thenStartofDayProfit = STRATEGYPROFITendifOkToTrade = (STRATEGYPROFIT > StartofDayProfit - 100)1 user thanked author for this post.
03/27/2017 at 11:29 AM #29946Thank you AutoS … above looks like it should work and I did try many variations of your theme. Most ended up with Trades open and exit in very short period in same bar with loss of £4 and equity curve continuing downwards for whole test period after an initial loss.
It got me thinking / learning for another scenario so your time helping me was not wasted.
‘Necessity is the mother of invention’ so I came up with below, simple, effective. Attached results without and with loss limiter … not exactly wow!, but could be more significant on another Bot.
I feel happier now going Live with a Loss Limiter. I may miss trades that ‘lose then win’, but overall knowing below zero / negative equity has some protection is comforting.
(If profit is above 350, the loss limiter below does not trigger … for any rookie coders reading this)
1234If STRATEGYPROFIT < 350 AND POSITIONPERF < - 0.002 thenExitshort at MarketSell at MarketEndifGraHal
03/27/2017 at 4:58 PM #30029Hmm not the sort of equity curve I would be looking for
1 user thanked author for this post.
03/27/2017 at 6:18 PM #30030No nor me! ha
I’m not ‘promoting’ the Bot, I got it from the Library, it was on my Platform cos I’ve been checking out Ichimoku based Bots.
The curve had 2 periods where the equity went negative / below zero so it suited my purpose re testing out my ‘loss limiter’.
03/29/2017 at 10:27 PM #30252Hello Grahal,
you have got to help me out because I still don’t get it:
Every system has drawdowns and they can occur at any time. To me this means every system going live needs to be funded with at least enough money to sustain the maximum historical drawdown. Hence most systems run by small traders are underfunded.
Or, do you want to pretend the system from trading after a certain amount of losses? In this case the overall win-loss ratio will drop because losers will remain losers and a few winners will be removed since they are needed to confirm the current profitable status of the system. This way the edge will be lowered and it is already hard to sustain an edge.
03/30/2017 at 12:27 AM #30260Hi Derek
Seems a few don’t get it, but no problem. Unless I’m kidding myself??
It’s like when manual trading after a few losses, I get cautious until I’ve made my losses back.
To me the most important thing surely is protection of starting capital? Systems start and they may or may not start with a losing trade or two or three. So if the losing trades take my starting equity below a predefined level (say £15) then the Loss Limiter triggers and exits the losing trade if loss is less than minus / – 0.04% (before, maybe, becoming an even bigger loss).
1234If STRATEGYPROFIT <= 15 AND POSITIONPERF < - 0.0004 thenSell at MarketExitshort at MarketEndifYou’re right, the Loss limiter may kill a few trades that may have become winners, but so what? My starting equity is protected and I live to fight another day?
All I need is for the System to start on a winner or two and profit exceed £15 and the Loss Limter may never trigger again (unless equity falls below £15 at a later date).
I’m quite happy if you want to come back on it.
GraHal
03/30/2017 at 8:19 PM #30409First off all: Thank you for explaining it again (and again and…).
The way I understand it now is that the loss-limiter is an attempt to manage the risk of a system going broke right after the “go-live”.
But where do we go from there?
A) wait for a better period and restart the system: But there cannot be a guarantee that it will keep on working now. This is why I think the max DD of the tests before the launch is so important. It tells us what to expect before we should switch the system off. I would prefer a scaling down of the position size over a size of zero.
B) reject the system: If this happens too often it might mean that the previous testing process is flawed and should be examined.
I know the following feeling quite well: “If this system starts out well, I will stick to it!”. But it is an essential contradiction to the statistical expectancy value of a system, which is more like: Play this game a thousand times and there will be a 65% chance of going away with 20% profits.
At least that’s why I have not researched direct trading of the equity curve and prefer to focus on position sizing.
Hope this was understandable.
Greetings!
03/30/2017 at 8:52 PM #30412Yep @Derek understandable and you say … The way I understand it now is … is correct, but the System isn’t closed / rejected just the losing Trade is exited and the System continues to the next Trade.
If I had the time / dedication to do extensive checks on a System using Walk Forward and Monte Carlo analysis etc then I likely would place more value on the statistical expectancy value of a system. As it is I use Backtest results as a weathervane / guide, but try to dodge the storms! 🙂
I’m pleased to say the ‘Negative Equity Limiter’ worked for me today, see https://www.prorealcode.com/topic/does-this-system-have-an-edge-or-is-it-just-the-last-year/page/2/#post-30404.
Regards
GraHal03/30/2017 at 8:59 PM #3041303/30/2017 at 9:04 PM #30414 -
AuthorPosts
Find exclusive trading pro-tools on