Creating machine learning target function - Python Programming for Finance p. 10

preview_player
Показать описание
Hello and welcome to part 10 (and all) of the Python for Finance tutorial series. In the previous tutorial, we began to build our labels for our attempt at using machine learning for investing with Python. In this tutorial, we're going to use what we did last tutorial to actually generate our labels when we're ready.

Рекомендации по теме
Комментарии
Автор

Hi, thanks for the tutorial, very good. Question: in this program it could happen that we keep holding every time while the stock falls 1.5% as never falls more than 2% when we look up to 7 days forward. But in a large period of time it could have happened that the price felt for example 10% respect to the price we bought it as we kept holding, because it never changed within one week more than the requirement asked to sell. So, shouldn’t we be comparing each column price with the price we bought the stock instead of the actual price to calculate the percentage change, in order to avoid that problem.

clementedomeykoprieto
Автор

It's really crazy that with that boom in ML and bots for finance and cryptocurrencies this video hasn't hit 1 million views yet (which is fortunate for competition I guess !)

LuccDev
Автор

for video in all_sentdex_videos:
video['like']+ = 1
print('Thank you for the video. {} is the best of the type on

douglashoffmann
Автор

This at 6:00?

for col in cols:
if col > requirement:
return 1
elif col < -requrement:
return -1
else:
return 0

haven't ran it yet, not sure how your whole code works. But that's what makes sense in my head right now.

Will probably find out I'm wrong in next video.

kinvert
Автор

What do you mean by "pass" and "map"? Thanks.

samsmusichub
Автор

Thanks for all the good work. Really appreciate it. Keep up the infectious enthusiasm!

## Here is a possible solution for dynamic handling of hm_days argument, as requested
def extract_featuresets(tkr, hm_days=7, pctChangeRequirement=0.02):
tickers, df = process_data_for_labels(tkr, hm_days)
strX = ''
for i in range(1, (hm_days+1)):
strX = strX + 'df[\'{}_{}d\''.format(tkr, i) + ']'
if i < hm_days:
strX = strX + ', '
print(strX)
#strX = 'df[\'{}_target'.format(tkr) + '\'] = list( map( buy_sell_hold, ' + strX + '))'
#eval(strX)
strX = 'list( map( buy_sell_hold, ' + strX + '))'
df['{}_target'.format(tkr)] = eval(strX)
## Smart folks may suggest better ways to do so.
##Alternatively, shall appreciate what caused the commented lines approach to not work?

Best Wishes

akshaysingh
Автор

@sentdex fantastic tutorial! And apologies in advance for my lack of understanding of stock trading. Can you please help me understand how to interpret the data? Let's say I have the following spread:
Data Spread: Counter({'0': 1700, '1': 1547, '-1': 1229})
Does that mean that these are the b/s/h calls for the entire time that we have the data for that particular company?

My predictions are coming out as Counter({1: 607, 0: 512})
Is this the number for the b/h calls for the last 7 days.
What action can the user take based on this data?

ari.in_media_res
Автор

normally the number of Hold should exceed Buy, Sell calls. Let's say there are 8 Buy, 8 sell and 84 hold actions for 100days. If the code just says Hold for all the days, it becomes 84% accurate. So I want to eliminate all days where prediction is hold and the actual action should be hold from calculation of accuracy. How can I do this?

sukumarh
Автор

If you're planning on using algorithmic trading to make micro-transactions how would you account for, and overcome, brokerage fees?

joshwilson
Автор

Can someone explain why he wrote cols = [c for c in args]? when user input multiple arguments doesn't it come in as tuples, therefore cols=list(args) wouldn't this work as well?

haneulkim
Автор

hello sir can you please help me in implementing NSGA II to telecom data... please... it would be a great help

pranotiramteke
Автор

After looking at the logic for quite some time, buy_sell_hold() is too simplistic. Wouldn't you want to see a rising trend? Or average above "requirement"? That simple "if" statement looks very unsatisfying.

EranM
Автор

Hello dear mr.sendex can i ask something to you using email?

mr.roboter