I’m linking this here it is more complete, do let me know if the markets dropdown works for you guys..
-Create a Position (thanks to Bunka (he already added it his version VirtualPositionCreationAndManagement_v2b)
-temporarily enabled Return block
until fixedto see how that goes..
more info and previous version:
Useful to create, adjust or close a position to match the non virtual: real position size (if not 0) on exchange.
If this has changed manually or otherwise And
You want to update a running HaasBot to ‘know’.. or ‘forget about it’….
Clear /clean any residual Virtual Positions and prevent what is sometimes referred to as
“Ghost Orders” (Limit orders to close what is already gone on exchange opening new ‘ghost’ positions that your script (now considers as closed)) or trade amount errors instead. When you happen to know your script to occasionally gets residual old orders that you want to clear
This can occur for various reasons in or outside your script: latency, a server reboot or scripts frequently trading multiple ‘Unmanaged’ positions at a time ..
Forces of nature / acts of god, Murphy’s law etc all can make the virtual not match the ‘real’ [state of a position size if any.]
If still in doubt remember this for when you’d wish you called ghostbusters/=] or
typed VPM and included this simple tool for the job:
To clean what is not there to begin with..
If you don’t set a price to close a VP, your ROI will be off….
(It probably can’t hurt to have it in your scripts, for when you would find out you’d love it (*but use at your own discretion.))