Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, Quad, M_D), 1,217 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 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: 586
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 586
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: 586
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 586
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,726
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,726
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