Pine Script: A two-target MACD Strategy

Поділитися
Вставка
  • Опубліковано 27 лис 2024

КОМЕНТАРІ • 82

  • @srinivastangella
    @srinivastangella 4 місяці тому +2

    God will be pleased by and bless people like you, for sharing knowledge helping people.
    I am a programmer and automation engineer too with 25yrs of experience ! I know how it feels like gong thru each line of code like and explaining the learners. Immense satisfaction ! Keep it up . God bless you

  • @nouirimohammedelmehdi6642
    @nouirimohammedelmehdi6642 Рік тому

    theres no one out there teaching us like u do , much respect and love

  • @holygl
    @holygl 2 роки тому +10

    Great video-thank you for taking the time to put this together! You are a gifted communicator and programmer.

  • @TheArtOfTrading
    @TheArtOfTrading  2 роки тому +6

    LESSON SOURCE CODE: courses.theartoftrading.com/pages/macd-strategy-2-profit-targets-in-pine-script
    NICK RADGE'S TRADING BOOK: amzn.to/3B1dtPs
    MY ZEN LIBRARY SCRIPT: www.tradingview.com/script/yUWPxUBt-ZenLibrary/?offer_id=10&aff_id=15271
    MY AUTOVIEW SERIES: ua-cam.com/video/MZvgqJaaSNs/v-deo.html&ab_channel=TheArtofTrading
    MY BAR MAGNIFIER VIDEO: ua-cam.com/video/5UzXzewiFKQ/v-deo.html&ab_channel=TheArtofTrading

    • @dmitriys4279
      @dmitriys4279 Рік тому

      the code doesn't work, and the strategy doesn't put any orders or plot any graph. I removed everything related to forex, but it doesn't help...

    • @dmitriys4279
      @dmitriys4279 Рік тому

      Anyway, you do a great job and I very much appreciate your efforts. Thanks a lot :)

  • @expeditocedeno7538
    @expeditocedeno7538 Рік тому

    Dear Matthew Amazing video as always. I'm very happy for knowing your channel, nowadays in youtube there a lot of channels where the youtubers claim to be top or pro traders and when you watch their videos they lack essence, profundity, and specially they lack commitment, discipline rigurosity and knowledge, nevertheless they speak like experts. Thank you for all your videos, thank you so much for you discipline, your rigurosity and for share your knowledge, I'm new in this amazing trading world and your videos about pinescript are helping me a lot really a lot in my road to be a successful trader. Please keep going.

  • @TraderRick
    @TraderRick 2 роки тому +1

    I appreciate the professionalism with which you present your videos. Thank you for all the great content you have shared.

  • @theoargy8428
    @theoargy8428 2 роки тому +1

    Great video Mathew. I’m also a lifetime member of your Pine Script Mastery Course. Thanks for all you great content. We appreciate it.

  • @jouellette899
    @jouellette899 2 роки тому

    Thank you so much for your content! me and my discord group started trading a few months back and the amount of knowledge ive crammed into my brain has been unbelievable. I took it upon myself to start learning pinescript (scripting my own indicators that make sense to me/ help me understand how and why they work) and ive been making substantial gains thanks to your examples. Your course is on my list of things to get done, hopefully this winter season i will be able to polish my knowledge using ur course.
    I really like how u basically debunked that Trading Rush video, i use the MACD, 8 different EMA's (long explanation), and an elliot wave, once in awhile RSI. If you could script or make a video on the elliot wave i would be SUPER thankful. Keep up the good work!!

  • @donyxd3365
    @donyxd3365 2 роки тому

    Wow, loved the analyzing part it was full of tips especially how a coin behave differently when it becomes a blue chip and vise versa
    Keep these tips coming on the future, Thank you!!!

  • @dustinyt5223
    @dustinyt5223 2 роки тому

    Learned lots on my journey as a quant trader.

  • @GreyFox474
    @GreyFox474 7 місяців тому

    I just realized I really don't like loosely typed languages. :D
    Anyways, thank you for this wonderful Introduction to pine script. This single video might actually contain everything I need to implement my own strategy.

  • @JustMe-ro1be
    @JustMe-ro1be 2 роки тому +1

    Great video, really happy to see more strategy videos, these are by far my most watched ones to learn. Not for the strategy themselves but just to learn from. Would love to see a little video on user commissions and how that's setup. Also a video on OBV divergance would be great! Thanks

  • @stephenasiedu76
    @stephenasiedu76 2 роки тому +1

    Very nice strategy .Please can you add an alert feature when the blue line crosses the orange above or below .I think this would help to manually enter the market and reduce sl

  • @norbi3legs
    @norbi3legs 2 роки тому

    Awesome video, as always. Greetings from South America.

  • @quanla9569
    @quanla9569 5 місяців тому

    Thanks for the lesson. Its really helpful for beginner like me

  • @trident777
    @trident777 2 роки тому +1

    Hi, The link to source code download isn't working. I spent a few hours going through the video and inputting the code. I changed "strategy.position_size" in two places but there are no trades from 29th Aug.
    I look forward to doing your paid Pine Script Mastery Course soon. Thanks, jack

  • @davidgalea430
    @davidgalea430 Рік тому

    excellant video explanation. I am new to Tradingview and keen to learn pinescript

  • @estebangonzalez7036
    @estebangonzalez7036 2 роки тому

    I prefer the sound of da-ta than of day-ta!
    I'm Colombian btw :)

  • @forexmilitia357
    @forexmilitia357 2 роки тому

    TY Matt the tradeFilter was very helpful in a script I'm writing

  • @Henry-zw2ys
    @Henry-zw2ys 2 роки тому

    Excellent video for us coders. And howzit from SA!

  • @jesseloxton3397
    @jesseloxton3397 2 роки тому +1

    Do you know of a MACD or any other system in Tradingview for trading the top 100 stocks in Nasdaq on daily charts? I have tried adding many of the current Pinescript systems available in Tradingview for trading eg MSFT or TSLA without success. Lovely to hear the Aussie accent!!

  • @richannforonda3847
    @richannforonda3847 2 роки тому

    ntx so much ur a great teacher mate keep it up cnt wait for your breakout strategy coding lesson

  • @deva8496
    @deva8496 Рік тому

    checking for na sounds very good logic. How about checking for date? ex 'if days since first bar >= 200 (input variable) ? I think this will improve performance. Because, we don't have to do calculations at all untill the bar reaches minimum bars.

  • @trident777
    @trident777 2 роки тому

    Thank you, greetings from Brisbane.

  • @inLOVEwithPK
    @inLOVEwithPK 2 роки тому +2

    Hey man, great video! I love your pine script tutorials. Do you think you could maybe make a video about pivot points in pine? I've been using a strategy where price action interacts with PP levels for 3 years now, with solid results. I would love it if I could actually make an indicator/strategy out of it.

  • @chidinduuwaeziozi7360
    @chidinduuwaeziozi7360 Рік тому

    Thanks for the videos, please.
    Going through this, I wonder why the test for a long signal is a cross down instead of a cross up

  • @LithgowPanther
    @LithgowPanther 2 роки тому

    Outstanding tutorial, thank you

  • @donyxd3365
    @donyxd3365 2 роки тому +1

    can you make a youtube video about a complete list of things that i have to go through in order to make sure results are correct and most likely going to produce same results at live trading

  • @VervBav
    @VervBav Рік тому

    First of all, thank you for ur great explanatory videos, i love watching them and learning all along; but i have one question:... u have for a long condition: 'longSignal = longConditions and upTrend and crossDown'. but shouldnt it be a crossUp ? grtz

  • @FinTra_
    @FinTra_ Рік тому

    Did a strategy test with a simple entry strategy and complex risk management and exit strategies. What would constitue a good outcome.
    Is 200% return on a 45min time frame with 1.7 win to loss ratio and 38% win rate a good strategy?
    Seems to be awesome around 15 min and 45 min.

  • @cdh32488
    @cdh32488 Рік тому

    Love the channel and content. Question on profit targets and stop losses though. If your stop loss is hit on "Long Exit #1" or "Short Exit #1" why would you only want to take 25% of your position and not 100%? Is there a way to exit the entire position if the stop loss is hit on the first exit? If the trade is bad, I feel like you would want to exit the entire position rather than a small percentage.

  • @SSNandaKrishnan
    @SSNandaKrishnan 2 роки тому

    Thanks for this great video. I am new to Pine script, I just tried to apply this strategy to Indian Market (NSE NIFTY) but it is not work. please HELP. Thanks.

  • @LongTu167
    @LongTu167 Рік тому

    Amazing video, thank you very much Matthew!!!

  • @jonrooten
    @jonrooten 2 роки тому

    Great video, I have learned a lot in the short time I have been subbed. I wonder if you might consider making a video on this strategy with a single target and trailing stop loss. Thanks again

  • @jschong812
    @jschong812 Рік тому

    I don't have "Bar Mangifier" feature on my tradingview platform, can I apply your method/prinescript?

  • @jleoarsenault6107
    @jleoarsenault6107 2 роки тому

    Great work. Question how does contact you for work developing an indicator ? Looks for supply and demand that is auto onto trading view based diff time frames. Thanks

  • @frederickswartz5508
    @frederickswartz5508 8 місяців тому

    I need a line of code that states to enter a trade when macd and signal cross @ 1 for Long -1 for Short with the exit to be reflective upon that - so the exit would be as close to -1 for the final TP but say TP1 is at 0.

  • @alariclau
    @alariclau Рік тому

    Great teaching, though it is more in-depth that i can handle. May I ask if you actually use Tradingview to fully automate real account trading using your scripts?

  • @Dougie1664
    @Dougie1664 2 роки тому

    Great video, have you looked into the FTMO?, your pineconnector tutorials has helped immensely as they don't have TV charts how would you factor there slippage and commissions? thanks

  • @petercarpenter1827
    @petercarpenter1827 Рік тому

    hi thankyou. finding your videos very helpful and informative. i copied your code into my tradingview. but the MACD Cross strategy only shows as a line. not as it shows in your TV. cant show you a screenshot in this i think. any thoughts. its a red or green line depending

  • @sherkhan-ks2qj
    @sherkhan-ks2qj 2 роки тому

    Sir i have a question related to pine script alert.
    I saw your video of multiple conditions alert.
    My question is that , if i am using 2 indicators,
    1) is it must that both the indicators should give the signals at a same time ?!!!!!
    Or
    1 indicator has give signal and the second one give signal after 5 minutes so why the alert doesn't work ?!

  • @kevinh5856
    @kevinh5856 Рік тому

    Thanks for sharing! Would you also be able to share how to add alerts?

  • @JustMe-ro1be
    @JustMe-ro1be 2 роки тому

    Quick question regarding the exiting via the stop loss, when it closes a position, im getting 2 closes per stop loss hit - the 25% close and the 100% close of the remainder. Is there a way to just have it so it closes 100% in one go if the stop loss hits and target 1 has not been reached? Just thinking because this massively changes the strategy results i.e fees, number of trades, average profit per trade, win% etc... etc...Hope that makes sense, Thanks

  • @betoperalta701
    @betoperalta701 2 роки тому

    you could've wrote "if strategy.position_size != strategy.position_size[1]" this is how I detect change in the pos size for stops or limits

  • @irtrading1012
    @irtrading1012 2 роки тому

    quick question, how we can simulate in position function in indicators?

  • @bangkokskater
    @bangkokskater 2 роки тому

    how can we prevent curve fitting/ pineScript has limited sample size problem... even with Deep Backtesting

  • @belatorok5630
    @belatorok5630 2 роки тому

    None of the known strategy works, when price movements are are low for a long time, so how do you detect the big movements and their directions before they happen ? The real performance of a strategy is how it performs in a low volatility time period, this is my experience.

  • @explorster
    @explorster 2 роки тому +1

    Great Dada bro. Love the videos 📹

  • @ptahX
    @ptahX 2 роки тому

    Question / Idea: How do we code the distance above or below a moving average? love the videos by the way - very cool!

  • @manta_r4y249
    @manta_r4y249 2 роки тому

    much appreciate your work

  • @Felony_Finance
    @Felony_Finance 2 роки тому

    I've been wanting to code something like this with TTM squeeze built in there as well. Do you think that is possible if I join the class?

  • @frederickswartz5508
    @frederickswartz5508 8 місяців тому

    I know this video is applied to forex. I'm trying to back engineer it for what I envision for Options trading. Can you point me in the right direction?

  • @drorpahima6413
    @drorpahima6413 Рік тому

    Great lesson

  • @PillsOfSafety
    @PillsOfSafety Рік тому

    Hi Dude! great video. I managed to track the code in TradingView, however, I´m stuck with the "+=", it alerts a syntax error. somebody could help me with this!? . it's only used twice in the entire code :S

  • @lapogk1543
    @lapogk1543 Рік тому

    great video. thanks.

  • @AlexPositron
    @AlexPositron 2 роки тому

    Awesome video! Could you please make a lesson about trailing stop loss?

  • @patrickrudolph9904
    @patrickrudolph9904 Рік тому

    hey man... wasssup? my names patrick... busy dabbling in learning pinescrip0t from you... very helpful... much appreciated... ok so i have an interesting piece of script for an indicator that i want to adapt into a strategy and backtest... my question is how can i send you a copy of the script for you to have a look at? pls and thanks... and much respect

  • @roystoncartwright5640
    @roystoncartwright5640 8 місяців тому

    thank you this was great 😊

  • @irtrading1012
    @irtrading1012 2 роки тому

    great content as always can you do a video about detecting divergences, thanks

  • @scottieontherocks
    @scottieontherocks 2 роки тому

    Many thanks for your very informative videos. I've coded a bot in Tradingview that enjoys -- according to my strategy tester -- a profit factor of 5.6 and is 54% profitable on a one-minute time frame. I have been paper trading it on BTCUSD in Tradingview but would like to apply it to a crypto brokerage such as Binance. Unfortunately, I can't figure out how this is done. Is there a fairly simple, straightforward way to do this and I just haven't found it yet? Or is it as complicated as I think it is? And finally, is it even possible? Thanks for whatever guidance you choose to provide. Much appreciated.

  • @abhiranjankumar2679
    @abhiranjankumar2679 2 роки тому

    Very good job

  • @evaltools
    @evaltools 11 місяців тому

    Excellence! Thank you.

  • @romaincortes3040
    @romaincortes3040 2 роки тому

    Matt... I'm desperate :D ! I am trying to find some one online who could code my strategy but it seems difficult.... I identify patterns on MACD histo with a couple other indicator. When I ask to coders if they do it?! it is always a... out of my expertise !
    Would you now a solution for me ?

    • @romaincortes3040
      @romaincortes3040 2 роки тому

      it seems like they have issues with the Macd histo (3 coders)
      cheers

  • @johanekman6273
    @johanekman6273 2 роки тому

    Hello Matthew. Great video. You inspired me to learn Pine and it has been a real joy. I wanted to ask you. I have a strategy that trade DAX futures on 15min timeframe.
    Due to this im only able to simulate trades over a timespan of about half a year. Total amount of closed trades is only 50. however the other statistics looks really promising, high net profit and winrate aswell as low total drawdown. Any thoughts or advice?

    • @eggchen18
      @eggchen18 Рік тому

      Have you tried a free trial for Tradingview premium? You get 4x as many historical bars available.

  • @kingmonk44
    @kingmonk44 Рік тому

    thx

  • @bennybabylon43
    @bennybabylon43 2 роки тому

    The link for the source code doesn’t work 🥺

  • @cem6352
    @cem6352 2 роки тому

    Thanks

  • @gavajoterx49
    @gavajoterx49 Рік тому

    my real question is, why do I have to learn coding in order to be able to backtest some simple strategies?
    Why nobody built a software where lazy people like me can just fill in the parameters and then get the results?

  • @gianlucaverzichelli1981
    @gianlucaverzichelli1981 2 роки тому

    the link to the cose appers to be broken

  • @michaelderoche6126
    @michaelderoche6126 2 роки тому

    Keep up the great work and pronounce "data" any damn way you want!

  • @SuperLuckyLad
    @SuperLuckyLad 2 роки тому

    It works on all timeframes and markets ... it just doesn't make any profits ... lol

  • @ChaoticNeutralMatt
    @ChaoticNeutralMatt Рік тому

    Pfft. Data and data are both correct.

  • @ChristopherWheatley
    @ChristopherWheatley 11 місяців тому

    It would be helpful if you would catch your breath and take pauses in your speech delivery. You breathe while you are saying something and it is very annoying and distracting at times. Also take some pauses so you don't swallow so hard as your swallowing of saliva is distracting. You have good content but this really takes away.

  • @3702251a
    @3702251a Рік тому

    Ever wondered why people making videos on trading? Because they all failed at trading.
    Those who Fail Teach.

  • @free-4-1
    @free-4-1 Рік тому

    Thanks