What's the variable holding the last filled buy order price?
#1
Is there a feature that holds the last filled buy order price that I can include in my strategy?
  Reply
#2
(09-20-2019, 02:30 AM)orpheous Wrote: Is there a feature that holds the last filled buy order price that I can include in my strategy?

Yes, call the onTrade function for all sorts of trade information. The onTrade function is called every time an advice is acted upon.

Example code;

Code:
strat.onTrade = function(trade) {
 if (trade.action == 'buy') {
   log.info('trade price: ', trade.effectivePrice);
 }
}
  Reply


Forum Jump:


Users browsing this thread: