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

code help



PureBytes Links

Trading Reference Links

Would be indebted to anyone who can help with
this code.

Below are first attempts at code (two paint bars).
 
The idea is to manually input a date, say, June 6 
2001. The paint bars should then paint each bar
going forward from [input date] that corresponds 
to a specific number within a series, say, the 
fibonacci series, or whatever number series you 
want to use.  

The problems I am having with the code are:
 
1] The PaintBar for the calendar days version will
only plot one (1) bar -- the first bar in the array.  

2] The PaintBar for the trading days version will 
not plot any bars.

I have made sure that the specified calendar day
is actually visible on the chart, so that's not the
problem.  Any help would be welcomed.

In advance, thanks.

-RNM


EasyLanguage code based on calendar days.  The
following technique assumes the specified calendar 
day is actually visible on the chart.:  

inputs: startdate(eldate(04, 01, 2002)) ; 
arrays: array1[1000](0) ; 
variables: value2(1) ; 

array1[1] = 5 ; 
array1[2] = 10 ; 
array1[3] = 15 ; 
array1[4] = 20 ; 
array1[5] = 25 ; 
array1[6] = 30 ; 

condition1 = false ; 
for value1 = value2 to 1000 begin 
  if array1[value1] = 0 then 
    value1 = 1000 
  else 
  if (date = juliantodate(datetojulian(startdate) +
array1[value1] - 1) then begin 
    value1 = 1000 ; 
    value2 = value1 + 1 ; 
    condition1 = true ; 
  end ; 
end ; 

if condition1 then begin 
  plot1(high, "barhi") ; 
  plot2(low, "barlo") ; 
end ; 

-----------------

EasyLanguage you could based on trading days:
 

inputs: startdate(eldate(04, 01, 2002)) ; 
arrays: array1[1000](0) ; 
variables: value3(1) ; 

array1[1] = 5 ; 
array1[2] = 10 ; 
array1[3] = 15 ; 
array1[4] = 20 ; 
array1[5] = 25 ; 
array1[6] = 30 ; 

if date = startdate then 
  value1 = 1 
else 
  value1 = value1 + 1 ; 

condition1 = false ; 
for value2 = value3 to 1000 begin 
  if array1[value2] = 0 then 
    value1 = 1000 
  else 
  if value1 = array1[value2] then begin 
    value2 = 1000 ; 
    value3 = value3 + 1 ; 
    condition1 = true ; 
  end ; 
end ; 

if condition1 then begin 
  plot1(high, "barhi") ; 
  plot2(low, "barlo") ; 
end ;