Trade_Decision {TwitterAutomatedTrading}R Documentation

Trade_Decision

Description

This function takes as arguments the sentiment indexes and returns the decision.

Usage

Trade_Decision(
  Current_Sentiment_Index,
  Past_Sentiment_Index,
  Use_Delta_Sentiment,
  Sentiment_Index_Threshold,
  past_decision
)

Arguments

Current_Sentiment_Index

The current sentiment index

Past_Sentiment_Index

The sentiment index in (t-1)

Use_Delta_Sentiment

If True the fuction will consider the difference in the sentiment index in the decision.

Sentiment_Index_Threshold

The threshold to define if the decision will be following or against the sentiment.

past_decision

The last trade decision.

Value

The vector with the decision.

Examples


buy_sell_t1 <- 0.2
buy_sell_t <- 0.5
Use_Delta_Sentiment <- TRUE
Sentiment_Index_Threshold <- 0.5

decision <- Trade_Decision(Current_Sentiment_Index = buy_sell_t,
                          Past_Sentiment_Index = buy_sell_t1,
                          Use_Delta_Sentiment =  Use_Delta_Sentiment,
                          Sentiment_Index_Threshold = Sentiment_Index_Threshold,
                          past_decision = decision
)




[Package TwitterAutomatedTrading version 0.1.0 Index]