Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by M_D. 04/26/24 20:22
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (PeroPero), 788 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Negative prices? [Re: AndrewAMD] #484654
11/24/21 13:31
11/24/21 13:31
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Offline OP
Serious User
AndrewAMD  Offline OP
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
Two other reasons for Zorro to support negative prices:
1) The NYSE tick index (ticker symbol $TICK in TradeStation) has negative numbers half the time. It is commonly used by various day traders.
2) Futures spreads often have negative values.

If I wanted to support these using the current Zorro version, I'd need to perform some strange workarounds.

Re: Negative prices? [Re: AndrewAMD] #484660
11/25/21 10:26
11/25/21 10:26
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Problem is that negative prices have special meanings, such as entry limits or ask/bid distinction. Thus, negative prices would break backwards compatibility.

The solution would be implementing a per-asset price offset. In fact it is already implemented - g->vAssetOffset - but currently undocumented and for a different purpose. I'll check if it can be modified for dealing with negative prices. This is no optimal solution, but would guarantee backwards compatibility.

Re: Negative prices? [Re: jcl] #484662
11/25/21 13:52
11/25/21 13:52
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Offline OP
Serious User
AndrewAMD  Offline OP
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
Originally Posted by jcl
The solution would be implementing a per-asset price offset. In fact it is already implemented - g->vAssetOffset - but currently undocumented and for a different purpose. I'll check if it can be modified for dealing with negative prices. This is no optimal solution, but would guarantee backwards compatibility.
This would be helpful. Thanks.

Earlier, I tried to download from the $TICK symbol via the TradeStation plugin using the Download script, but Zorro immediately complained about invalid prices/ticks.

Re: Negative prices? [Re: AndrewAMD] #484668
11/27/21 14:17
11/27/21 14:17
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Offline OP
Serious User
AndrewAMD  Offline OP
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
Here's an alternative, if it happens to be easier to implement: The date field in the T1 struct is always positive. Maybe an alternative version of the T1 struct can be used, where the date is positive/negative depending on bid/ask, and then the price can be allowed to be negative.

Re: Negative prices? [Re: AndrewAMD] #484718
12/06/21 09:02
12/06/21 09:02
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
We'll use the offset solution. It will be implemented in an upcoming beta version.

Re: Negative prices? [Re: AndrewAMD] #486153
06/13/22 21:20
06/13/22 21:20
Joined: Jun 2022
Posts: 6
B
BigW Offline
Newbie
BigW  Offline
Newbie
B

Joined: Jun 2022
Posts: 6
Originally Posted by AndrewAMD
Two other reasons for Zorro to support negative prices:
1) The NYSE tick index (ticker symbol $TICK in TradeStation) has negative numbers half the time. It is commonly used by various day traders.
2) Futures spreads often have negative values.

If I wanted to support these using the current Zorro version, I'd need to perform some strange workarounds.


On the second point whats the best way to implement futures spreads (that may be negative) and apply indicators to that to trade a specific futures contract?
As a possible workaround, is it possible to use dataParse to extract the negative spread from a CSV (do the spread calc outside of Zorro) and turn that into a series that can in turn be read by indicators?
Is there a sample code snippet anywhere as a guide?
Thank you

Re: Negative prices? [Re: AndrewAMD] #486155
06/14/22 01:34
06/14/22 01:34
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Offline OP
Serious User
AndrewAMD  Offline OP
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago

Page 2 of 2 1 2

Moderated by  Petra 

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