[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Using arrays without barcount limits



PureBytes Links

Trading Reference Links

(I posted this over on the amibroker mesageboards, but there seems to 
be very little activity over there. Would really appreciate it if 
someone could help me)

I would like to use arrays outside of the barcount range, 
For example: 
to load 1000 values into an array
then load these into another array (to be used as an indicator) by 
calling certain array "cells" based on conditions.

I can't seem to be able to use arrays for anything that doesn't fit 
within the 0 to (barcount - 1) limit (which seems to only calculate 
what is on screen) 

Is this possible? or do I need to create a work around using 
delimited strings or something?

This is really annoying me, I've created an indicator, it works fine, 
but it won't work unless I zoom out to allow 1000 bars on screen.


                               I appreciate any help anyone can give.



Here is the code, in case it helps:

"standard" array is defined earlier in the script

//This script will load previously calculated probabilities from file 
and display them in an indicator
probload[1] = 0; //array loaded from file
probability[1] = 0; //indicator array

probfh = fopen( "C:\\probability.csv", "r"); // open file

for (i = 1;i < 1000; i++) 
	{
	test = fgets(probfh); //load row
	test2 = StrToNum(test); //convert to number
	probload[i] = test2; //place in array
	}


   fclose( probfh ); //close file

for ( i=3; i < BarCount; i++) //run through and load probabilities 
based on current price movement
{
	three = ((standard[i-2]) * 100) + ((standard[i-1]) * 10) + 
standard[i]; //last three days moves as value
	probability[i] = probload[three]; //load associated 
probability
}



Plot( probload, "Standard", ParamColor( "Standard Color", 
colorBlue ), ParamStyle("Standard Style", styleHistogram,  maskAll ));