Trade_Decision: Trade_Decision

Description Usage Arguments Value Examples

View source: R/Trade_Decision.R

Description

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

Usage

1
2
3
4
5
6
7
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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
)

TwitterAutomatedTrading documentation built on July 1, 2020, 5:48 p.m.