Gamestudio Links
Zorro Links
Newest Posts
New Zorro version 3.11
by madpower2000. 07/16/26 13:49
What are you working on?
by NeoDumont. 07/15/26 16:38
Z9 getting Error 058
by jcl. 07/15/26 15:07
Zorro version 3.0 prerelease!
by madpower2000. 07/14/26 20:11
Accepting new programming clients
by AndrewAMD. 07/14/26 19:32
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
4 registered members (TipmyPip, AndrewAMD, Quad, ukgamer), 1,429 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
riggi89, shuhari, KD1990, Ephraim, Student_64151
19223 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Price is not shifted with PriceOffset #488466
12/09/24 14:06
12/09/24 14:06
Joined: Apr 2023
Posts: 61
V
vicknick Offline OP
Junior Member
vicknick  Offline OP
Junior Member
V

Joined: Apr 2023
Posts: 61
I have asset (Asset C) with negative price. I tried to shift them upwards so that all the price history is positive.

Code
	while(asset(loop("Asset A", "Asset B", "Asset C")))
	{
		if(Asset == "Asset C") PriceOffset = 700;
                .....
        }


However, when I check the price printed in log, Zorro doesn't seem to shift the price upwards, since it only prints the first positive price.
Not sure if the offset usage is wrong.

Re: Price is not shifted with PriceOffset [Re: vicknick] #488472
12/10/24 12:04
12/10/24 12:04
Joined: Jul 2000
Posts: 28,124
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,124
Frankfurt
I believe PriceOffset has a different purpose, it is for correcting historical or live prices that are already delivered with an offset. It affects trading, not the prices themselves. The manual is here misleading. Can you contact Support and send your negative price data? Maybe they will find a solution. For this you won't need a support subscription.

Re: Price is not shifted with PriceOffset [Re: jcl] #488473
12/10/24 13:30
12/10/24 13:30
Joined: Apr 2023
Posts: 61
V
vicknick Offline OP
Junior Member
vicknick  Offline OP
Junior Member
V

Joined: Apr 2023
Posts: 61
Thank you, I will contact support regarding this.

Re: Price is not shifted with PriceOffset [Re: vicknick] #488482
12/18/24 15:26
12/18/24 15:26
Joined: Jul 2000
Posts: 28,124
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,124
Frankfurt
Here is an example for shifting negative price history to the positive range. You must do that before loading the asset, otherwise it has only effect trading and live prioces, but not on historical prices.

Code
function run()
{
	set(PLOTNOW);
	BarPeriod = 1440;
	NumYears = 20;
	assetAdd("ZMeod");
	Detrend = NOPRICE;
	PriceOffset = 1000;
	asset("ZMeod");
}


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1