Simple Backtest with Tradingview/Pine script

Поделиться
HTML-код
  • Опубликовано: 8 сен 2024

Комментарии • 227

  • @luigibaldo103
    @luigibaldo103 3 года назад +56

    A very informative video and with my 7 months experience of forex trading and one thing I can assure is having a mentor or a tutor constantly guiding and teaching you can go a long way in making you successful.

    • @alfiesimmons8586
      @alfiesimmons8586 3 года назад +6

      Trading can really be frustrating without constant supervision especially if you are newbie.

    • @ralphpeterson6806
      @ralphpeterson6806 3 года назад +5

      Constant research is also necessary if you want to be an independent trader.

    • @timothyklaw5277
      @timothyklaw5277 3 года назад +4

      Luigi Baldo I am also inexperienced can you tutor me or who do you trade with?

    • @luigibaldo103
      @luigibaldo103 3 года назад +13

      I trade with Con. Edwin Earl because I believe he has the best trading pattern, honestly I feel he is the finest out there. You can reach him at consultedwinearl@gmail com

    • @alexbercs1969
      @alexbercs1969 3 года назад +5

      It is all about having an experienced person with all the qualities to instruct you.

  • @curiouskittycat5977
    @curiouskittycat5977 2 года назад +4

    Much appreciated it! I love that you speak fast, write a simple logical script and show the process. Something that some other videos take an hour to do and I don't have patience for it. Thanks so much!

  • @inkandeve
    @inkandeve 4 года назад +21

    Dennis... THANK YOU. Great video. You covered major points, and fast! Much obliged.

  • @GlynisDance
    @GlynisDance 2 года назад +7

    Thank you. I just started pine script today (but with a fair bit of previous programming experience). Your video was really clear and helpful!

  • @ownagejuice1394
    @ownagejuice1394 4 года назад +13

    thanks for this. you showed us the general view of backtesting. it would be nice if you could also show us the "EFFECTIVITY of the STRATEGY" like focusing on the success and effectiveness - GAINS vs LOSS as this is the main reason why we're backtesting

  • @bigfranchise
    @bigfranchise 2 года назад +6

    Great video! Thank you for keeping everything simple and concise!

  • @thewisegamer6034
    @thewisegamer6034 3 года назад +6

    Dude, you are so clear and explain things like crystal water, been looking for this kind of tutorial for ages, I’m subbing 🙂

  • @joeriblauw3901
    @joeriblauw3901 11 месяцев назад

    Just came across your video today, great help to get started! Thanks for sharing!

  • @JesusAmaTeMenino
    @JesusAmaTeMenino 4 года назад +15

    Finally a decent video on the topic. Great content dude!

  • @jaydoering5311
    @jaydoering5311 2 года назад

    Great intro to backtesting in TradeView with PineScript Editor.. Very clear. Thank you.

  • @narasimmamurthyr2534
    @narasimmamurthyr2534 3 года назад

    the way code was explained and fine tuned ,was easy to follow

  • @daviddickinson5685
    @daviddickinson5685 5 месяцев назад

    Very clear! Thanks for the introduction!!

  • @olarius650
    @olarius650 3 года назад

    Wow the exact strategy I am looking into....what a find!

  • @rajithasirasala4268
    @rajithasirasala4268 2 года назад

    great and simple video.. time to write some serious code

  • @israelpg77
    @israelpg77 4 года назад +1

    Excellent video, thanks for sharing, it includes some of the main points I was looking for, all this sounds now less overwhelming.

  • @tuzway
    @tuzway 3 года назад +1

    This was incredibly helpful. I'm going back in to see what the 1000.0 Contracts in the settings #23 & 24 represent.

  • @sophiej.4059
    @sophiej.4059 3 года назад

    Thanks Dennis!! Awesome contents! I programmed my first pine script within an hour.

  • @theREAL9er
    @theREAL9er 3 года назад +1

    Modern and relevant information, straight to the point, thank you very much Im so glad I found your video

    • @BroScro
      @BroScro 3 года назад

      ok #notarobot

    • @theREAL9er
      @theREAL9er 3 года назад +1

      @@BroScro thank you for your comment, indeed I am not a robot, I am a man

  • @giovanni4902
    @giovanni4902 3 года назад

    Concise and neat explanation. thanks for sharing

  • @jahskido06
    @jahskido06 4 года назад +1

    Thanks! That was simple and easy to understand. Transforming your strategy in code requires more tinkering though.

  • @volodymyrtruba7016
    @volodymyrtruba7016 4 года назад

    Best guide on pine scripts. Thanks

  • @cbaxtermusic
    @cbaxtermusic 6 месяцев назад

    this was amazing, thank you for this

  • @SSEnrich
    @SSEnrich 3 года назад

    Of course great video. I haven't seen many like this one. On the other hand. It adds to my feeling of an overwhelming amount of backtesting work. I would estimate at present I have 3 years of backtesting to do. This just adds even more work.

  • @Fingaphunk3000
    @Fingaphunk3000 2 года назад

    Very interesting, thanks for making this

  • @smitshah415
    @smitshah415 3 года назад +1

    Excellently done.

  • @NØkturnaI
    @NØkturnaI 3 года назад

    Finally i completed my indicator. Thank you so much! Subscribed.

  • @berrylangerak
    @berrylangerak 3 года назад

    This is an amazingly informative video, thanks so much!

  • @jennstaley2227
    @jennstaley2227 3 года назад

    This is awesome! Thank you for sharing your knowledge

  • @freddurst4420
    @freddurst4420 2 года назад

    good job mate!

  • @Porkductions
    @Porkductions 3 года назад +1

    Great tutorial. Thank you so much for making this!

  • @MsWakeskate
    @MsWakeskate 3 года назад +5

    You have next level skills! Thanks so much for all the quality content! Maybe you or someone on here can point me in the right direction. Is there a way to split consecutive similar signals in order to alert them separately in Pine? My study script spits out 3 consecutive similar buy signals and I would like to add an alert separately to each to pyramid my orders via alert automation. So... in short I would like to buy bigger on each similar signal in a study script. Any help would be greatly appreciated.

  • @Durandune
    @Durandune 4 года назад +1

    I enjoyed this video very much, I have been struggling to learn MT4/MQL4, so I decided to go with Pine/TradingView instead and great videos like this one are one of the reasons why! Plus I am also learning JS so Pine is very easy to pick up
    Thank You

  • @planyourtrades5733
    @planyourtrades5733 Год назад

    Good one I was waiting to see if you noticed that the signal was not showing on the chart because you were on 2014 when the signal did not start until 2015. 😁👍

    • @kevin.licenji
      @kevin.licenji Год назад

      Hey man, are you interested in automating your backtest in thousands of different settings without effort? I have developed a software and I'm giving away first trials for free.

  • @Norco0
    @Norco0 3 года назад +2

    Thank you very much! :)

  • @jboon4175
    @jboon4175 3 года назад +2

    Quick and dirty, just like I needed it. Ta.

  • @thedivinehistory6892
    @thedivinehistory6892 2 года назад +2

    Hi! It shows error " could not find function or function reference 'sma'. I put ema, ma but it shows same error. Please help me.

  • @nahomgirma2236
    @nahomgirma2236 3 года назад

    Great video

  • @R33lyfast
    @R33lyfast 3 года назад

    This is fantastic. Thanks, from 2020.

  • @cihanisler478
    @cihanisler478 5 месяцев назад

    This is what i need

  • @mladju
    @mladju 3 года назад

    Hey Dennis, this tutorial is EXTREMELY helpful. Thank you.

    • @BhanuPratap-eq4qw
      @BhanuPratap-eq4qw 2 года назад

      Did you used it, if yes can you give me code, bcz I have tried it's unable to compile the code so plz give me code if you have plz

  • @wassollderscheiss33
    @wassollderscheiss33 4 года назад +1

    It's a great totorial. I say that as a professional software developer. You should in fact consider going to udemy (if thats any profitable in general). The instructors there are quite good and you seem to be able to keep up.

  • @pradnyasamant8169
    @pradnyasamant8169 3 года назад

    very well explained. thank u!

  • @nelsonlizarazo2950
    @nelsonlizarazo2950 2 года назад

    Great¡¡¡¡ very helpful

  • @jaco9286
    @jaco9286 4 года назад

    Great video bro thanks so much.

  • @ghost4658
    @ghost4658 4 года назад

    Thanks!, simple and direct 👍🏻

  • @sametmutevelli
    @sametmutevelli 3 года назад

    Great tutorial, thanks a lot.

  • @brianpelkey8286
    @brianpelkey8286 Год назад

    Thanks much! I wanted to learn MA cross pine script and you certainly did that! Now I need to find out how to change the data periodicity from daily to weekly in pine script. Does anyone know how?

  • @bekiralbay9357
    @bekiralbay9357 3 года назад

    thank you very much

  • @volkaman
    @volkaman 2 года назад

    Thanks a lot!

  • @thetravellermk9987
    @thetravellermk9987 3 года назад +3

    Very nice video sir., Sir How can we add RSI, MACD and SMA together . Look should be same as we add each one by one. But if I want all on one click what can we do..?

  • @odia-sanatani
    @odia-sanatani 3 года назад

    great content

  • @abcnikhiltripathi
    @abcnikhiltripathi 3 года назад

    Loved it!

  • @eddu4361
    @eddu4361 3 года назад

    Super helpful! 🙏👊👊

  • @eddu4361
    @eddu4361 3 года назад

    Very helpful!

  • @aaronhart8566
    @aaronhart8566 4 года назад +13

    Here's the simple backtest.
    //@version=4
    strategy("Moving Average Crossover")
    ema20 = ema(close, 20)
    ema50 = ema(close, 50)
    long = ema20 > ema50
    short = ema20 < ema50
    strategy.entry("long", strategy.long, 1000.0, when=long)
    strategy.entry("short", strategy.short, 1000.0, when=short)

  • @vicvictor1695
    @vicvictor1695 4 года назад

    Much obliged.

  • @siddharthg4623
    @siddharthg4623 4 года назад

    thank you so much for the video

  • @passsacaglia
    @passsacaglia 3 года назад

    Super good!! If you wanna combine like an EMA strategy and set a condition like if ema4 >= sma6 "and macd = green" or something?
    I found this but can't make it work: macd = macd(close, 12,26,5)
    where macd color = color.green. I have an EMA+SMA strategy and wanna include like if my MACD is in green (I added the last one to 5 instead of 9 for a bit faster). Want to make it work.

    • @passsacaglia
      @passsacaglia 3 года назад

      This is my code so far, Daily chart:
      ema4 = ema(close, 4)
      sma6 = sma(close, 6)
      macd = macd(close, 12,26,5)
      long = ema4 > sma6 //here I want to add something like: when macd color = color.green
      or made a cross
      short = ema4 < sma6
      start = timestamp(2017,9,1,0,0)
      end = timestamp(2021,6,24,0,0)
      if time >= start and time

  • @Michelle783h
    @Michelle783h 3 года назад +3

    I keep gettig "no data" when i run the initial code and help ?

  •  3 года назад +1

    cant find a way to check if the price = last 2 days high/ low
    trying this:
    strategy("2 day high low", overlay = true, calc_on_every_tick=true)
    long = crossover(lowest(2))
    sell = crossover(highest(2))
    strategy.entry("Long", strategy.long, 35, when = long)
    strategy.close("Long", when = sell)

  • @dipak8864
    @dipak8864 2 года назад

    thnx bro. i want to learn pine script pls suggest any channel or videos. Thnx again

  • @tanmayrauth7367
    @tanmayrauth7367 4 года назад +1

    Great Video!! Can you help me to understand how can we run a strategy over a list of stock?

  • @gacctom
    @gacctom 4 года назад

    thank your sharing

  • @swapnilpatil2445
    @swapnilpatil2445 4 года назад +2

    Hello sir, will you please create a video which explains how to work with sessions(Intraday , Weekly or Monthly)
    Example-Suppose I have a pine script,but I want it to run only when "DAY SESSION STARTS" . How to code it with pine script?
    Thanks in advance👍

  • @mryes8184
    @mryes8184 3 года назад

    Simple and amazing video.
    But how to code to close position at end of the day?

  • @mysticmoose
    @mysticmoose 3 года назад

    Thanks chief

  • @vinitpatil7930
    @vinitpatil7930 3 года назад +1

    Hey dennis, first of all.. Thanks for this great video ! I was wondering if this pine coding gives signal in realtime or just used for backtesting

  • @dionpetrig8972
    @dionpetrig8972 4 года назад

    awesome, thanks!!!

  • @HardstyleTrancer
    @HardstyleTrancer 4 года назад +1

    Hi, i would like to know how to do this transactions in real time with the paper account and viewing each one trade on the label of the paper trading? Do you know how to do this?
    Thank you

    • @SirGalahadXs
      @SirGalahadXs 4 года назад

      Paper trading and strategy testing are 2 completely different functions.

  • @AndryRazafindrazaka
    @AndryRazafindrazaka 4 года назад

    Thank you Bro!

  • @sakaragarwal6296
    @sakaragarwal6296 4 года назад

    please create more strategy testing videos, and kindly advise from where I can learn pine script, Thanks !

  • @parthapratim004
    @parthapratim004 3 года назад

    ❤️❤️

  • @smallinvestor9896
    @smallinvestor9896 4 года назад +1

    i want to do algo trading from the strategy which i build in trading view ........how should i do....

  • @leoosorio9988
    @leoosorio9988 4 года назад

    Greetings brother, very grateful for sharing your knowledge with the rest of us ... I confess that I have only been getting to know pine, but I have stalled in one detail and it is frustrating me not being able to continue ... I need to do a kind of trigger ... imagine an indicator that reached a value x, and returned ... an rsi for example, reached level 70 and returned, but I am interested in maintaining that record, something like SignalSale = 1 if rsi exceeds level 70 and that when it falls below 70 the value of SignalSale remains = 1 ... I would greatly appreciate some guidance

    • @elvarwinston
      @elvarwinston 3 года назад

      How is it going 1 year later? are you still into pine script and has it added value to your trading? i am a beginner and i have been learning for 1 week now

  • @onkarshinde4424
    @onkarshinde4424 3 года назад +1

    Sir, I want to code for a candlestick color i.e. if candle's real body is less than 50% of entire range/body of candle then that candle's color should be blue
    Plz help me to do it.

  • @ANewWorldVision
    @ANewWorldVision 4 года назад +3

    the trades arnt showing cause you set the dates to 2015 to 2019 and you are zoomed into 2013..

  • @devanshxarora
    @devanshxarora 3 года назад

    Broker: you wanna buy or sell ?
    Trading view code : yes

  • @Shauryaz2324
    @Shauryaz2324 3 года назад

    Hi Dennis .. thanks a ton for this information. I have one question I have created my code and wants to show sell alert when candle closes below emi .. and buy alert when candle closes crossing ema line. Please please help

  • @christopherguipo
    @christopherguipo 4 года назад

    Thanks

  • @gaslimit5703
    @gaslimit5703 3 года назад

    Nice sir, but how to code base on % profit taking i mean, how to create strategy using 1 risk 2 reward and money management too

  • @dasundesilva5588
    @dasundesilva5588 4 года назад

    why use closeshort for closing long position and vise versa?

  • @jamilmughal8591
    @jamilmughal8591 2 года назад

    hi, your work is smart. is it possible to copy and paste the script in here?

  • @nosskopajtas
    @nosskopajtas 3 года назад

    written:
    Line 13 if time >= start and time

  • @LSC29Dec12
    @LSC29Dec12 2 месяца назад

    Hi Dennis. Thanks for this. I already have script written by a developer but I cannot work out how to use the script to backtest on BTC, ETH, SOL, BCH, BNB, etc. Please could you help?

  • @whimsythecrypto-hippy-wolf1900
    @whimsythecrypto-hippy-wolf1900 Год назад +1

    what versoin of pine editor are you using? ema is giving me an error. ta.ema instead?

    • @kevin.licenji
      @kevin.licenji Год назад

      if you use version 5 it is ta.ema, in version 4 it is ema.

  • @simonhuber6859
    @simonhuber6859 7 месяцев назад

    Are you on the highest tier subscription of TV? Because me it only lets do like 4 monhts back.

  • @AhmedVlogs1
    @AhmedVlogs1 4 года назад

    How do i calculate a particular candles high/low example 5th candle ? of a particular session

  • @kkainkarthikeyan
    @kkainkarthikeyan Год назад

    But SPX is only options. Mostly 0DTE expiry. Any idea on how to implement that?

  • @sunilm2326
    @sunilm2326 3 года назад

    It's a good feature but i somehow find this not well controlled, like you cannot backtest of the close condition happens at candle close or at the highest profit or exactly at a percentage profit

  • @darkevil3935
    @darkevil3935 3 года назад

    Hi, i try to make a crossing ema strattegy, but i want to buy and sell just exactlly when the crossing ema happen, not in the open or close of the candle. It is anny way to calculate at real time, like( calc_on_every_tick ) the value of each ema and place the order exactlly when the crossing ema happen? Also i want to make it possible to view it and prove it on simulated strategy. Please help me. Thanks.

  • @figuredoutfitness8154
    @figuredoutfitness8154 2 года назад

    Can you suggest me how to backtest a single moving average accuracy on list of stocks in tradingview

  • @pcas9
    @pcas9 3 года назад

    Dennis Hi,
    Really great content and thanks for posting,
    I keep getting this error (Add to Chart operation failed, reason: Could not find function or function reference hma)
    I tried changing the reference to ema like yours but still get the error?
    I will take it up with tradingview but I thought I'd give it a shot in this forum.
    Any help would be so awesome and thanks!
    Paul

  • @swapnilpatil2445
    @swapnilpatil2445 4 года назад

    Hello sir, how to plot horizontal line at the high-low of particular bar_indexes for real time data....Thanks in advance👍

  • @attilin
    @attilin 3 года назад

    Great video ! Can you help me as I cannot ADD TO THE CHART the strategy as i don’t have “ADD TO CHART” ( between “Save”and “Public Script”) ? Thanks a t
    Lot 🙏🏻

    • @rohi288
      @rohi288 3 года назад

      Check the pine at the bottom of tv

  • @tommyharris5817
    @tommyharris5817 3 года назад

    What do you type or omit if you do not want to go short?

  • @Nifty1976
    @Nifty1976 3 года назад

    Hello I have no experience of coding in pine. I want to test a strategy where long condition is go long if the highest of the last three candles is crossed and go short if the lowest of the last three candle is crossed. Tine= 1 hourly chart

  • @COW879
    @COW879 4 года назад +26

    Moo

  • @TheGangsterRH
    @TheGangsterRH 4 года назад

    Great!
    But was this video in a lower resolution than expected or is it just me?

  • @jurytotis9266
    @jurytotis9266 3 года назад +1

    does anyone know how I can enter a trade, hold it for 1 candle (the candle when it entered) and close at the end of that very same candle

  • @serkanayzit8485
    @serkanayzit8485 3 года назад

    hi, the last order was still open. how can we close all position at the last trade? thanks.