Gamestudio Links
Zorro Links
Newest Posts
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
Data from CSV not parsed correctly
by jcl. 04/20/24 08:32
Zorro FIX plugin - Experimental
by jcl. 04/20/24 08:30
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (7th_zorro, Aku_Aku, 1 invisible), 579 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Order with fixed amount. #483833
08/01/21 11:29
08/01/21 11:29
Joined: May 2021
Posts: 11
San Jose
H
hanw Offline OP
Newbie
hanw  Offline OP
Newbie
H

Joined: May 2021
Posts: 11
San Jose
I have a strategy that send fixed amount buy orders. It buys $50 worth of stock each time, irrespective of the price of the stock. It is possible to simulate this in Zorro? It seems the lot size in enterLong() has to be a int type. How do I express the idea such as: Zorro, please enter a long position that is worth $50?

Re: Order with fixed amount. [Re: hanw] #483834
08/01/21 13:31
08/01/21 13:31
Joined: Apr 2008
Posts: 585
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 585
Austria
That would be probably easy when you know an API broker that sells you a non integer number of shares.

Re: Order with fixed amount. [Re: hanw] #483839
08/02/21 06:15
08/02/21 06:15
Joined: May 2021
Posts: 11
San Jose
H
hanw Offline OP
Newbie
hanw  Offline OP
Newbie
H

Joined: May 2021
Posts: 11
San Jose
I'm working with Binance API which support trading fractional lot of crypto. My question is how to get the following function call working in Zorro.

entryLong(0.001); // enter a long position with 0.001 share of BTCUSD.

Re: Order with fixed amount. [Re: hanw] #483840
08/02/21 06:45
08/02/21 06:45
Joined: Apr 2008
Posts: 585
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 585
Austria
There is no "share of BTCUSD" because its no stock. Its a digital coin. Read in the manual about lot amounts and asset lists.

https://manual.zorro-project.com/lots.htm

Re: Order with fixed amount. [Re: hanw] #483843
08/02/21 10:54
08/02/21 10:54
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
Also, mind the LotAmount value in your asset list.

You can set the Amount variable instead of the Lots value to get the intended effect.

For example, suppose you want to buy 0.1 BTC/USD. If LotAmount is 0.001 and you set the Amount variable to 0.1 in your script, then it will set Lots to the correct value of 100. 100 x 0.001 BTC/USD = 0.1 BTC/USD.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1