Pine Script Tutorial | Developing Real Trading Strategies On TradingView

  Рет қаралды 255,490

James Bachini

James Bachini

Күн бұрын

Пікірлер: 377
@EarlWallaceNYC
@EarlWallaceNYC Жыл бұрын
As an experienced python programmer, this format and pace was just right for me. Many Thanks.
@vinybaba493
@vinybaba493 Жыл бұрын
I am not from a coding background(wanna be), but the way you explained everything is really good. Thanks.
@kevin.licenji
@kevin.licenji Жыл бұрын
Hey Viny, if you're still interested in Pinescript, I wanted to let you know about a software I've created that automates the backtesting of strategies in thousands of different scenarios. Once you input your strategy into the software, it tests it on dozens of different assets and timeframes to see where it performs best. So, with just one command, you can backtest your strategy not only on one pair or commodity, but on dozens of them, including stocks, cryptocurrencies, and more. But the best part is that the software can also change the variables in your script. For example, it can find the perfect value for your stop loss and take profit in different scenarios or try dozens of different values for moving averages, MACD, RSI, ATR, Bollinger Bands, or any indicator you're using. The results are incredible because with just one command, you get thousands of different combinations for your strategy without having to do anything. And it's 100% safe that you'll find a setting that performs better than the one you were using by default. Why? Because every strategy can be fine-tuned by trying better values for the indicators, or because it's a strategy that doesn't work well on the asset you're using but performs great on another one, or it performs better on a different timeframe than the one you usually use. I'm also subscribed to TradingView's Premium plan, which allows me to backtest with all the data available on the platform, going back 50 years for daily candles and 22 years for 30-minute candles. If you want to check it out, I invite you to visit my Fiverr page. As I found you, I'll give you the first round for free, where I'll provide you with the results of your strategy in 100 different scenarios, and you'll immediately see how powerful it is. I always deliver a file with the raw data table and an Excel file with graphs and filters to quickly find the most performing strategies among the thousands tested. You can find me on Fiverr by searching for "I will automate thousands of backtests." If you see more than one person, look for the one with the username "codingtrading." Feel free to message me there, even just to give me your thoughts, as I'm new to the platform. Thanks a lot!
@DIYerGirl
@DIYerGirl Жыл бұрын
I just discovered your video, and it was very easy to understand. It was well-organized and clearly explained. I'm new to Pine scripting. so I'm saving this to my playlist. Thanks!
@AlvinEvangelista
@AlvinEvangelista 3 жыл бұрын
Excellent crash course, answered pretty much all the questions I had from other Pine Script videos. Thanks for the detailed info.
@JamesBachini
@JamesBachini 3 жыл бұрын
Thank you
@aldolabuonora
@aldolabuonora 2 жыл бұрын
@@JamesBachini hi James, excellent video!! I m looking for someone who developes some strategies in trading view. Do you work for clients?
@JamesBachini
@JamesBachini 2 жыл бұрын
@@aldolabuonora I don't sorry. Might find someone upwork or freelancer if you search for pinescript. Alternatively there's a big public library you can use to search for a similarish strategy and try and contact the author who will understand it.
@rohitkashyapx
@rohitkashyapx 3 жыл бұрын
Amazing! Thank you so much for the video. An extremely underrated channel in my opinion
@bree3073
@bree3073 3 жыл бұрын
Excellent is the best word for this... now I learned pine script in about ten minutes....great job! Very interesting the last minutes how to create a javascript file for advanced doing...I ll read all on your site!
@hksoros
@hksoros Жыл бұрын
mad respect for you james, this is the best, right to the point pinescript tutorial i need!
@sundancer06
@sundancer06 2 жыл бұрын
i cant believe you gave us a treasure..thank you so much
@sebastianllosa12
@sebastianllosa12 2 жыл бұрын
This is the first time I give a like, subscribe and leave a comment in a video, but this kind of information certainly deserves it. Truly amazing content!!! Thank you and keep up with the good work!
@kevin.licenji
@kevin.licenji Жыл бұрын
Hey man, if you're still interested in Pinescript, I wanted to let you know about a software I've created that automates the backtesting of strategies in thousands of different scenarios. Once you input your strategy into the software, it tests it on dozens of different assets and timeframes to see where it performs best. So, with just one command, you can backtest your strategy not only on one pair or commodity, but on dozens of them, including stocks, cryptocurrencies, and more. But the best part is that the software can also change the variables in your script. For example, it can find the perfect value for your stop loss and take profit in different scenarios or try dozens of different values for moving averages, MACD, RSI, ATR, Bollinger Bands, or any indicator you're using. The results are incredible because with just one command, you get thousands of different combinations for your strategy without having to do anything. And it's 100% safe that you'll find a setting that performs better than the one you were using by default. Why? Because every strategy can be fine-tuned by trying better values for the indicators, or because it's a strategy that doesn't work well on the asset you're using but performs great on another one, or it performs better on a different timeframe than the one you usually use. I'm also subscribed to TradingView's Premium plan, which allows me to backtest with all the data available on the platform, going back 50 years for daily candles and 22 years for 30-minute candles. If you want to check it out, I invite you to visit my Fiverr page. As I found you, I'll give you the first round for free, where I'll provide you with the results of your strategy in 100 different scenarios, and you'll immediately see how powerful it is. I always deliver a file with the raw data table and an Excel file with graphs and filters to quickly find the most performing strategies among the thousands tested. You can find me on Fiverr by searching for "I will automate thousands of backtests." If you see more than one person, look for the one with the username "codingtrading." Feel free to message me there, even just to give me your thoughts, as I'm new to the platform. Thanks a lot!
@hypercub3
@hypercub3 3 жыл бұрын
What a helpful video! I was able to completely create my strategy with the help of your video. Thanks from Korea.
@JamesBachini
@JamesBachini 3 жыл бұрын
Awesome, hope it's profitable for you 👍
@Fahad-jh1zw
@Fahad-jh1zw 3 жыл бұрын
best pine script explanation
@ibrahimcelebi1366
@ibrahimcelebi1366 2 жыл бұрын
super genuine information in short time ! thankxx
@curiouskittycat5977
@curiouskittycat5977 7 ай бұрын
Awesome video. The chop is the problem. How to recognize it programmatically and switch strategy or at least stop trading is the question. Thank you for sharing your knowledge. excited to check out your other videos.
@JamesBachini
@JamesBachini 7 ай бұрын
Recognising what stage the market is in and adjusting focus on mean reversion strategies in choppy conditions and trend following strategies when there is momentum. Things like volatility indexes and distance from long term moving averages can help alongside market sentiment checks.
@mladenpavla
@mladenpavla 3 жыл бұрын
Thanks James, no doubt this channel will grow!!!
@RaghavaIndra
@RaghavaIndra Жыл бұрын
Amazing explanation of pine scripting concept. Thanks a lot.
@javidafkar
@javidafkar 3 жыл бұрын
Excellent. Thanks for the detailed info.
@mirrorcube3709
@mirrorcube3709 3 жыл бұрын
excellent and concise info. thank you
@KamalSingh
@KamalSingh 3 жыл бұрын
Good tutorial at the right pace and details!
@kevin.licenji
@kevin.licenji Жыл бұрын
Hey man, if you're interested in Pinescript, I wanted to let you know about a software I've created that automates the backtesting of strategies in thousands of different scenarios. Once you input your strategy into the software, it tests it on dozens of different assets and timeframes to see where it performs best. So, with just one command, you can backtest your strategy not only on one pair or commodity, but on dozens of them, including stocks, cryptocurrencies, and more. But the best part is that the software can also change the variables in your script. For example, it can find the perfect value for your stop loss and take profit in different scenarios or try dozens of different values for moving averages, MACD, RSI, ATR, Bollinger Bands, or any indicator you're using. The results are incredible because with just one command, you get thousands of different combinations for your strategy without having to do anything. And it's 100% safe that you'll find a setting that performs better than the one you were using by default. Why? Because every strategy can be fine-tuned by trying better values for the indicators, or because it's a strategy that doesn't work well on the asset you're using but performs great on another one, or it performs better on a different timeframe than the one you usually use. I'm also subscribed to TradingView's Premium plan, which allows me to backtest with all the data available on the platform, going back 50 years for daily candles and 22 years for 30-minute candles. If you want to check it out, I invite you to visit my Fiverr page. As I found you, I'll give you the first round for free, where I'll provide you with the results of your strategy in 100 different scenarios, and you'll immediately see how powerful it is. I always deliver a file with the raw data table and an Excel file with graphs and filters to quickly find the most performing strategies among the thousands tested. You can find me on Fiverr by searching for "I will automate thousands of backtests." If you see more than one person, look for the one with the username "codingtrading." Feel free to message me there, even just to give me your thoughts, as I'm new to the platform. Thanks a lot!
@alexp7274
@alexp7274 10 ай бұрын
Nice video. 5:12 I suggest to re-edit this part to take out FTX
@JamesBachini
@JamesBachini 10 ай бұрын
Good point, if only it was possible to edit KZbin vids)
@marci1964
@marci1964 2 жыл бұрын
Brilliant video - thanks!
@cmzshalom
@cmzshalom 3 жыл бұрын
Subscribed. Liked. And thank you! First video I watched as a total beginner and it really gave the overview I was looking for exactly. Many thanks 🙏
@mataloha
@mataloha Жыл бұрын
this is a good and simple explanation
@matiaswoiciechowski9356
@matiaswoiciechowski9356 2 жыл бұрын
Man you are A W E S O M E thank you so much for this
@trader8880
@trader8880 3 жыл бұрын
This really helped reduce the learning curve
@arcdisney
@arcdisney Жыл бұрын
thank you the knowledge is very helpful for beginners like me
@SeasonedDev
@SeasonedDev 3 жыл бұрын
Hi James, I like this video, keep doing your great job
@LightchaserG
@LightchaserG 2 жыл бұрын
Thank you, James, appreciate the share and learnings. Keep it up, really good the way you explain.
@yoonesgholamy6417
@yoonesgholamy6417 3 жыл бұрын
I like this tutorial , great job
@neilwu4781
@neilwu4781 Жыл бұрын
Great video! Thanks James.
@nws4714
@nws4714 3 жыл бұрын
super helpful video! thank you so much!
@derrickchow4019
@derrickchow4019 29 күн бұрын
Hi, pls advise how to write "forecast" pine on tradingview. Thanks
@rbbtllc1146
@rbbtllc1146 3 жыл бұрын
WOW and thank you!!!
@arjundhaigude9579
@arjundhaigude9579 10 ай бұрын
thanks for sharing valuable information. I need to develop pine script for session volume profile strategy, can you please guide me. Thanks.
@JamesBachini
@JamesBachini 10 ай бұрын
Start with the docs you can pull volume data and then start to work with it to develop your strategy
@adithya-elearning
@adithya-elearning Ай бұрын
Do you help to create one single indicator combination of 6 indicators
@bayfundamental
@bayfundamental 2 жыл бұрын
Hey James, where do you run your nodes? On your pc 7/24 or any cloud server to advice?
@JamesBachini
@JamesBachini 2 жыл бұрын
I generally start with them running locally because I'm breaking/tweaking things constantly and then once they are fairly stable I'll migrate them to a secure environment.
@khumofx1838
@khumofx1838 2 жыл бұрын
Hi James, thank you for the awesome content you put together. much respect for the way you presented and how all the concept you delivering come together at the end. Screen visual was not so good though, i hope you take it well for improvement. Overall, brilliant video. Thanks once again.
@naqijamal9933
@naqijamal9933 Жыл бұрын
Thank you!
@gillyOO7
@gillyOO7 5 ай бұрын
Chat GPT does pinescript real well. Was looking at using capitalize AI strategys
@theslayer962
@theslayer962 Ай бұрын
Hell yeah dude I just made one
@Personwithquestions
@Personwithquestions Ай бұрын
They keep giving me errors.
@dabbopabblo
@dabbopabblo 3 жыл бұрын
this has been very helpful, only thing I gotta say is maybe turn the white balance down cause it looks like you have a tanning and albino filter on at the same time
@JamesBachini
@JamesBachini 3 жыл бұрын
Lol thanks ☺️
@hanialadmaai5596
@hanialadmaai5596 2 жыл бұрын
Thank you for the great video. However, I faced an issue at the beginning as I got an error "line 5: Could not find function or function reference 'study'."
@JamesBachini
@JamesBachini 2 жыл бұрын
Try upgrading the code to v5 www.tradingview.com/pine-script-docs/en/v5/migration_guides/To_Pine_version_5.html
@GlynisDance
@GlynisDance 2 жыл бұрын
Your videos really are very helpful - thank you! :)
@HereIsmarcus
@HereIsmarcus 3 жыл бұрын
Great intro. Thanks so much. I have experience with javascript , java , C , VB -What language do yo recommend I learn to code a forex bot connected to Pepperstone for example ?
@JamesBachini
@JamesBachini 3 жыл бұрын
I'm not familiar with Pepperstone but check the API and see what wrappers they have. Probably NodeJS using JavaScript would be a good choice as a simple scripting language. That's what I use so probably have a bias here. If you are doing very low time frame quant stuff where speed is essential then there might be some benefit to using C. Only other factor would be if you are looking at doing a lot of machine learning work in which python is normally the weapon of choice. Probably overcomplicating a simple question. My general recommendation would be JavaScript using NodeJS. Can run it locally to start with and then migrate to a server or microservice for production.
@HereIsmarcus
@HereIsmarcus 3 жыл бұрын
@@JamesBachini Thankyou. That's very helpful.
@NK-lp2bj
@NK-lp2bj Жыл бұрын
Hi could you please create a video about hicknachi strategy code, need high time frame with green to red and red to green based long and short
@SAKOLPLY
@SAKOLPLY 2 жыл бұрын
It's very nice content , well explain
@gavirtualhustle6572
@gavirtualhustle6572 Ай бұрын
nice..how i can try to use this strat..thanks
@jimkoblick1776
@jimkoblick1776 3 жыл бұрын
Perfect Thanks !!
@Berghiker
@Berghiker 2 жыл бұрын
How do I change the stopLoss from percent to cents or ticks?
@JamesBachini
@JamesBachini 2 жыл бұрын
Set a variable for your entry and the check if the current price is $0.0x away from your entry
@deejaydaiel9181
@deejaydaiel9181 2 жыл бұрын
Great video! Could you please make an updated video for version 5?
@JamesBachini
@JamesBachini 2 жыл бұрын
Yes will do 👍
@rbbtllc1146
@rbbtllc1146 3 жыл бұрын
Have you been able to add sound alerts (beep) to your crossover points? Thank you
@JamesBachini
@JamesBachini 3 жыл бұрын
I haven't tried, but sounds like a fun script. I have notifications setup to the mobile app and that works well.
@heltontorrini33
@heltontorrini33 2 ай бұрын
Hey, good evening! I am from another country, very poor! I found it very exciting to watch this video and everything else! I couldn't understand 100%, and I would like to know if it's possible to get this script somehow?
@JamesBachini
@JamesBachini 2 ай бұрын
Link to code in the description
@kingali0011
@kingali0011 4 ай бұрын
Can you create ICT unicorn model strategy pine script
@Berghiker
@Berghiker Жыл бұрын
How do you plot the number of the length of the candle(low to high) above the candle?
@Berghiker
@Berghiker Жыл бұрын
I can't seem to get this right. Can it be done?
@stansuen8072
@stansuen8072 2 жыл бұрын
James, great video! Direct to the point, swift and not boring and useful! If we are to build our own server for live algo trading using python, which framework would you use? Backtrader, VectorQT...etc? (I am just a beginning willing to spend much time to learn. Just want to find the right direction to invest my learning hours)
@JamesBachini
@JamesBachini 2 жыл бұрын
If I was doing it I would just connect directly to the exchange api using rest or websockets. Each exchange is different but in crypto markets you can get data and post trades quite easily.
@shadabahamad1250
@shadabahamad1250 Жыл бұрын
@@JamesBachini (williams Fractals) tredingview indicator's convert the signals of this pinscript into a script that gives signals one minute in advance
@Berghiker
@Berghiker 2 жыл бұрын
How do I program it to sell after it made for example, 100 cents? My entry is after the moving average crosses over another MA.
@JamesBachini
@JamesBachini 2 жыл бұрын
Store the entry price in a variable and then check on each candle if price > entry +100
@Berghiker
@Berghiker 2 жыл бұрын
@@JamesBachini Thanks.
@JamesBachini
@JamesBachini 2 жыл бұрын
@@Berghiker here's some code that shows how to do stop losses and take profits. You can use this as a base and adjust it to whatever you need.
@aamersaeed1529
@aamersaeed1529 2 жыл бұрын
I want to check if 3,4,5 candles closed within the body of previous candle(this candle is slightly bigger than other candles)
@aamersaeed1529
@aamersaeed1529 2 жыл бұрын
I want to code dominant candle breakout into pinescript indicator but I am unable to do so.
@davidjulien236
@davidjulien236 Жыл бұрын
Awesome.
@memarket1675
@memarket1675 2 жыл бұрын
Can't see the code in phone screen it's too tiny. Please zoom on the code.
@ssjmnews9997
@ssjmnews9997 2 жыл бұрын
Nice video
@caruntualexandru
@caruntualexandru 3 жыл бұрын
nice work!
@mkjeffrey4355
@mkjeffrey4355 5 ай бұрын
Hi my name is Jeffrey Please I would like to know how to setup TLM trading view strategies
@DG10-youtube-channel
@DG10-youtube-channel 2 жыл бұрын
Hi James, many thanks for the lesson. One question can I using pine script monitor several symbols? Let's say I am looking 50 different assets: is there a way in pine script to get a alert for when any of those 50 papers cross a moving average for example... again many thanks
@JamesBachini
@JamesBachini 2 жыл бұрын
No the alerts are a bit intentionally awkward in my opinion. You would need to set one up every 3 months for each asset. I think there is a limit on the number of alerts you can have too based on your fee tier. I guess it's done this way to protect system resources but it makes it awkward to build out a custom screener/alert system like what you are after. I'd suggest if you want to do it get the data from somewhere else like Tiingo and set up a custom script with alerts on something like Twilio.
@qadir03232803023
@qadir03232803023 3 жыл бұрын
Great video bro.
@michelleauoxios7568
@michelleauoxios7568 3 жыл бұрын
Ωplus1 ④⑧⓪④④7①⓪03
@michelleauoxios7568
@michelleauoxios7568 3 жыл бұрын
Here, for more info hit channel in w@sp
@facepalmjesus1608
@facepalmjesus1608 Ай бұрын
i have created an indicator and turned it to strategy but when i load it to strategy tester it does not take any trades. i dont know how to proceed
@JamesBachini
@JamesBachini Ай бұрын
If you've tried it against multiple markets and timeframes I expect it's something to do with the condition where it opens the trade. Hard to advise more but you could probably put it into chatGPT and ask why isn't this taking any trades
@ameneh212
@ameneh212 Жыл бұрын
Thanks a lot!!
@jleoarsenault6107
@jleoarsenault6107 3 жыл бұрын
what is best time frame to you this code on?? Do you have any public that u can use on US stock market?? thanks great video
@JamesBachini
@JamesBachini 3 жыл бұрын
It really depends on the situation and volatility of the traded asset. In theory it will work with stocks but you may want to fit the moving average to the data and backtest each stock individually.
@dailyshorts8989
@dailyshorts8989 2 жыл бұрын
thank you for your effort, I have a question, How Can we convert mt4 or mt5 indicators or templates to Tradingview?? How we use them in tradingview??
@JamesBachini
@JamesBachini 2 жыл бұрын
I don't know of any automated way. Probably need to recode them
@dailyshorts8989
@dailyshorts8989 2 жыл бұрын
@@JamesBachini thank you for answer sir
@steveni4455
@steveni4455 2 ай бұрын
Can I combine MACD and EMA together with MACD overlay false and EMA overlay true?
@JamesBachini
@JamesBachini 2 ай бұрын
Sure, you can do conditional statements in piescript so something like If this and this { enter long }
@zacmason
@zacmason Ай бұрын
thanks for the tutorial. I'm new to this, and pasted your code into my Pine Editor, but when I tap 'Strategy Tester' I get a Caution message "This Strategy did not generate any orders throughout the testing range". I've checked every line but not sure why its not working for me. Would appreciate any tips on this :)
@JamesBachini
@JamesBachini Ай бұрын
Could you try it on a different market or timeframe?
@terranceroybal3222
@terranceroybal3222 26 күн бұрын
Can I depend on using pine script indicators or strategies from authors that is deemed it open source or not from tradingview such that if I trade real money with that it simply won't disappear one day; if not then how can I personallize the open source without trading view? Your thoughts please.
@JamesBachini
@JamesBachini 25 күн бұрын
You shouldn't be using them for actual trading. Useful for visualising and developing strategies but not suitable for execution in my opinion
@mikeabate3610
@mikeabate3610 Ай бұрын
Pine editor doesn’t recognize “sma” on my trading view for some odd reason
@batz9672
@batz9672 2 жыл бұрын
Hi James, how to remove the choppy signals, when the market is ranging? Thanks
@JamesBachini
@JamesBachini 2 жыл бұрын
Wait for a breakout 😉 When the market is ranging mean reversion strategies tend to work better than trend following. Usually volatility and trading volumes are lower too which makes it more difficult than upOnly market mode.
@sorooshd7895
@sorooshd7895 4 ай бұрын
thanks for the video James, I'm new to this and want to modify an existing indicator on Tradingview but not quite sure how to do it. Specifically, I want to use the existing Stochastic Momentum Index to get the same alerts on crossings of SMI & SMI-based EMA but add a condition to get those alerts only when crossing happens in the oversold or overbought region. Do you know how I can add this condition? Should the pine code be changed from indicator to study or strategy and rewritten or is there an easier way to modify it? thanks
@JamesBachini
@JamesBachini 4 ай бұрын
You could maybe use something simple like RSI to check if it's overbought or oversold and add a condition for that when popping the alert? Combine it with something like this www.google.com/amp/s/zenandtheartoftrading.com/pinescript/generate-trading-signals-with-rsi/%3famp
@sorooshd7895
@sorooshd7895 4 ай бұрын
@@JamesBachini thanks for the reply, I’ll check it out!
@lalitlkv07
@lalitlkv07 Жыл бұрын
Thanks 🙏
@chrisjones4512
@chrisjones4512 2 жыл бұрын
James is there anyway to set up an alert for all stocks that meet a specific crossover ? Example if apple 20 crosses the 100 ema then i would automatically get an alert. But i want if for all stocks this happen for not just one stock. Any idea? Thanks in advance this video was pure gold!
@JamesBachini
@JamesBachini 2 жыл бұрын
It's possible. Bad news is you need to set up each stock individually. There are a million and one prebuilt ma crossover strategies in the library. Choose one which includes an alert in the code and then set that alert up as an alarm for each market you want to trade.
@moneybin7416
@moneybin7416 2 жыл бұрын
Do i need math to automate my trading strategies in pinescript..some say you need to be good at math to be an algo trader..
@JamesBachini
@JamesBachini 2 жыл бұрын
I think it helps to be mathematically minded but its by no means a requirement. If you can find an edge and put it into code that's enough. Most of the strategies and indicators in the public library are pretty simple and I don't see a lot of high level maths that is incomprehensible.
@Itachi18244
@Itachi18244 2 жыл бұрын
Hi James, new to the channel & subscribed already. I am trying to replicate what you did to see performance during this years' bear market instead of asking you how it would fare :) Quick question though, as I went through your playlists and couldn't find much more on this particular subject. Have you continued to invest your time & efforts into scripts, is it a daily revenue driver for you? or maybe it was something interesting that you wanted to try out but did not capitilize? TIA
@JamesBachini
@JamesBachini 2 жыл бұрын
I think the strategy in the video was high time frame so not something that would consistently drive a daily income. I've never come across a system trade that consistently drives profit on a low time frame for more than a few weeks. Usually either market conditions change or someone else adjusts their algos and ltf strategies don't last long. It is useful as an indicator but essentially you are trend following and I would never be net short crypto so in a downward trend the strategy would be sitting out until the price gets back above the moving average. I don't use Pinescript for actual trading but it's good for visualising and systemising trading ideas. For trade execution I think working directly with the exchange APIs is better using whatever coding language you are most familiar with.
@joshuam2341
@joshuam2341 3 жыл бұрын
Thank you.
@ICARTEN
@ICARTEN 3 жыл бұрын
Awesome and clean explanation. Quick question, what code should i use to exit when a condition that involve last 7 candles stops being true? Thanks in advance and keep up the good content :)
@JamesBachini
@JamesBachini 3 жыл бұрын
Thank you! You can use something like strategy.close(all); which will close any open trades
@kaboliali1171
@kaboliali1171 2 жыл бұрын
"" Add to Chart operation failed, reason: Script could not be translated from: null "" I wrote the code at the bottom of the trading view script api I entered what is the cause of the error?
@JamesBachini
@JamesBachini 2 жыл бұрын
Hard to say without seeing the code. Perhaps try copying and pasting from the blog post or editing an indicator from the tradingview libraries to get started and familiar with it.
@deniz9974
@deniz9974 2 жыл бұрын
Great tutorial. How can we define the position size (cash) which is variable value for each order? when i try this, it calculates different size: strategy(title="xxx", overlay=true, initial_capital=1000, default_qty_type=strategy.cash, default_qty_value=1) strategy.entry("Long", strategy.long, when=long_condition, qty=position_size) the "position_size" is a float value which i calculated with risk management.
@JamesBachini
@JamesBachini 2 жыл бұрын
I think it's qty in the entry function strategy.entry(id="foo", long=true, qty=50)
@deniz9974
@deniz9974 2 жыл бұрын
@@JamesBachini I got it. "calc_on_every_tick=false" makes the differance between my qty and realtime qty 😁. When it's true, the calcs are ok. Thanks for the reply
@boralabrodi3641
@boralabrodi3641 2 жыл бұрын
is it possible to get I private class only to talk about a type of entry strategy? How much would it be? Thanks
@JamesBachini
@JamesBachini 2 жыл бұрын
Sorry it's not something I can do. I'd be careful about paying anyone to code you entry signals. Entries are overrated, risk management is more important to long term success.
@boralabrodi3641
@boralabrodi3641 2 жыл бұрын
@@JamesBachini actually I just wanna learn how to set an entry after my inside bar, and the next candle buys at the open price. I want it to buy when the price breaks above the inside bar previous candle
@JamesBachini
@JamesBachini 2 жыл бұрын
@@boralabrodi3641 can you just set a variable on the previous candle and use that in a if statement for an entry signal?
@amywachsmuth4293
@amywachsmuth4293 3 жыл бұрын
Great video. Is there a way to script /know if current candle is higher on current close vs highest in Premarket same as if lower ?? Can u create A filter for this ??
@JamesBachini
@JamesBachini 3 жыл бұрын
I mainly trade crypto so it's open 247. I would hazard a guess that you need to get premarket data from somewhere and the use the time function to put in the market trading hours or something like that. I vaguely remember an update recently from the pinescript Devs about a specific function to give true or false if it's in trading hours so might be worth googling that. But generally I don't use it so can't help, sorry.
@jb9282
@jb9282 3 жыл бұрын
hey nice video ! one question : how to add a price deviation for entry and exit - for more realistic simulation on TV. Tahnk you :)
@JamesBachini
@JamesBachini 3 жыл бұрын
You can set a slippage amount when defining the strategy. Is that kind of what you are looking for or could you make it work? More info here: www.tradingcode.net/tradingview/strategy-slippage-setting/
@sihlewilliams704
@sihlewilliams704 2 жыл бұрын
Is it possible to code your system onto tradingview, statergy aswell ?
@JamesBachini
@JamesBachini 2 жыл бұрын
Yes you can create a strategy or an indicator with Pinescript
@Berghiker
@Berghiker Жыл бұрын
How do I plot a line for the long stop loss? Do I need to use something like line.set_x1? It's asking me for a value.
@JamesBachini
@JamesBachini Жыл бұрын
Set a variable for the stop loss price when you place an order and plot a line using that
@RahulSahu-ob8iv
@RahulSahu-ob8iv 2 жыл бұрын
Kindly publish video on Moving average crossover with martingale position sizing.. thanks
@JamesBachini
@JamesBachini 2 жыл бұрын
Cross over is pretty straight forward if ta.ma(30,close) > ta.ma(200,close) Martingale might be a bit more difficult and not sure I understand it well enough to have any conviction.
@baz914
@baz914 Жыл бұрын
Would you still recommend manually testing strategies so it's more true to life like you can with Forex Tester for example, or is it okay to do automate the backtesting like this and then trade live markets?
@JamesBachini
@JamesBachini Жыл бұрын
I'm not familiar with Forex tester but setting up a demo account and trading on that to start with until the thesis has some unbiased data is probably a good idea
@baz914
@baz914 Жыл бұрын
@@JamesBachini Thank you 👍
@kltaito
@kltaito 2 жыл бұрын
Hello! Great video. I was wondering if there is a way to combine EMAs with an indicator? Like the Ttm squeeze, RSI, or stochastic?
@JamesBachini
@JamesBachini 2 жыл бұрын
yeah it's quite simple to do you just use an if statement with multiple checks if (ta.ema(source, length) and ta.rsi(source, length)) { // do whatever here } Something like that I think from memory. Or you might need to do it like FilterOK = false Filter1 = close > open Filter2 = rising(volume,1) FilterOK := Filter1 and Filter2
@kltaito
@kltaito 2 жыл бұрын
@@JamesBachini ok thank you
@jspagnuolo
@jspagnuolo Жыл бұрын
Hello James, great content. Do you offer coding services? I would like to test out a strategy but dont know how to develop it
@JamesBachini
@JamesBachini Жыл бұрын
Sure can you send me the details of what you want to do jamesbachini.com/blockchain-developer-consultant/
@thangbach6705
@thangbach6705 3 жыл бұрын
thank you
@ธนพลเอกศรีรุ่งโรจน์
@ธนพลเอกศรีรุ่งโรจน์ 3 жыл бұрын
That awesome, I love this kind of video. Do you have any pine script tutorial more?
@JamesBachini
@JamesBachini 3 жыл бұрын
No that was the only one. I'll try and get some more recorded. Thank you
@lasvegasbrad
@lasvegasbrad 3 жыл бұрын
@@JamesBachini , wow, I was ready to pay $$ for your info! Please tell us how your trading is going. With BTC and ETH at all time highs now, you should be rich!
@JamesBachini
@JamesBachini 3 жыл бұрын
@@lasvegasbrad no complaints. Euphoric with markets at all time highs 👍
@nickkarafillidis4637
@nickkarafillidis4637 3 жыл бұрын
excellent!! how about short?
@JamesBachini
@JamesBachini 3 жыл бұрын
strategy.entry("sell", strategy.short, 10, when=whatever > 0)
@Traqy
@Traqy 3 жыл бұрын
Is there a way to have just the long position show and not the EMA?
@JamesBachini
@JamesBachini 3 жыл бұрын
On a mobile so can't see the code but perhaps try removing the plot commands for each moving average?
@Traqy
@Traqy 3 жыл бұрын
Is there a way to put sells in?
@JamesBachini
@JamesBachini 3 жыл бұрын
Like short sell? You should be able to go long or short on any trade
@nguyenanhvu7345
@nguyenanhvu7345 2 жыл бұрын
Please make a video tell me how to create source "Previous Indicator's Data" for RSI similar as MT4
@JamesBachini
@JamesBachini 2 жыл бұрын
I don't think there's a way to do that sorry. You would probably need to combine the two indicators into a single script
@SinaRavi
@SinaRavi 2 жыл бұрын
Hi can you help with code writing i want to put sell and buy signal shape when price corsses only 1 hull moving average how shoud i write it
@JamesBachini
@JamesBachini 2 жыл бұрын
Something like this kodify.net/tradingview/strategies/sma-crossover/
@JoelNove
@JoelNove 2 жыл бұрын
Great video! Very helpful and appreciate all the work you put into this. What server do you recommend to run on? When converting pine script to JavaScript is it difficult to replicate?
@JamesBachini
@JamesBachini 2 жыл бұрын
I use cloud server instances like AWS hosted as close to the exchange as possible. It depends on the amount of logic in the strategy and the exchange API integration. The entry exit signals tend to be only a small part of a system trading bot and a lot of the work goes into risk management and analytics as well.
@JoelNove
@JoelNove 2 жыл бұрын
@@JamesBachini makes sense! I work with python but also I’m interested in getting into Java script. Do you find Java script easier to translate from pine script?
@JamesBachini
@JamesBachini 2 жыл бұрын
@@JoelNove no python would be a better choice if you are already familiar with it. There're a lot of data science and ml applications built for python too so it's ideal for crunching exchange data. You should find python sdks for the exchange APIs or if not it's easy enough to work with a http agent and rest API.
@JoelNove
@JoelNove 2 жыл бұрын
@@JamesBachini Thank you!
@JoelNove
@JoelNove Жыл бұрын
@@JamesBachini Thanks for your help 2 months ago. I’ve came a long way with improving my python algo skills, back testing and putting bot on AWS. My question is I found AWS t2.micro that I’m using is REALLY slow. I’m thinking about upgrading to t2.medium. Do you recommend something larger? Thanks!
@zeon3d755
@zeon3d755 Жыл бұрын
Can you access real-time data using pine-script, assuming you have DOM access.
@JamesBachini
@JamesBachini Жыл бұрын
No you would need access to exchange API and data systems
Convert TradingView Indicators into Strategies with AI (IT FINALLY WORKS)
21:49
ChatGPT inside your Pine Script EDITOR!
13:23
The Art of Trading
Рет қаралды 34 М.
From Small To Giant 0%🍫 VS 100%🍫 #katebrush #shorts #gummy
00:19
I Built a Trading Bot with ChatGPT
18:33
Siraj Raval
Рет қаралды 1,9 МЛН
How To Build A Trading Bot In Python
18:46
CodeTrading
Рет қаралды 826 М.
Simple Backtest with Tradingview/Pine script
13:24
Dennis Ivy
Рет қаралды 281 М.
Pine Script Basics: How To Get Started
4:40
TradingView
Рет қаралды 40 М.
Build Tradingview pine script BUY SELL strategy in 19 mins [v5]💹
19:11
Financial Programming with Ritvik, CFA
Рет қаралды 46 М.
How to Backtest any Strategy for Free in TradingView
19:58
VRDNation
Рет қаралды 569 М.
How to code a TRAILING STOP LOSS in Pine Script
26:51
The Art of Trading
Рет қаралды 37 М.
How to Code a AI Trading bot (so you can make $$$)
35:09
Nicholas Renotte
Рет қаралды 690 М.
Stop Losing Money with WRONG TradingView Strategies and Settings!
16:40
Michael Automates
Рет қаралды 29 М.
How to Backtest a Trading Strategy on Tradingview
7:57
TradingLab
Рет қаралды 448 М.