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

Re: [amibroker] Using arrays without barcount limits



PureBytes Links

Trading Reference Links

Hi - Your array size will always be limited to Barcount, but if you add

SetBarsRequired( 100000, 100000 ); // or substitute any number larger than total # of data bars

at the top of your code, charts will use full data arrays instead of QuickAFL mini-arrays and BarCount will be the total number of data bars.

Steve

  ----- Original Message ----- 
  From: Adan Hancock 
  To: amibroker@xxxxxxxxxxxxxxx 
  Sent: Monday, June 12, 2006 6:25 AM
  Subject: [amibroker] Using arrays without barcount limits


  (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 ));