I had trouble finding a simple function for calculating and saving the slope in a dataframe. I couldn't find any clear examples or explanations anywhere. Your video on this topic was amazing and incredibly informative. Thank you so much for your valuable service and the effort you put into sharing knowledge. Your dedication is truly commendable.
@CodeTradingCafe Жыл бұрын
Thank you so much for your support! it really makes a difference to know that these videos are helpful, good luck!
@direnbulut13182 жыл бұрын
Thank you very much. If someone has same issue then i had: If Volume is written with capital letter, then u need to change it in second section
@CodeTradingCafe2 жыл бұрын
Thank you for sharing
@nackyding2 жыл бұрын
The way you define your target/label is nice.
@CodeTradingCafe2 жыл бұрын
Thank you, it works for some strategies however might not be the best way for scalping for example.
@MyStarPeopleExperiences3 жыл бұрын
Made it up to 3:23. Now I cannot get the downloaded data to work with the Jupiter notebook. Anyone have any suggestions? Thanks. The .csv file is in my download folder. I assume it must be in an Anaconda folder, but there are many. Any idea which one the .csv should be placed in?
@CodeTradingCafe3 жыл бұрын
Hi the csv file should be in the same folder as your jupyter code file, or you can insert the path in double quotes
@zhangmr79552 жыл бұрын
I have the same problem, there just found the ipyd file but no csv file
@streamcutthemoffbyswaygo4 ай бұрын
at 7:20, what is the other applied function behind get_slope?
@CodeTradingCafe4 ай бұрын
Hi, you can download the jupyter notebook file from the link in the description, the code is there (I honestly don't remember what was after the function :) )
@streamcutthemoffbyswaygo4 ай бұрын
@@CodeTradingCafe Hi, thank you so much! - MASSIVE help! :)
@IceTea0Infinity8 ай бұрын
I love how you speak like George St. Pierre
@CodeTradingCafe8 ай бұрын
Haha, thank you, this was one of my early videos I was still not sure how to speak in front of a mic :)
@MartinPleasant-ty1rw9 ай бұрын
Very helpful and interesting info! Definitely needs a second watch to follow along :)
@CodeTradingCafe9 ай бұрын
Glad you enjoyed it!
@itstandart3 жыл бұрын
hi, for midprice is required set up high and low parameters, tell me please which value i should take?
@CodeTradingCafe3 жыл бұрын
Midprice is usually the open plus closing price all divided by 2, it gives a rough estimation
@itstandart3 жыл бұрын
I mean that the code gives an exception bad_parameters on midprice
@CodeTradingCafe3 жыл бұрын
@@itstandart I tried to reproduce the error, all is working fine at mine, where exactly did you get this message at which part of the code?
@ajaniwalker94353 жыл бұрын
@@CodeTradingCafe I had the same thing happen to me. I'm at the part where I am typing df['MA40'] = df.ta.sma(length=40) df['MA80'] = df.ta.sma(length=80) df['MA160'] = df.ta.sma(length=160) I get the error: ValueError: Wrong number of items passed 10, placement implies 1 I don't understand why this would be a problem since the length 40 is a good argument to pass into it
@ajaniwalker94353 жыл бұрын
@@CodeTradingCafe also, I didn't see what all to apply in the part after the backrollingN was defined
@aidakhalil13943 жыл бұрын
Very nice Dr👍
@CodeTradingCafe2 жыл бұрын
Thanks a lot
@danch_ranch6594 Жыл бұрын
Hey, great video! I am confused with the interpretation of the "Using RSI alone as indicator part". Do we see the signals indicated from the RSI alone? What about when we were not using RSI alone. Did we see a combination of all the indicators creating a signal? Help me out with whats going on under the deck please!
@CodeTradingCafe Жыл бұрын
Hi thank you for your comment. In brief no RSI is not enough alone, I would suggest checking my recent videos for more interesting strategies and full backtests.
@harsh26562 жыл бұрын
Just came across your channel great content Thank you!! Would love to see pattern screeners like double top/bottom/ Rectangle box breakout/ volatility contraction pattern in future
@CodeTradingCafe2 жыл бұрын
Hello, thank you for your comment, actually this was proposed many times now I think I should be considering it although might be a bit challenging. See you around 🙂
@CristianoLanni2 жыл бұрын
Hi! very nice video! I was wondering why you don't use close[line] instead of open[line+1] when you compute value1 and value2 in the mytarget function. Congrats for your videos!
@CodeTradingCafe2 жыл бұрын
Hi thanks a lot for your support, in fact it's almost the same I was simply imagining myself trying to trade after the closing price happened, so at the open of the next candle. Sometimes you might have a closing price different then the next open. But yes in other programs I did use the closing price.
@md21ky382 жыл бұрын
waiting on that ichimoku video ! :)
@CodeTradingCafe2 жыл бұрын
Lol don't put pressure on me 😂 I got distracted by recurrent neural networks testing it was a pain... Video coming then ichimoku strategies definitely
@cesarecorrado7226 Жыл бұрын
Does rescaling the features have any effect?
@CodeTradingCafe Жыл бұрын
Hey, depending on the ML algorithm you will be using, anything based on decision trees is not affected by rescaling, but neural networks yes they need rescaling.
@trocchiettoski10 ай бұрын
would be nice to know how to apply this strategy to a stock using a percentage with a 2 win loss ratio, because pips would not make sense for stocks
@CodeTradingCafe10 ай бұрын
it's possible we just need to scale from pips to the broker's unit of price
@IceTea0Infinity8 ай бұрын
I dot have problems with this part: #mytarget(barsfront to take into account, dataframe) df['mytarget'] = mytarget(16, df) df.head(). What should i do with that? Do i need to compute that? Do i have to replace df with anything?
@CodeTradingCafe8 ай бұрын
df.head() is just to print the first few lines of the dataframe to verify the content visually.
@sergiobarbosa90398 ай бұрын
@@CodeTradingCafe hi. im having a keyerror: 'high' when i run this part of the code. Can you help please?
@CodeTradingCafe8 ай бұрын
Check if it's high or High capital H it looks like pandas can't find the column high
@Alloverthegolf2 жыл бұрын
Perfectly done! Amazingly usefull!
@CodeTradingCafe2 жыл бұрын
Thank you for your support!
@zhangmr79552 жыл бұрын
I've downloaded the historical data from Dukascopy but I have no idea where is the file position it stored. Generally, the downloaded file will go where?
@CodeTradingCafe2 жыл бұрын
try the csv file here drive.google.com/file/d/16BZc9arwQKkPTDU5IjUKrPj54Xif5jtd/view?usp=sharing let me know if it works
@XinhLe2 жыл бұрын
Please check, the df.ta.sma function is not working. It reports errors for me. for me: the df.ta.sma(length=40) generates a data frame, not a column of data as expected. that's why I have error. how can I fix this. Thanks!
@CodeTradingCafe2 жыл бұрын
Hi, depends which version of pandas_ta you have, try the following function ta.sma(data=df,...) Or something like that
@XinhLe2 жыл бұрын
@@CodeTradingCafe appreciated!
@AlgoTradingX3 жыл бұрын
That's cool, KZbin randomly proposed me your content and I like it. Did you think of using a classification algorithm? It might help to boost your performance
@CodeTradingCafe3 жыл бұрын
Hi, thank you for your comment, actually I tried Xgboost classifier in one of the videos it was not bad, so you are right, however I didn't realize that it's too many information to show in one video so it's lost somewhere on my channel :)
@AlgoTradingX3 жыл бұрын
@@CodeTradingCafe Fully understand, same on my channel, I am struggling to compress everything in one video. It is nice meeting fellow Algo traders programmers.
@CodeTradingCafe3 жыл бұрын
I will follow your work, seems similar with new ideas. Good luck to you!
@AlgoTradingX3 жыл бұрын
@@CodeTradingCafe Thanks you too. We should make a collab in the future. Good luck for your channel
@CodeTradingCafe3 жыл бұрын
Sure why not... When we grow ,😁
@jw-sx4piАй бұрын
curious about volume, forex doesnt have a central exchange so where does the volume data come from?
@CodeTradingCafeАй бұрын
Yes agree, it's actually the volume from the broker trades, so all the trades passed through this particular broker you are using, it might be a sample of the whole population, but sometimes also a bad/ non representative sample I guess. So yes for Forex volume is meaningless.
@corneliusluka3555 Жыл бұрын
Can you do tutorial on reversal, thank you very much
@CodeTradingCafe Жыл бұрын
Hi, reversal is a wide topic, do you have anything specific in mind? check this video for example: kzbin.info/www/bejne/aILCooujg8imkNk
@mr.gk52 жыл бұрын
Would be great if you could make a video showing the probability distribution graphs of each indicator mentioned
@CodeTradingCafe2 жыл бұрын
Hi thank you for sharing, it's possible however what exactly is to be shown? Like the indicator has a distribution of which values it can take over the time but that doesn't provide a hint on future price
@mr.gk52 жыл бұрын
@@CodeTradingCafe I think it's just nice to know how well each indicator works on different stocks or asset classes
@CodeTradingCafe2 жыл бұрын
@@mr.gk5 I understand your point, to give a plain honest answer NONE of the indicators gives any statistically relevant hint on future trend Unfortunately. Sometimes combined technical indicators work better but still nothing that reads the future. I should make a video on this but no one likes such deceiving results...
@mr.gk52 жыл бұрын
@@CodeTradingCafe Well, hoping an indicator or any combination of indicators give a hint to future price is a little too ambitious anyway. But say an indicator with a 47% chance is still better than one with 30% chance on any given stock, right?
@CodeTradingCafe2 жыл бұрын
@@mr.gk5 Hi, yes true like a relative comparison between different indicators, I suspect they will all converge to 50/50 probabilities, but there's only one way to find out 🙂
@kevinnjoroge32732 жыл бұрын
Thank you so much for the amazing content but am having an issue with data cleaning though...There is an error where it says df is not defined and everything seems right.
@CodeTradingCafe2 жыл бұрын
Thank you for your comment, if you are using jupyter notebook you have to run the cells in order, meaning you might have forgotten to run the first cell where df is defined for example, check it out
@kevinnjoroge32732 жыл бұрын
@@CodeTradingCafe Thank You .It had completely slipped my mind...🤦♂
@CodeTradingCafe2 жыл бұрын
I am happy it worked
@kevinnjoroge32732 жыл бұрын
@@CodeTradingCafe Hey again..I am unfortunately getting another error Input In [106], in () 1 # mytarget(barsfront to take into account, dataframe) ----> 2 df['mytarget'] = mytarget(16 , df) 3 df.tail() This is a copy of the error am getting when takin into account the bars up front for our target.
@CodeTradingCafe2 жыл бұрын
@@kevinnjoroge3273 what's the last line of the error message
@santrix15952 жыл бұрын
how can you check 2 features or indicators on the last part, how you can add more on the statement?
@CodeTradingCafe2 жыл бұрын
Hi, I usually combine features in the pandas dataframe it's the easiest way just to have the combined signal within the dataframe for later use.
@autarko2 жыл бұрын
I am enjoying your content but I have a suggestion for the future: Dukascopy may not be the best data source for learning. They require registration with email and phone number.
@CodeTradingCafe2 жыл бұрын
Hi, thank you for your feedback yes they require a registration (I guess no phone number don't remember to be honest) I understand it's cumbersome. Yfinance is easier in this case you can directly use it from within python, I will make a video about it.
@autarko2 жыл бұрын
@@CodeTradingCafeI'm looking forward to working through more of your videos!
@autarko2 жыл бұрын
Another suggestion, if you have time: it would be helpful if we could copy the code or notebook from github :)
@CodeTradingCafe2 жыл бұрын
@@autarko I will look into it maybe create an account, but can't promise when ... life keeps getting in the way 🙂
@ridergami682111 ай бұрын
Tq. Python file still available for download even videos 2 years old
@CodeTradingCafe11 ай бұрын
Thank you for your support.
@HarpreetSingh-ps9rx2 жыл бұрын
During 7th minute of the code, you don't scroll to the left so I can't see the code where you put the get slope function
@CodeTradingCafe2 жыл бұрын
Yes I wasn't aware I am out of the recorded area. You can download the code from the link in the description of the video.
@philomenantonybenhur67802 жыл бұрын
Thank you so much for this video. I am trying to follow your code and execute the same, but I am getting an error from pandas ta for on calculating the average column 'df['Average'] = df.ta.midprice(length=1) #midprice'. The error message is 'Exception: TA_MIDPRICE function failed with error code 2: Bad Parameter (TA_BAD_PARAM)'. Could you please let me know how to fix this. Thank You once again.
@CodeTradingCafe2 жыл бұрын
To be honest others have signaled the same error but I can't reproduce it at mine it's working well. Instead of using midprice just replace by the closing price with little tweaks it should be fine hopefully. You'll find less errors in the more recent videos 🙂
@philomenantonybenhur67802 жыл бұрын
@@CodeTradingCafe Thank You, will follow the same..
@santrix15952 жыл бұрын
@@CodeTradingCafe The error you are getting is because the new update they did on pandas_ta requires the length on midprince to be null, if you delete that and leave it on blank the issue will dissapear.
@CodeTradingCafe2 жыл бұрын
@@santrix1595 thank you for the update, I haven't visited this part of the code since a while
@zhangmr79552 жыл бұрын
I cannot find the file : USDCHF_Candlestick_4_Hour_ASK_05.05.2003-19.10.2019.csv
@CodeTradingCafe2 жыл бұрын
Hi, it's downloadable from different sources if you have time check my learning python playlist there is a video especially focused on data download directly from the notebook.
@zhangmr79552 жыл бұрын
@@CodeTradingCafe You mean the "Python Learning" Series?
@zhangmr79552 жыл бұрын
@@CodeTradingCafe I know Python, I know how to download the csv file. But the file of USDCHF_Candlestick_4_Hour_ASK_05.05.2003-19.10.2019.csv not found from your provided files. And I downloaded it from Dukascopy directly, but there is no clue where the downloaded file is. So I need your help, Generally the files downloaded from Dukascopy will enter which file on local desktop.
@CodeTradingCafe2 жыл бұрын
@@zhangmr7955 ah ok I see, usually when the download is done you still have the option to click save as and the file is saved under downloads... actually give me few minutes I will add a link to the video
@CodeTradingCafe2 жыл бұрын
try this csv file: drive.google.com/file/d/16BZc9arwQKkPTDU5IjUKrPj54Xif5jtd/view?usp=sharing
@webeasesolutions Жыл бұрын
Man. I've been trying to figure this out for hours lol. I'm going to bed.
@CodeTradingCafe Жыл бұрын
It might take some time, but it's fun 🙂
@talsabiri3 жыл бұрын
this is so advanced 😅
@CodeTradingCafe3 жыл бұрын
Sorry about that, actually you are right I have to do something more affordable, I guess something like an algorithmic trading in Python playlist for beginners (thank you for the idea 😁)
@CodeTradingCafe3 жыл бұрын
... actually sometimes you can skip The coding part and just check the results to see if it's worth the pain Good luck
@eurisko71193 жыл бұрын
@@CodeTradingCafe that's will be very useful look forward new subscriber
@CodeTradingCafe3 жыл бұрын
@@eurisko7119 thank you for your support 😊
@santievangelio42512 жыл бұрын
the midprice line gives me an error
@CodeTradingCafe2 жыл бұрын
Hi, sorry it's hard to guess where exactly the error is coming from, however try to take the absolute difference between open and close prices and divide by 2, it should work when done manually
@blasdelezo83962 жыл бұрын
The csv data file is missing
@loganbishop4619 Жыл бұрын
I dont understand max(0,open-high). Maybe i am reading this wrong, but this will always be 0
@CodeTradingCafe Жыл бұрын
Hi, no actually it provides the maximum between 0 and the open-high values, so if this latter is negative we get 0, this way we always have positive values.
@jasonwells83212 жыл бұрын
I get this error when I try to indexZeros
@jasonwells83212 жыл бұрын
#Check if any zero volumes are available indexZeros = df[ df['volume'] == 0 ].index KeyError Traceback (most recent call last) ~\anaconda3\lib\site-packages\pandas\core\indexes\base.py in get_loc(self, key, method, tolerance) 3360 try: -> 3361 return self._engine.get_loc(casted_key) 3362 except KeyError as err: ~\anaconda3\lib\site-packages\pandas\_libs\index.pyx in pandas._libs.index.IndexEngine.get_loc() ~\anaconda3\lib\site-packages\pandas\_libs\index.pyx in pandas._libs.index.IndexEngine.get_loc() pandas\_libs\hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item() pandas\_libs\hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()
@CodeTradingCafe2 жыл бұрын
Hi, not sure I understand which error
@jasonwells83212 жыл бұрын
@@CodeTradingCafe I input this line of code #Check if any zero volumes are available indexZeros = df[ df['volume'] == 0 ].index
@jasonwells83212 жыл бұрын
@@CodeTradingCafe and I get all those errors.
@Cryptosooner2 жыл бұрын
@@jasonwells8321 @CodeTrading I am getting the same error.
@jcoal_YT Жыл бұрын
hey i am having trouble with the code df['MA40'] = df.ta.sma(length=40), i saw you gave a solution on a comment below on to fix it, but i didn't understand. Instead i decided to download the code. But it opened with visual studio code even though i was using anaconda jupyter notebook. Will the code still work properly on VSC? I am completely new to coding but very familiar with forex so i have no idea what I'm doing. How will i add the bot on mt4?
@CodeTradingCafe Жыл бұрын
Hi yes the code will work in Vscode I sometimes use VSC as well. you can add these directly in mt4 because mql5 is a different language, but it's possible to translate from python to mql. Good luck!
@webeasesolutions Жыл бұрын
I'm very confused where this code reading the .csv file from. I can't find the .csv file anywhere and I don't understand how to replace this file with my own .csv file for updated information. Can you please help explain? Or can anyone else please explain? I feel like it's something simple, but this is all brand new to me. I watched your begginer Python videos, but I didn't learn this. I'd love if you could explain everything a bit more. Overall, I appreciate your videos. This is amazing. Thanks. I just want to get to the point where I can run this code and it starts trading automatically for me, either paper or live trades. import pandas as pd df = pd.read_csv("USDCHF_Candlestick_4_Hour_ASK_05.05.2003-19.10.2019.csv") df.tail()
@CodeTradingCafe Жыл бұрын
Hi thank you. There CSV file is read from the same folder where we have our code notebook. So if you want to replace it with a new fly you can copy your fine inside the same folder where your Python file exists. It's good you started running through tutorials it will take time but it's fun after all. 🙂 Good luck!