First of all, I highly appreciate your work. I've already lerned a lot from your videos. But I think in this partucular one video there is one issue in code. First 'for' is looking for all dates. Second one 'for' is checking all timestamps starting from date + 2. But there is no time limit how far it can look for candela fulfilling evaluated entry. Eg. entry evaluated for 6-th Januarry 22, is found at 12-th. This trade is closed at 13-th. Even when after that there is break (for 2-nd 'for'), main 'for ' is continuing from 7-th Januarry. My proposal would be to change it into: for index, row in df[date:][2:26].iterrows(): # or even [2:24] to hit only midnight Without that correction, original code is passing same time frame even several times. Unfortunatelly this correction have significant (negative) impact into final result. Any way, grat concept and implementation.
@ersineser7610
Жыл бұрын
Thank you for second video of Fibonacci series. Another great content too.
@Algovibes
Жыл бұрын
Welcome mate, thanks a ton for watching!
@arunkamath
Жыл бұрын
Eagerly waiting for part 3.
@Algovibes
Жыл бұрын
thanks buddy
@wei7360
Жыл бұрын
thanks for the video! i learned so much and even coded a pinescript for it! Just a reminder, if you were to use this specific strategy, that would require you to use a "market order" instead of a "limit order" according to this logic u are having. Correct me if im wrong!
@Algovibes
Жыл бұрын
Yes you are placing a market order at least that would be the assumption for this strategy.
@jerrywang3225
Жыл бұрын
Great video as always, I believe there is a lot of room for optimization, like the first hour candle stick, there should be min range between high and low, otherwise it won't be a valuable reference candle.
@Algovibes
Жыл бұрын
Thanks buddy. Yes, very good point.
@anilmm2005
Жыл бұрын
Another amazing video @algovibes . Really appreciate what you agree doing here and helping so many retail traders get the nuances of these things in easiest possible way
@Algovibes
Жыл бұрын
Thank you mate, appreciate your comment!
@barunroshan
Жыл бұрын
Enjoying your videos. Request to create one backtest where program exits at the end of day , meaning intraday strategy where entry and exit happens daily
@Algovibes
Жыл бұрын
Thanks buddy! Can you elaborate on your suggestion?
@matissd
Жыл бұрын
Thanks for another great video! Strategies are fine, people post them all the time. What I cant find is a good video on how to set up the whole infrastructure for collecting data (not for one or two paris, but like for all usdt pairs on binance) at low granularity (ok, maybe not tick data but say 1 min) with all the safeguards of how the bot deals with coming back online after disconnects. How to set up it on linux/win machines so it would come back online automatically if it gets an error. Things that are not just strategies.
@Algovibes
Жыл бұрын
Thanks a lot mate. I have actually covered exactly those topics roughly 1 year ago from setting up a live data stream to deploying the bots on a Linux Virtual Machine. Be invited to explore the cryptobot playlist.
@matissd
Жыл бұрын
@@Algovibes Thanks! Will do that!
@sazamhashmi
Жыл бұрын
Keep the videos coming buddy.
@Algovibes
Жыл бұрын
I will :-) Thanks for your support and pushing me!
@joearcuri3377
Жыл бұрын
would love to see an implementation with this strategy merged with your LSMA strategy and TSL ! Would be cool to have a TSL going with this strat, if it makes any sense. looking forward to the followup. p.s. I have to say, i've been working with Python for years and it always amazes me at how much there is still to learn. Great channel!
@Algovibes
Жыл бұрын
Thank you so much Joe. Really appreciate your comment!
@manolaq
Жыл бұрын
I believe when closing the position it should have something like this. Since you are selling at the sl or tp if row.Close >= tp or row.Close = tp: sells.append(tp) if row.Close
@timnilson
Жыл бұрын
He is closing the position with the next possible open price (he shifts the next open to 'price'), which makes sense. But, if you compare your logic and his logic, the results are totally different -- and that doesn't make sense to me. The results with your code are terrible and with his logic, the results are fantastic... something about this strategy isn't working right...
@manolaq
Жыл бұрын
@@timnilson to my understanding if you wait until the next open price, it means that there is no stop loss and just trigger a close position signal with the next price. Is that correct?
@timnilson
Жыл бұрын
@@manolaq Yes, that is right. Somebody here suggested that the levels should be set with the first one hour candle, but all trading should be done with a shorter time frame, like minutely data for example. That would avoid the issue you’re bringing up, but surprisingly that is also not working well. The results worsen by a lot (at least when I tried to implement it).
@manolaq
Жыл бұрын
@@timnilson I am working in crypto since Dec 2021 trying different things and the results in reality are even worse. I made a simulation to se what happens if I enter a position at every candle seeking a 0,50% profit with the same percentage as stoploss. Guess what the chances are 50-50. I have tried many indicators and many strategies, the result is the same. Even machine learning. Again 50-50. This means that the same data that produce a win position in the past, the same data produce a loss position. It is always 50-50! Not 60-40 or 40-60 (win-loss). They have built the system that way so you will never win. And finally if you manage to raise the win percentage to 53-54% you are still not earning something because of the fees. I think must make a video on this to help people understand why they lose money
@timnilson
Жыл бұрын
@@manolaq The piece I can't make sense of in the presented strategy here is why it works on the first hour candle, but no other candle (I tried). The results only work on the first hour candle... but it's a 24 hour traded currency. Why does it matter that we are using the first candle of UTC? Why does it not work with the first hour candle if using US East Coast time for example? Something does not make sense here. I also implemented the same strategy on Quantconnect and am not getting anywhere near the same results. My issues could of course be my coding errors. Your results of always 50-50 is described my some as "the price action is always random" and that there are no patterns and TA is worthless... kzitem.info/news/bejne/xp2gzH2rr6tniKw (for example)
@32isaias
Жыл бұрын
Thanks for another great video, this is one of my favorite videos for sure, I love using fibs. Have you used harmonics?
@Algovibes
Жыл бұрын
Very welcome mate, happy you like it! No I didn't yet. If you have a reference I am happy to take a look.
@emoema9473
Жыл бұрын
You are the best ❣️
@Algovibes
Жыл бұрын
Thank you my friend :-)
@dadi.ganesh5323
Жыл бұрын
That's great but i have one doubt, If we are in position Then what happens if it is not hit tp and sl in a day then how the position closed in that day
@rajeevmenon1975
Жыл бұрын
As always, great content out there. Trading bot would be a great idea. Also consider automatic trade execution too using some broker APIs
@Algovibes
Жыл бұрын
Thanks a lot mate also thx for the suggestion!
@antoine_venty
Жыл бұрын
Awesome video like all the others ! Really good job, danke schön !! Are you maybe willing to try with short positions as well ? Or maybe you already have a video showing how to backtest a long and short strategy ?
@Algovibes
Жыл бұрын
Thanks a lot Antoine, appreciate your comment. I have some videos of covering the short side (Python for Finance playlist) as well but will cover shorting in the future as well.
@boetros2962
Жыл бұрын
Hi Algovibes, the strategy looks very promising, thank you for sharing! I've been trying to reproduce it and match each individual buy and sell to the exact time it took place to show it in a graph but I was not able to do so. There is something strange happening in the loop, sometimes the loop buys again before selling and in some cases the sell happens in the same hour as the buy, in the end the profits is going down dramatically. In your example you are recoding a trade one every signal day but if you try to map them to the individual times then this is not happening as on some dates there is no trade according to the levels. Where you able to successfully map all the buy and sells to the correct time? Nevertheless thank you for sharing. I loving your videos!
@philipfiguerres6132
Жыл бұрын
Thanks for the amazind vid. I was never a fan of fib but looks like i need to reconsider. A bot using fib and hosting bot on aws ec2 would be a nice way to finish off this topic.
@Algovibes
Жыл бұрын
Thanks philip. Appreciate your comment and your suggestion!
@I3oleslav
Жыл бұрын
Really good video as usual! Have you ever thought about machine learning to train your strategy to optimize them ?
@Algovibes
Жыл бұрын
Thanks matey Sure! I got quite a bunch of videos on ML. Be kindly invited to explore the cryptobot / Python for finance / machine learning playlist
@JEDELCEL
Жыл бұрын
Great video indeed. One question though : shouldn't we check whether the price hits the SL or TP within the hourly candle ?
@Algovibes
Жыл бұрын
Yes you can do that as said in the video but makes things a lot more complicated (not that it is not doable but was just too much for one video)
@polkobra5455
Жыл бұрын
Hey Algo. Great video! Could you just tell me if i am doing something wrong because when I subtract the 0.0015 binance trading fee from the rel pnl the startegy only does 6% profit. This just seem too wildly different to be correct.
@Algovibes
Жыл бұрын
Thanks a lot mate. Fees can have a big impact, so nothing I would wonder to much about but a double check would not hurt definetly.
@sandeshdesai1638
Жыл бұрын
Hi @algovibes, First of all, great video. I have been following your channel for more than a year and have learnt a lot about python and algorithmic trading during this time. I had a question in the inner for loop with df[date:][2:].iterrows() method. If the sl or tp positions are not hit on the specified date, then is the Close position of 3rd candle on the next day considered as the start point for calculations and not the 1st one? Because the row index position is hardcoded to start from 2. Would be great if you could clarify whether this was intentional or am I missing something in my understanding.
@wissamyammine6510
Жыл бұрын
Hello, Thanks for this fantastic strategy !! I want to backtest it. What shall I import from the backtesting Lib? Thanks a lot.
@Algovibes
Жыл бұрын
Welcome man!
@GreenStickStrategies
Жыл бұрын
Great video! I would like to know if U can optimize an strategy using python. Like trying different combinations of 2 EMAs for example. Thanks. Greetings from South America.
@Algovibes
Жыл бұрын
I did some videos on that already. Please be invited to check out my Python for Finance and cryptobot playlist. If there is anything else you would be interested in, please let me know!
@cartoonchan182
Жыл бұрын
Not sure if you will reply to a comment for a 4 month old video... But why add 1 before calculating cumprod() i have seen you do that in other videos... Just cant find a reason behind it... Im not bad at math but sometimes i need a kick start Edit: scrap that found the explanation in the description smart work
@Algovibes
Жыл бұрын
:-) Thanks buddy, happy you helped yourself out!
@mikehaks
Жыл бұрын
Maybe I missed it, but whose first hour are you using for the calculation? Maybe it's GMT?
@Algovibes
Жыл бұрын
Just the one from the Binance timezone. But this is actually quite important, agreed!
@marcnubaum1432
Жыл бұрын
Thanks for your work and great videos. I am not sure but I think your strategy or better the implementation is not 100% adequate. In my view the „for date in dates“ loop walks through all unique days to then walk through all hourly candles in the next „index,row“ loop. However, there you shall only look at the current date, however you iterate over all hourly candles for all dates greater equal the current date - implied by df[date:]. That’s the reason why you get almost 360 trades as the get_levels function is looking at buy signals across all dates after the current date. The me this shall loop shall truely only loop over the hourly candles of the current date. Does that make sense? Thanks Marc
@Algovibes
Жыл бұрын
Welcome man. Thanks for your comment! No, that's intentional. Reason behind that is: If you have don't have threshold hits over that day you want to check until one threshold is hit. That could be the next or even some days after that.
@marcnubaum1432
Жыл бұрын
@@Algovibes Thanks for you answer. I'd agree in case you are "in_position". only then you want to check with the get_levels of the current date against all future dates. however, in case you are not getting "in_position" at the current date you shall just move to the next date and determine the new get_levels of the following date. this would also be the case in a live implementation. you would not calculate the get_levels of day1 and maintain them throughout the future. if they get not triggered during that day you recalcluate the get_levels based on the following days first hourly candle. in that case at day1 no trade was triggered. when we are in a position though at day1 which is not closed then we stick to the get_levels of day1 until the position gets closed - which may happen at any time in the future. but until this position gets closed no new get_levels are calculated, no new trades are open. and this is not ensured with your current implementation. you basically jump back an forth in time with the loops you are constructing. I am not an expert in python, but in my view this needs to be somthing like: for date in dates: for index,row in df.loc[date:][2:25].iterrows(): not sure if that is proper python, but i hope you get the point. with this implementation you would check if you are in_position. if no you get the get_levels and check for buy signals throughout the current date only!... if you bought the in_position gets true and if it was not closed throught the current date the first for loop jumps to the next date and as it is still in_position it does not do get_levels but only checks the folliwing day for sell signals. thanks mate.
@markgamache6377
Жыл бұрын
Would be interested in the Sharpe ratio for this strat.
@Algovibes
Жыл бұрын
Has a mean return of 0.08% and a std of 0.02, so around 4.22. Thanks for watching!
@markgamache6377
Жыл бұрын
@@Algovibes that means you could use fairly high leverage! 👍
@contactshahpriyank
Жыл бұрын
Please make the trading bot video as well.
@Algovibes
Жыл бұрын
I'll see what I can do!
@bhoyt4530
Жыл бұрын
Do you have any videos showing how to transition something like this into a live trading bot on Binance? I'm looking how to set the broker in cerebro. Not sure how to set to broker so it has my API keys.
@Algovibes
Жыл бұрын
Hi buddy, yes! I have a whole playlist on that covering a huge variety. Be invited to check that out! (Cryptobot playlist - should be linked in the description)
@Mukul0035
Жыл бұрын
I tried on nifty and i got 21 % returns annually..
@Algovibes
Жыл бұрын
🇮🇳 nice, thanks for letting me know!
@AndreBuser
Жыл бұрын
Regrettably, the current strategy falls short when transactional fees (e.g. 0.25%) come into play, as they significantly diminish the profit margin.
@Algovibes
11 ай бұрын
Why would you take 0.25%? Doesn't represent the reality at all. BTC is free to trade on Binance, the only thing to take into consideration would be slippage/spreads which are expected to be quite low for BTC due to the liquidity.
@S5Soaring
Жыл бұрын
Wen bot?
@Algovibes
Жыл бұрын
Let's see how this video is performing. If it's good enough I'll make one on it. Thanks for watching btw :-)
@S5Soaring
Жыл бұрын
@@Algovibes no problem, would love to see it!
@Zonatrol
Жыл бұрын
Well i think this is missing some CRUCIAL info , like did u even bothered to watch on the graph and see if the given trades match what happened that day?i dont see that,so i did it myself,and let me tell you something,nothing makes sense ,using the values you have on your code . Or i dont get the logic behind ,or there are several buggs
Пікірлер: 72