Creating A Custom BACK-TESTER Display • PINE SCRIPT [V4 OUTDATED] LESSON

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 ม.ค. 2025

ความคิดเห็น • 40

  • @TheArtOfTrading
    @TheArtOfTrading  3 ปีที่แล้ว +2

    🔷 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

  • @norbi3legs
    @norbi3legs 3 ปีที่แล้ว +3

    You are, not only a genius, but a great teacher. Thanks!! Greetings from South America.

  • @JustMe-ro1be
    @JustMe-ro1be 2 ปีที่แล้ว +1

    Absolutely brilliant video. Really well explained, thanks!

  • @emonitani
    @emonitani ปีที่แล้ว

    great, very good, excellent presentation mate !

  • @freddurst4420
    @freddurst4420 2 ปีที่แล้ว +3

    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.

  • @kingmonk44
    @kingmonk44 2 ปีที่แล้ว

    pullback strategie with nearly 1000 lines of code... holy moly :D

  • @eko_wa
    @eko_wa 3 ปีที่แล้ว

    Thanks to sharing Mr Matthew

  • @ShortSprintMotivation
    @ShortSprintMotivation 9 หลายเดือนก่อน

    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?

  • @astfastly6404
    @astfastly6404 3 ปีที่แล้ว +1

    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

  • @towardlu9035
    @towardlu9035 3 ปีที่แล้ว

    Thanks a lot my friend, your course worth 100M dollars

  • @fynnbaumeister4116
    @fynnbaumeister4116 ปีที่แล้ว

    Du bist genial! 💎🇩🇪

  • @obwanda9113
    @obwanda9113 2 ปีที่แล้ว +1

    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()

  • @KakdeG
    @KakdeG 3 ปีที่แล้ว +2

    Great Videos. Will be nice to bring in Trailing stop loss and target in Pine strategy.

    • @silencecaptive
      @silencecaptive 3 ปีที่แล้ว +2

      yea this would be great Matt. moving stop loss to break even once the price moved 1 ATR in the direction of your trade!

  • @sykesybwoy
    @sykesybwoy 3 ปีที่แล้ว +1

    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.

  • @Johnsormani
    @Johnsormani 9 หลายเดือนก่อน

    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

  • @blodgriskatten
    @blodgriskatten 3 ปีที่แล้ว

    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

  • @jamesabaileyjr
    @jamesabaileyjr 2 ปีที่แล้ว

    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?

  • @jleoarsenault6107
    @jleoarsenault6107 3 ปีที่แล้ว

    Great Video!! Question is there a way to make this for Crossover for the Averages ??

  • @adebear69
    @adebear69 3 ปีที่แล้ว +2

    Is it possible to add most wins/losses in a row?

  • @donjuancolosimo
    @donjuancolosimo 3 ปีที่แล้ว

    Great video cuz! Get it

  • @serseri7082
    @serseri7082 ปีที่แล้ว

    How can I show the original strategy test results on the chart?

  • @jack_sparrow1049
    @jack_sparrow1049 3 ปีที่แล้ว

    Can you make a video on how to code break even stops and targets

  • @milonashisdas9177
    @milonashisdas9177 3 ปีที่แล้ว +3

    Hi Matthew, it's really helpful. Can you please write a code to detect a DOUBLE TOP AND DOUBLE BOTTOM ? Please.

  • @mchew97
    @mchew97 3 ปีที่แล้ว

    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.

  • @welcometomathy
    @welcometomathy 3 ปีที่แล้ว

    Thx for sharing Matt 1.0

  • @casperli4856
    @casperli4856 2 ปีที่แล้ว

    for some reason the back tester display does not show up on my chart. could it be version difference with pine script?

  • @muhammadsalafudin9235
    @muhammadsalafudin9235 3 ปีที่แล้ว

    Thank youu, its so helpfull 🔥

  • @Berghiker
    @Berghiker ปีที่แล้ว

    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?

  • @michaelgarcia189
    @michaelgarcia189 2 ปีที่แล้ว

    How can this be applied to multiple pairs at the same time?

  • @villagefoodie5864
    @villagefoodie5864 3 ปีที่แล้ว

    Could u post a link for copy this code

  • @deldimeyves5914
    @deldimeyves5914 2 ปีที่แล้ว

    plz can you update for pinscript 5?

  • @lomofatboy
    @lomofatboy 3 ปีที่แล้ว

    Thank you

  • @probeachbum
    @probeachbum ปีที่แล้ว

    Is there a v5 version of this?

    • @lornemccoy7653
      @lornemccoy7653 ปีที่แล้ว +1

      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.

  • @DK-bn1jm
    @DK-bn1jm 2 ปีที่แล้ว

    ✈️✈️✈️✈️✈️✈️

  • @casperli4856
    @casperli4856 2 ปีที่แล้ว

    this does not work in pine script v5 T_T

    • @alpha12th
      @alpha12th 2 ปีที่แล้ว +1

      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?

    • @lornemccoy7653
      @lornemccoy7653 ปีที่แล้ว +1

      @@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.

  • @4kMoviespot
    @4kMoviespot ปีที่แล้ว

    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