Domanda

I have a simple question but can anyone please point in the direction of online documentation that explains what "gt, lt, lte, gte" relationship arguments mean in the add.signal function in the quantstrat package?

I can't seem to find these codes broken down anywhere.

Any insight or assistance would be greatly appreciated.

È stato utile?

Soluzione

gt, lt, lte and gte stand for greater than, less than, less than or equal to and greater than or equal to

E.g

in following code, you the parameter arguments takes in a list of parameters to be passed to function sigCrossover. What following code does is add signal to your strategy based by calling function sigCrossover on columns nFast and nSlow as specified in argument columns and it checks condition for nFast being less than nSlow

add.signal(strategy.st, name='sigCrossover',
    arguments = list(
        columns=c("nFast","nSlow"),
        relationship="lt"
    ),
    label='short'
)
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top