Gamestudio Links
Zorro Links
Newest Posts
freewhyblogelsewhere
by 9489cpjf. 06/03/24 06:06
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,018 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19056 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
for(current_trades) vs for(open_trades) #486442
08/20/22 17:58
08/20/22 17:58
Joined: Aug 2022
Posts: 15
Connecticut USA
W
WaltT Offline OP
Newbie
WaltT  Offline OP
Newbie
W

Joined: Aug 2022
Posts: 15
Connecticut USA
What exactly is the difference between ...
for(current_trades)
and
for(open_trades)
?

As far as I can see, they pretty much do the same things. They both cycle through the list of open and pending trades starting with the first trade. Where is the difference?

Re: for(current_trades) vs for(open_trades) [Re: WaltT] #486443
08/20/22 18:02
08/20/22 18:02
Joined: Feb 2017
Posts: 1,731
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,731
Chicago
for(current_trades) is far more specific.
https://zorro-project.com/manual/en/fortrades.htm

Re: for(current_trades) vs for(open_trades) [Re: AndrewAMD] #486446
08/20/22 18:47
08/20/22 18:47
Joined: Aug 2022
Posts: 15
Connecticut USA
W
WaltT Offline OP
Newbie
WaltT  Offline OP
Newbie
W

Joined: Aug 2022
Posts: 15
Connecticut USA
Okay, so ...

for(current_trades) loops through just the current asset and algo,

while

for(open_trades) loops through all assets and algo, not just current trades.

So what makes a trade open but not necessarily current? What would be an example of an open trade that wasn't current?

Re: for(current_trades) vs for(open_trades) [Re: WaltT] #486447
08/20/22 18:55
08/20/22 18:55
Joined: Feb 2017
Posts: 1,731
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,731
Chicago
You just explained the entire difference between the two. current is for the current asset-algo combination. That is all it means.

Re: for(current_trades) vs for(open_trades) [Re: AndrewAMD] #486449
08/20/22 18:58
08/20/22 18:58
Joined: Aug 2022
Posts: 15
Connecticut USA
W
WaltT Offline OP
Newbie
WaltT  Offline OP
Newbie
W

Joined: Aug 2022
Posts: 15
Connecticut USA
Thanks, but I still don't understand what the difference is between current and open. To me, they seem to mean the same thing. I can't imagine a situation where an open trade wouldn't also be a current trade, and vice-versa. It sounds like current trades are a subset of open trades, but I can't imagine what might be an example of a non-current, open trade.

Last edited by WaltT; 08/20/22 19:02.
Re: for(current_trades) vs for(open_trades) [Re: WaltT] #486450
08/20/22 19:01
08/20/22 19:01
Joined: Feb 2017
Posts: 1,731
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,731
Chicago
Have you completed the workshop from beginning to end? If so, you might remember workshop 6:
https://zorro-project.com/manual/en/tutorial_kelly.htm

Here, two different assets and two algorithms are used. Now, you can select any asset and algo combination in your script and isolate those related trades using current_assets, because it is in reference to the current asset and algo combination.

If you did not complete the workshop, I highly recommend it.

Re: for(current_trades) vs for(open_trades) [Re: WaltT] #486451
08/20/22 19:07
08/20/22 19:07
Joined: Feb 2017
Posts: 1,731
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,731
Chicago
In other words, all current trades are open trades, but only some open trades are current trades.

Re: for(current_trades) vs for(open_trades) [Re: AndrewAMD] #486452
08/20/22 19:45
08/20/22 19:45
Joined: Aug 2022
Posts: 15
Connecticut USA
W
WaltT Offline OP
Newbie
WaltT  Offline OP
Newbie
W

Joined: Aug 2022
Posts: 15
Connecticut USA
That workshop page has some interesting stuff on it, but there are no for loops in the code at all. Nor are there any references on the page to for loops of any kind. So I don't see how that workshop clarifies the difference between "current" and "open" for loops.

I already inferred that current trades in this context appear to be a subset of open trades, so your confirmation of that inference is helpful. Thank you for that.

I also infer that "current" in this context refers to what asset or algo the script is trying to look at specifically. So for example, if a script focuses its attention on all open trades in EURUSD, the current trades would be those EURUSD open trades, while non-current trades would be open trades in other investment instruments besides EURUSD.

However, I don't see anything in the two functions as described in the manual that tell me how exactly to instruct the script to differentiate between them by focusing on EURUSD. Maybe the functions draw an inference from the context of the script in some way?

So far, it feels more like "magic" than programming. Since magic is technology that isn't fully understood, I'm trying to understand it.

Last edited by WaltT; 08/20/22 19:47.
Re: for(current_trades) vs for(open_trades) [Re: WaltT] #486453
08/20/22 20:16
08/20/22 20:16
Joined: Feb 2017
Posts: 1,731
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,731
Chicago
I really don't know what you're confused about. You call asset("ASSETNAME"), then algo("ALGONAME"), then for(current_assets), and inside that loop will be trades related to the "ASSETNAME"-"ALGONAME" combination. Then you can access the trade variables listed here:
https://zorro-project.com/manual/en/trade.htm

Any questions?

Re: for(current_trades) vs for(open_trades) [Re: AndrewAMD] #486454
08/20/22 20:40
08/20/22 20:40
Joined: Aug 2022
Posts: 15
Connecticut USA
W
WaltT Offline OP
Newbie
WaltT  Offline OP
Newbie
W

Joined: Aug 2022
Posts: 15
Connecticut USA
Okay, so you just confirmed my suspicion that for(current_trades) works contextually, based upon the asset and algo calls. Thank you for that.

I'm guessing also that if I used for(open_trades) instead of for(current_trades), it wouldn't pay any attention to the context the script established by calling asset and algo.

Thanks for clarifying.

Last edited by WaltT; 08/20/22 20:42.

Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1