Gamestudio Links
Zorro Links
Newest Posts
How was this Game Rendered?
by 3run. 08/06/20 20:01
problem with adding new history
by daan. 08/06/20 19:53
wrong Entry
by daan. 08/06/20 19:52
New Zorro version 2.30
by Zheka. 08/06/20 17:40
Lookback period - no signs of live
by jcl. 08/06/20 16:23
How to plot stop TradeStopLimit
by AdamWu. 08/06/20 15:03
Chat Room for Zorro Programmers
by AdamWu. 08/06/20 14:20
AUM Magazine
Latest Screens
The Space Between
Pogostuck: Rage With Your Friends
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Who's Online Now
9 registered members (AndrewAMD, mk_1, txesmi, AdamWu, Dooley, daan, Zheka, jenGs, painkiller), 470 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
bigimpactsound, tzw101, Al82, Alibert, jsch
18489 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
enterTrade documentation #480793
07/13/20 15:08
07/13/20 15:08
Joined: Feb 2017
Posts: 1,067
Chicago
AndrewAMD Online OP
Serious User
AndrewAMD  Online OP
Serious User

Joined: Feb 2017
Posts: 1,067
Chicago
jcl,

Question #1:

Below is a quote from the manual, emphasis added:
Quote
enterTrade (TRADE*): TRADE*
Enters an already open, pending, or closed trade from a TRADE struct. Does not send any order to the broker. The asset name is passed through TradeStr[0] resp. the Skill element of the TRADE struct. This function can be used for running backtests from a list of trades (see Simulate script) or for reading positions from the broker API and converting them to trades.
https://zorro-project.com/manual/en/buylong.htm

This sounds like a super-useful feature! However, the documentation does not offer guidance for setting up the TRADE struct for trade position adjustments.

If Virtual Hedging is enabled, do I only enterTrade a phantom trade? Will zorro then automatically enterTrade a corresponding pool trade, or do I have to manually enterTrade the pool trades as well? Finally, does LotsPool get adjusted correctly?

Question #2:
Quote
The asset name is passed through TradeStr[0] resp. the Skill element of the TRADE struct.
How am I supposed to set TMF general purpose variables if it's occupied by an Asset string? Why not deduce the Asset from the last asset() call? I see that it already deduces Algo from the last algo() call.

Re: enterTrade documentation [Re: AndrewAMD] #480822
07/17/20 07:24
07/17/20 07:24
Joined: Jul 2000
Posts: 27,307
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,307
Frankfurt
There is no example for reading positions from the broker API because none of the plugins supports that yet. This is work in progress.

But for the second question, TradeStr[0] can be used with no restriction in a TMF. It needs only be set to the asset name when calling enterTrade().

Re: enterTrade documentation [Re: jcl] #480832
07/17/20 13:56
07/17/20 13:56
Joined: Feb 2017
Posts: 1,067
Chicago
AndrewAMD Online OP
Serious User
AndrewAMD  Online OP
Serious User

Joined: Feb 2017
Posts: 1,067
Chicago
Originally Posted by jcl
There is no example for reading positions from the broker API because none of the plugins supports that yet.
The NFA plugins have GET_POSITION - are you referring to the non-NFA plugins?

Originally Posted by jcl
This is work in progress.
I look forward to it. Thank you!

Originally Posted by jcl
But for the second question, TradeStr[0] can be used with no restriction in a TMF. It needs only be set to the asset name when calling enterTrade().
Thanks for the clarification!

Re: enterTrade documentation [Re: AndrewAMD] #480843
07/18/20 09:26
07/18/20 09:26
Joined: Jul 2000
Posts: 27,307
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,307
Frankfurt
>>The NFA plugins have GET_POSITION - are you referring to the non-NFA plugins?<<

No, I was referring to a planned command that passes a list of TRADE pointers and gets all open positions on the account. They can then be converted to open trades similar to the trade resuming mechanism. GET_POSITION would not work for positions of unknown type, such as options, because you needed to know the strike and expiration for generating the symbol.

Re: enterTrade documentation [Re: jcl] #480858
07/19/20 20:41
07/19/20 20:41
Joined: Feb 2017
Posts: 1,067
Chicago
AndrewAMD Online OP
Serious User
AndrewAMD  Online OP
Serious User

Joined: Feb 2017
Posts: 1,067
Chicago
Originally Posted by jcl
No, I was referring to a planned command that passes a list of TRADE pointers and gets all open positions on the account. They can then be converted to open trades similar to the trade resuming mechanism. GET_POSITION would not work for positions of unknown type, such as options, because you needed to know the strike and expiration for generating the symbol.
This sounds interesting! I look forward to this.


Moderated by  aztec, Inestical, Matt_Coles, Tobias 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1