How to reference portfolio.assets?
#1
Hi all,

I'm working on a strategy and can't figure out how to reference the portfolio.assets. I just want to simply assign it to a variable like so:

var assets = portfolio.assets;
  Reply
#2
(06-03-2019, 04:41 AM)gekko_user_h477150n Wrote: Hi all,

I'm working on a strategy and can't figure out how to reference the portfolio.assets. I just want to simply assign it to a variable like so:

var assets = portfolio.assets;

I have exactly the same question, I have been searching for two days without finding how to do it.


(Are we working on a similar strategy? [Image: wink.png] ) 

/ Micke
  Reply
#3
Yeah Micke, I will definitely let you know if I ever figure it out Wink
  Reply
#4
I would like to bump this question. 

It would be very useful to be able to check the portfolio asset and balance within the strategy and I have failed to figure out how to read the this.portfolio.currency, this.portfolio.asset and this.balance that are used in trader.js for example. I am sure it is not that difficult but my java-skills are not there yet. My work-around is to edit trader.js so it is writing the portfolio data to a tmp-file that my strategy keeps reading. It is not pretty!
  Reply


Forum Jump:


Users browsing this thread: