Stay flat after a big loss
Forums › ProRealTime English forum › ProOrder support › Stay flat after a big loss
- This topic has 11 replies, 4 voices, and was last updated 7 years ago by
irioton.
-
-
03/19/2018 at 12:16 AM #6563503/19/2018 at 1:41 AM #65637
I started a new topic since your question had nothing to do with FLATAFTER.
To tell your system to stay flat after a big loss (5% in your case) you have to:
- set a variable so that trading is enabled (say TradeOn = 1) and add this condition to Your_Conditions to start a new trade
- set a variable with your initial Equity
- compare the current strategyprofit agains the previous one AFTER exiting a trade (when OnMarket[1] is true while OnMarket is false)
- if the difference is >= -5% you’ll have to set the above said variable TradeOn = 0 so that no more trades are started till you want (you may want to set further conditions to reenable trading)
- update your equity
12345678910111213141516171819202122..ONCE BigLoss = 0.95 //5% or more has to be considered a big lossONCE TradeOn = 1 //Trading enabled by default at launchtimeONCE Capital = 10000 //Set your initial capitalIF NOT OnMarket AND OnMarket[1] THEN //When a trade is closed ...IF (Capital + StrategyProfit) <= (Capital * BigLoss) THEN //... check if it's a big loss and ...TradeOn = 0 //... eventually stop tradingENDIFCapital = Capital + StrategyProfit //Update your EquityENDIF..IF Your_Conditions AND TradeOn AND Not OnMarket THEN..BUY/SELLSHORT .........ENDIF..03/19/2018 at 12:25 PM #65664Hi Robertogozzi !
Thank you for your answer,
I think I found simpler in PRT manual :
1234567//x = maximum loss in eurosIF STRATEGYPROFIT <-xTHEN QUITENDIFand thats it ! The goal was to cut the system alltogether in case of an emergency. I put a fixed value, but I am sure it is possible to put a pourcentage instead, tell me what you think.
Chears !
03/19/2018 at 12:47 PM #65671The code you found is useful when you want to stay flat after a big loss on the whole equity, so that if you earn 7%, then lose 10% you will keep trading.
My code, instead, even if you have earned, say, 30%, once you have a big loss it stops trading, so that you won’t lose all of your profits!
It’s up to you to set your own strategy that best fits you!
03/19/2018 at 1:01 PM #6567403/19/2018 at 1:26 PM #65676We were just discussing something similar to what you have requested on this thread yesterday:
https://www.prorealcode.com/topic/backtest-sorting-by-lowest-drawdown/#post-65589
123456789Capital = 3000MaxDrawDownPercentage = 66Equity = Capital + StrategyProfitMaxDrawdown = Equity * (MaxDrawDownPercentage/100)IF OnMarket and ((PositionPrice - low)*CountOfPosition) > MaxDrawDown THENQuitENDIF03/19/2018 at 1:43 PM #65678My code, instead, even if you have earned, say, 30%, once you have a big loss it stops trading, so that you won’t lose all of your profits!
I’ve added your code to my Snippet Finder database
PS Anybody can add your own or anybody else’s snippets … please try, it takes less than 1 minute.
03/19/2018 at 1:48 PM #6567903/19/2018 at 2:00 PM #65682Hi irioton
Please could you add the snippet you mention or any other, then the task is shared?
I’m trying to pull together the google sheet so that snippets can be found, sorted and accessed by anybody all in one place.
Thank You
GraHal03/19/2018 at 2:03 PM #65683@GraHal, thank you. I’ll add something to that sheet as soon as I can!
1 user thanked author for this post.
03/19/2018 at 2:07 PM #6568503/19/2018 at 2:20 PM #65687 -
AuthorPosts
Find exclusive trading pro-tools on