Hi guys,

I'm currently facing a problem scripting my code.
This is about the retrieving of the right Entering prices of my trades.
I'm working on a portfolio strategy.

In order to get the Enter and Close (or actual) prices I'm using the variables:
- TradePriceOpen
- TradePriceClose

As written in the manual these give the AskPrice of a trade at the moment it was opened.
Also, I know that if I want to get the Bid one I simply have to subtract the Spread of that moment.
BUT, what if I want to obtain this some candels after the trade got opened???
Is there a way to accomplished this?



To work around this issue I also thought of self saving the variable into an array.
But I'm getting stuck again. Here's an extract of the code I'm using:

Code:
assetList("AssetsFix");
int Nasset, N;

for(N = 0; Assets[N]; N++);
Nasset = N;
N=0;

var Spreads[Nasset]; /* Spread Array */


while(asset(loop(Assets))){
	
	Spread[N] = Spread;

	if(/*something happened*/)
		enterLong();
	else
		enterShort();

N++
}




Unluckly when I put "var Spreads[Nasset];" Zorro gives me error frown
If I simply put a static number, it works instead.


Could you please, please, please help to figure this all out??
Thanks you soooooo much!!!

Last edited by kerplunk1899; 10/25/18 14:40.