Gamestudio Links
Zorro Links
Newest Posts
Camera always moves upwards?
by clonman. 11/13/25 14:04
brokerCommand PLOT_HLINE parameters
by M_D. 11/13/25 10:42
ZorroGPT
by TipmyPip. 11/10/25 11:04
Training with the R bridge does not work
by frutza. 11/05/25 00:46
Zorro 2.70
by opm. 10/24/25 03:44
Alpaca Plugin v1.4.0
by TipmyPip. 10/20/25 18:04
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
5 registered members (Grant, AndrewAMD, ozgur, Quad, TipmyPip), 29,980 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sheliepaley, Blueguy, blobplayintennis, someone2, NotEBspark
19177 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,029
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

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

Chief Engineer
jcl  Offline

Chief Engineer

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