You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.
I'm trying to write a new strategy, and I can't seem to find if we can somewhere in the strategy the assets price when last bought and when last sold. Am I missing something?
Thanks in advance!
The text was updated successfully, but these errors were encountered:
@foux, the current asset price can be found in the s.period.close.
The list of trades can be found in s.my_trades array. As long as it has a length that is greater than 0. The operation, price, and timestamp are all contained in the object stored in the array.
I recommend that you run a sim and use console.log(s) to see all the items that are in the "s" object in the "onPeriod" method and that will give you lots of new toys to play with for strategies. 😃
However, the my_trades array is only in the context of while the bot has been running, from my experience. If you stop the bot and start it again, the s.my_trades starts back as a fresh array. So take care in your strategy that it does not need to rely on persisted orders to be functional.
Hi,
I'm trying to write a new strategy, and I can't seem to find if we can somewhere in the strategy the assets price when last bought and when last sold. Am I missing something?
Thanks in advance!
The text was updated successfully, but these errors were encountered: