10-22-2018, 11:50 AM
I need the value measured in currency, potfolioValueChange (or event.balance?)
or in other words the "PaperTrader.getBalance()" functions result.
The idea is:
whenever the position is long, fetch the current potfolioValueChange and make it available in my strategy. So then i could do for example
if(portfolioValueChange === (0.98 * portfolioValueFromBeforeLongPosition) { // < == Funny i know, but you get the idea XD
this.advice('short');
}
I tried to listen to this event in my own plugin, but I can't export the value.
Tried listening inside the strategy itself.
Tried listening to GekkoEventEmitter etc.
When I don't somehow get errors i keep getting "undefined" as a result.
I'm new to Javascript and Node, but I've been trying for like a week now. Is it possible at all to do something like this?
Regards
or in other words the "PaperTrader.getBalance()" functions result.
The idea is:
whenever the position is long, fetch the current potfolioValueChange and make it available in my strategy. So then i could do for example
if(portfolioValueChange === (0.98 * portfolioValueFromBeforeLongPosition) { // < == Funny i know, but you get the idea XD
this.advice('short');
}
I tried to listen to this event in my own plugin, but I can't export the value.
Tried listening inside the strategy itself.
Tried listening to GekkoEventEmitter etc.
When I don't somehow get errors i keep getting "undefined" as a result.
I'm new to Javascript and Node, but I've been trying for like a week now. Is it possible at all to do something like this?
Regards