Generating Forex Intraday Trading Signals using Machine Learning Ensemble and NLP Sentiment Analysis Models – Part 2

In this part, we are going to implement an NLP (natural language processing) model to analyze newsfeeds (alternative data) and compute the average sentiment score on a scale of 1-100.

Newsfeeds are downloaded from different RSS sources using feedparser.

Sentiment analysis is performed using an NLP model provided by the python package NLTK.

Getting started

Install feedparser and NLTK

pip install --user -U nltk
pip install feedparser

Import the necessary libraries

Import the models we saved in the previous part

Remember we have saved our trained models in .joblib files –> see part 1

Filter features

Output: 
['Close', 'Volume', 'macd8', 'signal8', 'hist8', 'rsi']

Sentiment analysis function

Download newsfeeds

Predict and plot signals using trained models

Ready to buy AUDJPY?