Gamestudio Links
Zorro Links
Newest Posts
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
Release 2.68 replacement of the .par format
by Martin_HH. 09/23/25 20:48
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (TipmyPip, alibaba), 15,838 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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: 60
V
vicknick Offline OP
Junior Member
vicknick  Offline OP
Junior Member
V

Joined: Apr 2023
Posts: 60
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,022
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,022
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: 60
V
vicknick Offline OP
Junior Member
vicknick  Offline OP
Junior Member
V

Joined: Apr 2023
Posts: 60
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,022
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

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