i suggest using strategy.initial_capital , as it is already built-in to the strategy settings (input) , no reason to re-define with another input (startBalance). Thx for video very informative.
Hello, thank you for the video, it's great. If I have my script ready and it's working in the strategy tester, how can I activate it with paper trading to test the script? Can I get some help with this, and could you possibly make a video about that as well?
I did create a new indicator and now i want to create a strategy for that so i took a search in your channel and i didn’t even find a tutorial that could help me in so i hope you do for us some videos about creating blank strategy
Hey Matt, I've noticed that in the v5 they added new arguments in the strategy tester. Can you please explain how to use the comment_profit and comment_loss arguments in the strategy.exit()
Hey Matt, do you need to add the "truncate" calc? The tostring already has a similar function if you add a ,"0.00" after the value, it should give you what you're after.
There is a big issue with the built in backtester. If you want to compare buy&hold to your strategy’s profit over a time window it doesn’t use the same time period for both but uses a random time window, so you could be comparing 6 months of your strategy with 2 years buy&hold. That’s why it’s so much better to have your own backtester
How do I count or calculate bars or volume bars during intraday only? Using bars that are printed from the market open only. Are there any videos of this? Thanks
How can I have a strategy give me the accumulated results of running across multiple symbols? For instance: in TradingView you can see the win percentage, drawdown all the stuff for one symbol. What if I want to say, here are these thirty symbols I trade and then see what the over all results would be from running my strategy on those?
Hi Matt, Can you be kind to teach how to write a script to detect live bankers chips volume entering the market and their exit volume. I am new in trading and find volume pushes up price. Thanks. Stay safe.
I was able to make the changes to make it work in v5, however, when looking at the results compared to the built in Strategy Tester, there is a big difference when day trading a stock like NVDA. So I am not sure if there is an error somewhere in one or the other testing processes.
I copied the whole source codes into Tradingview then convert to version 5 is working. Then, I copy all the code related to the table to my strategy. Able to display the table initially. Later, I am not sure what I change, completely not possible to display the table. Not sure anyone know what the issue?
@@alpha12th I was able to get the code to work with my strategy in v5. However the return is very much different than the built in Strategy Tester, so I am not sure which one to believe.
🔷 This Lesson's Source Code: www.tradingview.com/script/t776tkZv-Hammers-Stars-Strategy/?offer_id=10&aff_id=15271
🔷 Hammers & Stars Lesson: th-cam.com/video/BvbnzQwLmNQ/w-d-xo.html
🔷 My Indicators & Strategies Course (Steal My Code!): courses.theartoftrading.com/courses/my-indicators
🔷 Ultimate Pullback Indicator: courses.theartoftrading.com/courses/ultimate-pullback-indicator
🔷 Limitations of the Strategy Tester: th-cam.com/video/uM5m_iUAP8g/w-d-xo.html
You are, not only a genius, but a great teacher. Thanks!! Greetings from South America.
Absolutely brilliant video. Really well explained, thanks!
great, very good, excellent presentation mate !
i suggest using strategy.initial_capital , as it is already built-in to the strategy settings (input) , no reason to re-define with another input (startBalance). Thx for video very informative.
pullback strategie with nearly 1000 lines of code... holy moly :D
Thanks to sharing Mr Matthew
Hello, thank you for the video, it's great. If I have my script ready and it's working in the strategy tester, how can I activate it with paper trading to test the script? Can I get some help with this, and could you possibly make a video about that as well?
I did create a new indicator and now i want to create a strategy for that so i took a search in your channel and i didn’t even find a tutorial that could help me in so i hope you do for us some videos about creating blank strategy
Thanks a lot my friend, your course worth 100M dollars
Du bist genial! 💎🇩🇪
Hey Matt, I've noticed that in the v5 they added new arguments in the strategy tester. Can you please explain how to use the comment_profit and comment_loss arguments in the strategy.exit()
Great Videos. Will be nice to bring in Trailing stop loss and target in Pine strategy.
yea this would be great Matt. moving stop loss to break even once the price moved 1 ATR in the direction of your trade!
Hey Matt, do you need to add the "truncate" calc? The tostring already has a similar function if you add a ,"0.00" after the value, it should give you what you're after.
There is a big issue with the built in backtester. If you want to compare buy&hold to your strategy’s profit over a time window it doesn’t use the same time period for both but uses a random time window, so you could be comparing 6 months of your strategy with 2 years buy&hold. That’s why it’s so much better to have your own backtester
How do I count or calculate bars or volume bars during intraday only? Using bars that are printed from the market open only. Are there any videos of this? Thanks
How can I have a strategy give me the accumulated results of running across multiple symbols? For instance: in TradingView you can see the win percentage, drawdown all the stuff for one symbol. What if I want to say, here are these thirty symbols I trade and then see what the over all results would be from running my strategy on those?
Great Video!! Question is there a way to make this for Crossover for the Averages ??
Is it possible to add most wins/losses in a row?
Great video cuz! Get it
How can I show the original strategy test results on the chart?
Can you make a video on how to code break even stops and targets
Hi Matthew, it's really helpful. Can you please write a code to detect a DOUBLE TOP AND DOUBLE BOTTOM ? Please.
Hi Matt,
Can you be kind to teach how to write a script to detect live bankers chips volume entering the market and their exit volume. I am new in trading and find volume pushes up price. Thanks. Stay safe.
Thx for sharing Matt 1.0
for some reason the back tester display does not show up on my chart. could it be version difference with pine script?
Thank youu, its so helpfull 🔥
Can you design a stock strategy that gives no more than 7 trades a day with a high win % rate and high profit factor? .....or is that too dificult?
How can this be applied to multiple pairs at the same time?
Could u post a link for copy this code
plz can you update for pinscript 5?
Thank you
Is there a v5 version of this?
I was able to make the changes to make it work in v5, however, when looking at the results compared to the built in Strategy Tester, there is a big difference when day trading a stock like NVDA. So I am not sure if there is an error somewhere in one or the other testing processes.
✈️✈️✈️✈️✈️✈️
this does not work in pine script v5 T_T
I copied the whole source codes into Tradingview then convert to version 5 is working. Then, I copy all the code related to the table to my strategy. Able to display the table initially. Later, I am not sure what I change, completely not possible to display the table. Not sure anyone know what the issue?
@@alpha12th I was able to get the code to work with my strategy in v5. However the return is very much different than the built in Strategy Tester, so I am not sure which one to believe.
Hi thanks for the tutorial 🙂 Could you me with this ADX/DI calculation. I´m experience sometime lack in real time update for the conditions. Are there a way so only this part uses cal. on each thick ? it is using 15 min. but executing strategy on 1 min. chart ;
TF1 = input.string(title='HTF Resolution', defval='30', options=['1', '3', '5','10', '15','20', '30', '45', '60', '120', '180', '240', '1D', '1W', '1M'])
[realOpen, realHigh, realLow, realClose] = request.security(ticker.new(syminfo.prefix, syminfo.ticker), TF1, [open, high, low, close],lookahead=barmerge.lookahead_off)
//============================================ Calculates ADX and DI (Real) AND INPUT ========================================={
// Defines STRONG Trending Bull/Bear conditions INPUTS
STRONG_threshold = input.float(defval = 1.0,title = "STRONG ADX Threshold Value 13",minval = 0.0)
STRONG_di_threshold = input.float(defval = 20.0,title = "STRONG DI Threshold Value 18.1",minval = 0.0)
Real_chart_ADX_threshold = input.float(defval = 1.0,title = "Real Chart ADX '20'",minval = 0.0)
Real_chart_DI_threshold = input.float(defval = 1.0,title = "Real Chart DI '22.7'",minval = 0.0)
Real_chart_lenght= input(defval = 14,title = "Real Chart length '14'")
htf_length= input(defval = 14,title = "Higher time Chart length '14'")
ADX_on = input(false,'ADX on/Off')
real_up = ta.change(realHigh)
real_down = -ta.change(realLow)
real_plusDM = na(real_up) ? na : real_up > real_down and real_up > 0 ? real_up : 0
real_minusDM = na(real_down) ? na : real_down > real_up and real_down > 0 ? real_down : 0
real_trur = ta.rma(ta.tr, Real_chart_lenght)
real_plus = fixnan(100 * ta.rma(real_plusDM, Real_chart_lenght) / real_trur)
real_minus = fixnan(100 * ta.rma(real_minusDM, Real_chart_lenght) / real_trur)
real_sum = real_plus + real_minus
real_adx = 100 * ta.rma(math.abs(real_plus - real_minus) / (real_sum == 0 ? 1 : real_sum), Real_chart_lenght)
// Calculates ADX on higher timeframes
adxHTF = request.security(syminfo.tickerid, TF1, real_adx, barmerge.gaps_off,lookahead= barmerge.lookahead_on)
// Calculates DI Plus on higher timeframes
plusHTF = request.security(syminfo.tickerid, TF1, real_plus, barmerge.gaps_off,lookahead= barmerge.lookahead_on)
// Calculates DI Minus on higher timeframes
minusHTF = request.security(syminfo.tickerid, TF1, real_minus, barmerge.gaps_off,lookahead= barmerge.lookahead_on)
// Defines Trending Bull/Bear conditions
//threshold = input.float(defval = 17.0,title = "ADX Threshold Value 20",minval = 0.0)
stop_di_threshold = input.float(defval = 23.7,title = "DI Threshold Value 20",minval = 0.0)
// Get previous DI values
prev_plusDI = ta.valuewhen(ta.change(plusHTF), plusHTF, 1)
prev_minusDI = ta.valuewhen(ta.change(minusHTF), minusHTF, 1)
// Check for crossover and DI closing higher
bull_crossover_condition = ta.crossover(plusHTF, minusHTF)
bull_di_higher_than_close = plusHTF > prev_plusDI
bear_crossover_condition = ta.crossover(minusHTF, plusHTF)
bear_di_higher_than_close = minusHTF > prev_minusDI
// Start/Stop Bot condition
STRONG_bullHTFCondition = false
STRONG_bearHTFCondition = false
STRONG_bullHTFStopped = false
STRONG_bearHTFStopped = false
black_day = false // initialize black_day to false
STRONG_bullHTF = (plusHTF >= STRONG_di_threshold and bull_di_higher_than_close) or ((bull_crossover_condition) and bull_di_higher_than_close and plusHTF > minusHTF) ? 1 : 0
STRONG_bearHTF = (minusHTF >= STRONG_di_threshold and bear_di_higher_than_close) or ( (bear_crossover_condition) and bear_di_higher_than_close and minusHTF > plusHTF) ? -1 : 0
STOP_bullHTF = plusHTF