banner



long short sentiment trading strategy

News Sentiment Founded Long-Unawares Trading Scheme

Julian Kaljuvee

Summary

We are presenting a simple trading scheme based on Human language technology (NLP) and opinion analysis of company intelligence victimization a US vaccine biotech broth Vaxart Inc (NASDAQ:VXRT) as an exemplar. We use Globenewsire — the primary provider of all company news globally — as our main news source.

Strategy

Our trad i ng scheme has the following simple rules:

  • Negative News Sentiment — if market opens on negative news, go short (benefit from the downward movement of the unoriginal).

Implementation

The trading strategy implementation pipeline has the following primal stairs:

  1. Assign sentiment grade — allot opinion rack up (Vader and TextBlob)
  2. Historical EOD prices — fetch historic prices (Yfinance)
  3. Backtesting PnL — calculate historical PnL and tax return performance (Pandas)

Fetch News from RSS Run over

We archetypical get historical news stories under consideration to VXRT via Globenewsire RSS feed As shown on a lower floor and append the contents to a Pandas data frame.

Table — News on NASDAQ:VXRT

Recent keep company news on NASDAQ:VXRT

Assign Sentiment Grade

We next assign a sentiment score to the news summary victimization the touristed Vader and Txtblob packages in Python.

Prorogue — News on NASDAQ:VXRT with Persuasion Score

Obtain Historical Price Data

We adjacent get end-of-day existent price data from publically easy YFinance API developed Ran Roussi from Tradologics.com. We hither get the full history with lonesome troika (!) lines of computer code. In addition, the API also allows for downloading for company fundamental data and price data between specific dates.

VXRT Toll History via YFinance

Back testing — Figure out Past PnL for Farsighted-Short Strategy

Finally, we back test our trading strategy on a 10,000 USD hypothetic initial capital by going monthlong on positive sentiment, and contrariwise.

Backtest results for NASDAQ:VXRT
  • Final capital: 15,742.31 (USD)
  • Cumulative PnL: 5,742.31 (USD)
  • Cumulative rejoinder (121 days): 57.42%
  • Cumulative return annualised: 173.21%

Conclusion

We incontestable that sentiment grudge happening the news has a strong signal for a company stock return performance.

References

  • AltSignals.Army Intelligence
  • Yfinance
  • TextBlob
  • Vader View
  • Globenewswire RSS

long short sentiment trading strategy

Source: https://medium.com/@kaljuvee/news-sentiment-based-long-short-trading-strategy-5d23b1873116

Posted by: martinanxich.blogspot.com

0 Response to "long short sentiment trading strategy"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel