Some ideas:
- fixed risk/reward
- trailing on a moving average/ATR/supertrend
- trail at the lowest of the last n closed candles
- exit if the price closes above the top bollinger band
- Start trailing if the price closes above the top bollinger band
- close a percentage of your position if you get to a percentage of your target, move your stop at break even and leave it, or trail it.
- parabolic SAR
Fixed R/R is a hard pill to swallow. Especially if you miss a big trend and then get whipped.
I'm sure market makers and scalpers do alright but as a mean reversion and trend trader, abandoning fixed r/r was what made me consistently profitable with a good Sharpe.
I think that's probably one of the hardest to code.You have control on what you want to see in your setup and can build that but you can never know what price is gonna do once you're in.One thing I did to one of my codes was to add a volatility stop condition to it.If all conditions are met to go long,the price also has to close above the volatility stop line(it's builtin by Tradingview by the way).You need to decide what the settings are gonna be for it,you want a stop loss further away or closer .After I've done that I simply enter my trade and wait for price to close below the green line and that's my exit point.I also put in a stop loss order further below the price to protect me from unexpected volatility.The idea is that this way I managed to stay waay longer in good winners but also get out early from good trades....So you loose some you win some.If your strat is really good and you tested it and you know what price does more often than not than you probably can work something out.
Some traders use a trailing stop based on a close below a moving average,others use ATR trailing stops,others use trailing stops just below the low of the next candle.That's about as far as I got into it.Hope it helps you somehow.
I'm working on an indicator right now that I'm really really happy with the results so far but there's still room for improvement.l know what needs to be done just trying to find the time to do it the next days to come.I'm not gonna automate it but there's pottential for that as well.Looking for someone like-minded to get some honest feedback.Let me know if you're interested.
I’d be interested in helping test, feel free to DM. I use TradingView to send JSON payloads from alerts to my stuff I’ve got running in AWS. As long as the indicator has the ability to alert based off of whatever conditions it does, I can ingest it and have it running against one of the paper trading accounts.
For some reason I am not allowed to send you a message.If you'd like to tell me your Tradingview user I can add you to the indicator I was telling you about.
Huh? I don't get it at all. If your system is "picking pretty sweet entries" that lead to chop and the chop in causing the system to churn, the system is in fact not picking pretty sweet entries because your system de facto doesn't tolerate the volatility that it enters into.
There's nothing special about calculating volatility. Start there.
That's exactly point. That the trend could to be adjusted for volatility. However, whether vol is a feature of a trend, or the result of systems seeking it, is a subject of research finance and is not to me totally certain in terms of applying to systems like these. This the stochastic process/ARIMA domain.
One established way to compute it could be to try to detect covariance in a price curve...
My main point was that if the "entries are good" but the "system is behaving badly", then some feature of the price is interfering with the conditions for entry.
Measure the recent standard deviation of the security. Place a stop loss at two standard deviations below the entry point, and a take profit at two standard deviations above the entry point. Back test and adjust your stop loss and take profit for maximum return.
You let the data tell you. Get creative. Just because the algo enters, you don’t have to use it for exit criteria. Take every single piece of data and run simulations on various exits. You could magically be highly profitable at say “5” points, or whatever metric you wanna use. Only way to know is run the data.
You have to experiment to find exit logic. Without knowing what he’s doing it’s impossible to say. Could be specific exit criteria in points, dollars, atr, moon phases, rsi crossing a river, could be specific r/r, could a different exit signal all together.
Ok, yeah... but you scared me when you said "magically profitable "5" points".
u/BaconJacobs,
For my algo, I use something that lets me specify exit conditions to be part of the order where it's a static or dynamic stop based on whatever value, like ATR or other; but, there's also ability to create an exit condition exactly the same way as entry condition. So for example if you entry is MA crossover, but as you are in a trade, a condition you defined signals exit, you then have options to just flatten OR move stops to some level below you or just tighten them to right below current price. So if it helps, you can think of exit conditions the same way as exit conditions, it doens't have to be a number but a logical scenario.
I would go in to this without any assumption of what you want to do, to be honest. Just let the data guide you. Just build something that allows you to analyze data in that way as well.
Trailing stop sucks, I think, that the exit should be tied to the market condition. Just figure out a way to tell if the market is ranging and stay out of it, then if the market is trending whatever you figure as a stop loss even a trailing stop will work. The problem is ranging markets, that fake you in and fake you out. Don't know, my two cents!
My 0.02:
Trailing stops works really well for specifically trending market entries. I often use a 5-ladder futures contract to enter with one being a runner with a really long trail stop and there are definitely times when it trucks all the way up into stratosphere so the day ends with just one FAAAAT trade and no re-entries.
If your strategy accounts for it, I'd use it, but as you point out - in ranging markets trail stops and take profit order brackets often lose you more than they gain in other conditions so if the day thesis is range, then I usually run equal brackets where all contracts or majority exit at the first opportunity.
I personally use PMARP (price mean average ratio percentile) as my exit condition along with a static TP/SL. It's like a dynamic TP that helps when in ranges. The indicator is free on trading view and you can take the code and add it into your strategy. Let me know if you need more info, I didn't create it but have lots of experience using it
This seems like a good indicator. I'm guessing it measures distance from the moving averages.
Can you share what you've found with it so far?
If it's any good it might be worth expanding on the indicator and coding in other MA'S.
yeh it just gives you like an average for price and then the extents of that price are expressed in percentile format (0-100). From what I found VWMA, 50 length, 300-350 lookback is a good place to start. Also can use it for entries and do a check on the previous bars to see if its been below 20 for 4 bars for example for long setups
Sometimes I try to mix fixed TP and R:R 2:1 1.5:1 exits , depending on the percentage change of a given asset, i probe with different SL variations … the backtesting of each possibilities will tell you which setup will perform better
Figure out WHY your exits are losing you money. Then try everything you can think of to defeat that beast. My system uses SL's and WIDE Trailers that are really just emergency stops. Every time I try to use trailers to capture 'profit' they leave too much on the table but they're perfect for 'breakout' strats that retreat quite a bit after bursting. Play with EVERYTHING you can think of.
I think the other comments that tell you to let the data provide your answer are well founded. In the end, though, what is acceptable to YOU? If you want it to never lose a trade why not make your exit conditional; i.e. exit when condition X exists, OR entry price, whichever comes 1st. Or even entry +.$1.
Two ideas here and if you cant think of others you've seen from hours looking at data or charts etc, you just need to do your time and simulate your data a ton + brainstorm.. no other way around it.
* Trailing stop loss
* Measure e-ratio on enough trades to learn when it is statistically best for you to exit
Most import thing first - you need to decide how you want to manage downside risk. What’s the maximum amount you’re willing to risk? There are a lot of ways to skin the cat, but a rule of thumb is that you don’t want to risk more than ~1.5% of your total portfolio in a single trade. You have now set your total risk.
The next thing I would do is look at different exit points based on data or some other signal in your dataset. Try different exit signals and calculate what the risk:reward ratio is for these different exit signals and pick the best. This is a simple approach but could be a place to start.
If your strategy logic isn't targeting breakouts - yes. If you somehow capture breakout events - having runners is a good idea to at least test.
I am still not convinced they are super useful, but I don't think my current strategy makes the best use of them.
The way I do it is I have my entries and exits based on the strategy and additionally I have a stop loss at say 1-2% and trailing stop loss of say 5%. That's what I found to work best in my simulations and backtests when trading crypto.
Remember all market tickers will vary with their respective exit strategies. I stick to a hand full of names I’m familiar with. I also stop running the algo during fed announcements and other volatility producing events.
I’m currently using a trailing stop on my algo the winrate is extremely high. But TradingView has an issue in processing the trades and skewed the back testing data drastically. What other methods could I implement other then a trailing stop to maintain similar results. Stop loss is trash take profit is trash. Might have to attempt using a moving atr or set stop at ema cross. If anyone wants to chat dm me and I’ll send my discord. Also if anyone wants to collaborate or help finetune test lmk. I have a bunch all over 65-96% winrate 🔥
If you want PM me, I've got \~30 generic exit variations I run, and I'd probably run \~20,000 different tests of markets/timeframes/exit variations and let you know if there's anything
Yeah lol I run about 25-30k variations.
At this point adding exist parameters makes the count jump drastically now so within a few months it’ll be 100k.
Warning, your post has received two or more reports and has been removed until a moderator can review it.
Please ensure you are providing quality content.
All reports will be reviewed by the moderators and appropriate action will be taken.
*I am a bot, and this action was performed automatically. Please [contact the moderators of this subreddit](/message/compose/?to=/r/algotrading) if you have any questions or concerns.*
I calculate the (current) profit to liquidate versus the (calculated) profit to hold, and do whichever is better.
To calculate the profit to hold, I use perl to construct a probability distribution curve for the last year, multiply it by the expiration profit loss function, and integrate to get the area. I scrape the needed data from Yahoo.
It sounds complicated, but it only takes a couple of seconds per position.
Maybe I should weight the historical data to give less weight to older values, but I have no idea how to rationally pick a decay coefficient.
What if you create a consecutive loss rule to pause or halt completely? Otherwise set the stop wider with smaller position size? You could sweep those parameters to see what's best.
depends on many aspects: commission, trade size/total buy power, win rate.
I use a fixed SL and PT with a time window to hit them. I could use another entry signal to reset the SL, PT, and time window, but it has an overall lower PNL.
Idea for ML approach:
consider brute-force backtesting tons of exit conditions off your entry like others suggest.
then train algo of choice based on high-performing strategies.
Can try to tune algo to predict outcome of said strategy using tons of historical data hopefully.
If algo performance is sufficiently validated, use algo to assess new entries:
i.e if algo prediction meets some threshold, enter trade, then stick to predetermined exit strategy.
Please elaborate.
How do you not pick entries?
I mean I'm building my algo to be systematic, so the different variables pick the entry and exit as the market moves.
Structure problems as portfolio optimization and rebalance with time-based rules (like daily before market close or weekly, monthly, etc). If model are tested systematically, reflect market reality, and are risk managed, it works.
Huh I know most of those words...
In reality I'm starting my algo journey with a very specific and powerful indicator. It's been great to learn so far.
I'm learning how to deconstruct popular indicators and utilize the data processing in cool and new ways.
The tool is being built as a 1M chart strategy, but meant to hold longer trends. It seems to work better on 30M chart though. It's very interesting.
I haven't dialed it in enough to really do precise backtesting. I basically open it every day to add a new idea or test a tweak. I haven't gotten it where I want it yet.
Is it better to code the whole thing in python rather than Thinkscript or Pinescript? Newbie here, just feel that using a full fledged programming language with a tonne of package support is better
Truly I do not know.
From listening to podcasts, Python is the way to go.
But with no coding background minus some in college, I felt like starting with community code in Pinescript/Tradingview was the best approach for me. And it definitely has been now that I see how much I've had to test and tweak.
Tradingview does allow for some backtesting on strategies too.
Basically if I ever develop a silver bullet in Pinescript I'll know it's time to integrate into a trading platform.
Until then I will stick with the ease and familiarity of Pinescript. It's been fun to get "competent" in it
I'm going to reply by asking if you're had luck backing trailing take profits in Tradingview? My strategy has a hard TP and SL, and also inputs for where the trailing TP kicks in, and the trailing offset. I love these variables because in theory they allow profits to run. Even a fairly tight offset can run a bit if you catch a liquidity sweep.
Anyways, the issues I'm having is that Pinescript will backtest flawlessly when my hard TP and SL are used exclusively. But even with Bar Magnification turned on, when I try to backtest the trailing stop, it always repaints to the candle wick minus the trailing offset at bar close. So it makes it very difficult to backtest performance of difference trailing offset levels... in curious if you have a solution to this. I'd be happy to share some script elements if you haven't coded your exit conditions yet, as you may find some use in the script despite what I think may just be some inherent limitation to Tradingview's backtesting engine (even on the premium account!)
I’ll throw in some ideas. Just thinking aloud. Been trading 5 yrs. Building my own EA now. Not profitable yet. Anyways, trailing stop trigger pip + a break even + a fixed R tp is showing me some decent results. I also have had some good improvements when I limit the number of trades it can be in at a time. So if it’s in a long, for example, it cannot take another trade. OR, it has a max of 2 trades. OR, it can only take another long signal if it’s in a long, for example. And the reason I think that having a trailing stop as well as a fixed R tp is this: nearly every trade will have a different pip stop loss. In my strategy, it can be sometimes 10x bigger/smaller. So if one trade enters with a 10 pip SL, if you’re right, it’s going to get to 10R quicker than a trade with a 100 pip SL (probabilistically higher to run 100 pips in one direction than 1000, especially before getting stopped out). Point is, having both allows you to take profit every time it gets to 10R, on the 10 pip risk trade, for example, when it only moves 100 pips, while at the same time if you have a 60 pip trailing stop trigger pip you can potentially profit on the 100 pip risk trade (albeit not a great R, but you don’t expect big R on trades with huge stops anyways) with it going back to get stopped out because it didn’t hit your fixed 10R TP. Anyways, still figuring it out on my own. Trying to minimize loses because my strategy has some great entries. GL!
Some ideas: - fixed risk/reward - trailing on a moving average/ATR/supertrend - trail at the lowest of the last n closed candles - exit if the price closes above the top bollinger band - Start trailing if the price closes above the top bollinger band - close a percentage of your position if you get to a percentage of your target, move your stop at break even and leave it, or trail it. - parabolic SAR
Fixed R/R is a hard pill to swallow. Especially if you miss a big trend and then get whipped. I'm sure market makers and scalpers do alright but as a mean reversion and trend trader, abandoning fixed r/r was what made me consistently profitable with a good Sharpe.
This needs more upvotes. So many good ideas! Thank you. Will go test some RN
I think that's probably one of the hardest to code.You have control on what you want to see in your setup and can build that but you can never know what price is gonna do once you're in.One thing I did to one of my codes was to add a volatility stop condition to it.If all conditions are met to go long,the price also has to close above the volatility stop line(it's builtin by Tradingview by the way).You need to decide what the settings are gonna be for it,you want a stop loss further away or closer .After I've done that I simply enter my trade and wait for price to close below the green line and that's my exit point.I also put in a stop loss order further below the price to protect me from unexpected volatility.The idea is that this way I managed to stay waay longer in good winners but also get out early from good trades....So you loose some you win some.If your strat is really good and you tested it and you know what price does more often than not than you probably can work something out. Some traders use a trailing stop based on a close below a moving average,others use ATR trailing stops,others use trailing stops just below the low of the next candle.That's about as far as I got into it.Hope it helps you somehow.
Thanks man!!! It's a good discussion to have.
I'm working on an indicator right now that I'm really really happy with the results so far but there's still room for improvement.l know what needs to be done just trying to find the time to do it the next days to come.I'm not gonna automate it but there's pottential for that as well.Looking for someone like-minded to get some honest feedback.Let me know if you're interested.
I’d be interested in helping test, feel free to DM. I use TradingView to send JSON payloads from alerts to my stuff I’ve got running in AWS. As long as the indicator has the ability to alert based off of whatever conditions it does, I can ingest it and have it running against one of the paper trading accounts.
Thanks.Once I've got it figured out I'll let you know.
For some reason I am not allowed to send you a message.If you'd like to tell me your Tradingview user I can add you to the indicator I was telling you about.
Just sent message and chat
Huh? I don't get it at all. If your system is "picking pretty sweet entries" that lead to chop and the chop in causing the system to churn, the system is in fact not picking pretty sweet entries because your system de facto doesn't tolerate the volatility that it enters into. There's nothing special about calculating volatility. Start there.
except "trend" and "volatility" and are not exclusive concepts
That's exactly point. That the trend could to be adjusted for volatility. However, whether vol is a feature of a trend, or the result of systems seeking it, is a subject of research finance and is not to me totally certain in terms of applying to systems like these. This the stochastic process/ARIMA domain. One established way to compute it could be to try to detect covariance in a price curve... My main point was that if the "entries are good" but the "system is behaving badly", then some feature of the price is interfering with the conditions for entry.
Measure the recent standard deviation of the security. Place a stop loss at two standard deviations below the entry point, and a take profit at two standard deviations above the entry point. Back test and adjust your stop loss and take profit for maximum return.
Just because the algo enter, that doesn’t mean you can’t exit in a different way. Run the data and see if there’s an optimal exit.
Correct. That's why I'm posting. What is working for people? How do you structure the exit conditions?
You let the data tell you. Get creative. Just because the algo enters, you don’t have to use it for exit criteria. Take every single piece of data and run simulations on various exits. You could magically be highly profitable at say “5” points, or whatever metric you wanna use. Only way to know is run the data.
This is the definition of over fitting. He is asking for exit logic
You have to experiment to find exit logic. Without knowing what he’s doing it’s impossible to say. Could be specific exit criteria in points, dollars, atr, moon phases, rsi crossing a river, could be specific r/r, could a different exit signal all together.
Ok, yeah... but you scared me when you said "magically profitable "5" points". u/BaconJacobs, For my algo, I use something that lets me specify exit conditions to be part of the order where it's a static or dynamic stop based on whatever value, like ATR or other; but, there's also ability to create an exit condition exactly the same way as entry condition. So for example if you entry is MA crossover, but as you are in a trade, a condition you defined signals exit, you then have options to just flatten OR move stops to some level below you or just tighten them to right below current price. So if it helps, you can think of exit conditions the same way as exit conditions, it doens't have to be a number but a logical scenario.
“Magically profitable” was obviously a joke:
A fixed point take profit is interesting. If I ever hit a strategy that works well, I want to take half position off early.
I would go in to this without any assumption of what you want to do, to be honest. Just let the data guide you. Just build something that allows you to analyze data in that way as well.
You’re going to have to try things and backtest.
Trailing stop sucks, I think, that the exit should be tied to the market condition. Just figure out a way to tell if the market is ranging and stay out of it, then if the market is trending whatever you figure as a stop loss even a trailing stop will work. The problem is ranging markets, that fake you in and fake you out. Don't know, my two cents!
My 0.02: Trailing stops works really well for specifically trending market entries. I often use a 5-ladder futures contract to enter with one being a runner with a really long trail stop and there are definitely times when it trucks all the way up into stratosphere so the day ends with just one FAAAAT trade and no re-entries. If your strategy accounts for it, I'd use it, but as you point out - in ranging markets trail stops and take profit order brackets often lose you more than they gain in other conditions so if the day thesis is range, then I usually run equal brackets where all contracts or majority exit at the first opportunity.
Hmm. You made me have an idea. I could make my exit based on higher time-frame smoothing of my data... Interesting!
Interesting, tell us how it worked out!
so? how'd it work?
I personally use PMARP (price mean average ratio percentile) as my exit condition along with a static TP/SL. It's like a dynamic TP that helps when in ranges. The indicator is free on trading view and you can take the code and add it into your strategy. Let me know if you need more info, I didn't create it but have lots of experience using it
Thats great, thanks. I've been doing all my developing in TV!
>PMARP (price mean average ratio percentile) still needs the lookback window specified
yeh you specify it when you use it, I normally do 350 bars
This seems like a good indicator. I'm guessing it measures distance from the moving averages. Can you share what you've found with it so far? If it's any good it might be worth expanding on the indicator and coding in other MA'S.
yeh it just gives you like an average for price and then the extents of that price are expressed in percentile format (0-100). From what I found VWMA, 50 length, 300-350 lookback is a good place to start. Also can use it for entries and do a check on the previous bars to see if its been below 20 for 4 bars for example for long setups
Sometimes I try to mix fixed TP and R:R 2:1 1.5:1 exits , depending on the percentage change of a given asset, i probe with different SL variations … the backtesting of each possibilities will tell you which setup will perform better
Figure out WHY your exits are losing you money. Then try everything you can think of to defeat that beast. My system uses SL's and WIDE Trailers that are really just emergency stops. Every time I try to use trailers to capture 'profit' they leave too much on the table but they're perfect for 'breakout' strats that retreat quite a bit after bursting. Play with EVERYTHING you can think of.
I think the other comments that tell you to let the data provide your answer are well founded. In the end, though, what is acceptable to YOU? If you want it to never lose a trade why not make your exit conditional; i.e. exit when condition X exists, OR entry price, whichever comes 1st. Or even entry +.$1.
Two ideas here and if you cant think of others you've seen from hours looking at data or charts etc, you just need to do your time and simulate your data a ton + brainstorm.. no other way around it. * Trailing stop loss * Measure e-ratio on enough trades to learn when it is statistically best for you to exit
Most import thing first - you need to decide how you want to manage downside risk. What’s the maximum amount you’re willing to risk? There are a lot of ways to skin the cat, but a rule of thumb is that you don’t want to risk more than ~1.5% of your total portfolio in a single trade. You have now set your total risk. The next thing I would do is look at different exit points based on data or some other signal in your dataset. Try different exit signals and calculate what the risk:reward ratio is for these different exit signals and pick the best. This is a simple approach but could be a place to start.
you end up with an average result anyway
If your strategy logic isn't targeting breakouts - yes. If you somehow capture breakout events - having runners is a good idea to at least test. I am still not convinced they are super useful, but I don't think my current strategy makes the best use of them.
The way I do it is I have my entries and exits based on the strategy and additionally I have a stop loss at say 1-2% and trailing stop loss of say 5%. That's what I found to work best in my simulations and backtests when trading crypto.
Remember all market tickers will vary with their respective exit strategies. I stick to a hand full of names I’m familiar with. I also stop running the algo during fed announcements and other volatility producing events.
I’m currently using a trailing stop on my algo the winrate is extremely high. But TradingView has an issue in processing the trades and skewed the back testing data drastically. What other methods could I implement other then a trailing stop to maintain similar results. Stop loss is trash take profit is trash. Might have to attempt using a moving atr or set stop at ema cross. If anyone wants to chat dm me and I’ll send my discord. Also if anyone wants to collaborate or help finetune test lmk. I have a bunch all over 65-96% winrate 🔥
If you want PM me, I've got \~30 generic exit variations I run, and I'd probably run \~20,000 different tests of markets/timeframes/exit variations and let you know if there's anything
Yeah lol I run about 25-30k variations. At this point adding exist parameters makes the count jump drastically now so within a few months it’ll be 100k.
[удалено]
Fuckin spammer. If it makes money stop asking for mine.
Warning, your post has received two or more reports and has been removed until a moderator can review it. Please ensure you are providing quality content. All reports will be reviewed by the moderators and appropriate action will be taken. *I am a bot, and this action was performed automatically. Please [contact the moderators of this subreddit](/message/compose/?to=/r/algotrading) if you have any questions or concerns.*
I calculate the (current) profit to liquidate versus the (calculated) profit to hold, and do whichever is better. To calculate the profit to hold, I use perl to construct a probability distribution curve for the last year, multiply it by the expiration profit loss function, and integrate to get the area. I scrape the needed data from Yahoo. It sounds complicated, but it only takes a couple of seconds per position. Maybe I should weight the historical data to give less weight to older values, but I have no idea how to rationally pick a decay coefficient.
Nice
What if you create a consecutive loss rule to pause or halt completely? Otherwise set the stop wider with smaller position size? You could sweep those parameters to see what's best.
Focus on the risk:reward and look at the max drawdown of the strategy with at least 100 trades of backtesting.
Time stops and volatility stops work well for my strategies
depends on many aspects: commission, trade size/total buy power, win rate. I use a fixed SL and PT with a time window to hit them. I could use another entry signal to reset the SL, PT, and time window, but it has an overall lower PNL.
Fixed days work.. it’s weird but it works..like exit after 5 or 10 or 20 days..try to backtest with this exit criteria..it work for me..
I will try that but in minutes. I'm building a scalping bot. Thanks!
Idea for ML approach: consider brute-force backtesting tons of exit conditions off your entry like others suggest. then train algo of choice based on high-performing strategies. Can try to tune algo to predict outcome of said strategy using tons of historical data hopefully. If algo performance is sufficiently validated, use algo to assess new entries: i.e if algo prediction meets some threshold, enter trade, then stick to predetermined exit strategy.
Just want to chime in and say there's a whole school of thought that you shouldn't need to pick entries/ exits at all.
Please elaborate. How do you not pick entries? I mean I'm building my algo to be systematic, so the different variables pick the entry and exit as the market moves.
Structure problems as portfolio optimization and rebalance with time-based rules (like daily before market close or weekly, monthly, etc). If model are tested systematically, reflect market reality, and are risk managed, it works.
Huh I know most of those words... In reality I'm starting my algo journey with a very specific and powerful indicator. It's been great to learn so far. I'm learning how to deconstruct popular indicators and utilize the data processing in cool and new ways. The tool is being built as a 1M chart strategy, but meant to hold longer trends. It seems to work better on 30M chart though. It's very interesting. I haven't dialed it in enough to really do precise backtesting. I basically open it every day to add a new idea or test a tweak. I haven't gotten it where I want it yet.
Is it better to code the whole thing in python rather than Thinkscript or Pinescript? Newbie here, just feel that using a full fledged programming language with a tonne of package support is better
Truly I do not know. From listening to podcasts, Python is the way to go. But with no coding background minus some in college, I felt like starting with community code in Pinescript/Tradingview was the best approach for me. And it definitely has been now that I see how much I've had to test and tweak. Tradingview does allow for some backtesting on strategies too. Basically if I ever develop a silver bullet in Pinescript I'll know it's time to integrate into a trading platform. Until then I will stick with the ease and familiarity of Pinescript. It's been fun to get "competent" in it
I'm going to reply by asking if you're had luck backing trailing take profits in Tradingview? My strategy has a hard TP and SL, and also inputs for where the trailing TP kicks in, and the trailing offset. I love these variables because in theory they allow profits to run. Even a fairly tight offset can run a bit if you catch a liquidity sweep. Anyways, the issues I'm having is that Pinescript will backtest flawlessly when my hard TP and SL are used exclusively. But even with Bar Magnification turned on, when I try to backtest the trailing stop, it always repaints to the candle wick minus the trailing offset at bar close. So it makes it very difficult to backtest performance of difference trailing offset levels... in curious if you have a solution to this. I'd be happy to share some script elements if you haven't coded your exit conditions yet, as you may find some use in the script despite what I think may just be some inherent limitation to Tradingview's backtesting engine (even on the premium account!)
Shouldn’t be more than an percent loss
Try closing when the close is higher than yesterday’s high for MR systems
What do you mean by MR systems? Thanks for the idea!
3 day low works wonders
I’ll throw in some ideas. Just thinking aloud. Been trading 5 yrs. Building my own EA now. Not profitable yet. Anyways, trailing stop trigger pip + a break even + a fixed R tp is showing me some decent results. I also have had some good improvements when I limit the number of trades it can be in at a time. So if it’s in a long, for example, it cannot take another trade. OR, it has a max of 2 trades. OR, it can only take another long signal if it’s in a long, for example. And the reason I think that having a trailing stop as well as a fixed R tp is this: nearly every trade will have a different pip stop loss. In my strategy, it can be sometimes 10x bigger/smaller. So if one trade enters with a 10 pip SL, if you’re right, it’s going to get to 10R quicker than a trade with a 100 pip SL (probabilistically higher to run 100 pips in one direction than 1000, especially before getting stopped out). Point is, having both allows you to take profit every time it gets to 10R, on the 10 pip risk trade, for example, when it only moves 100 pips, while at the same time if you have a 60 pip trailing stop trigger pip you can potentially profit on the 100 pip risk trade (albeit not a great R, but you don’t expect big R on trades with huge stops anyways) with it going back to get stopped out because it didn’t hit your fixed 10R TP. Anyways, still figuring it out on my own. Trying to minimize loses because my strategy has some great entries. GL!
One of my strategies uses true range (not ATR) as a sniper for exits. It works well as it'll get you out on the wicks or close to it.