Gamestudio Links
Zorro Links
Newest Posts
ZorroGPT
by Grant. 05/23/26 20:53
Issues resuming trades on Demo account
by Martin_HH. 05/22/26 13:31
XTB
by pr0logic. 05/18/26 12:27
Purchase A8 full licence version
by NeoDumont. 05/13/26 20:17
Black Book, 4th edition
by TipmyPip. 05/11/26 08:40
No errors in the command line
by jcl. 05/08/26 10:59
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
1 registered members (Quad), 2,774 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
jayden, liu, Koti, curry, DeepxKalsi
19220 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,100
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,100
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,100
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,100
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