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

Gen: TS Code Problem



PureBytes Links

Trading Reference Links

RT's,

Hi. There are several TradeStation Functions that allow you to put a line on
an intra-day chart for the daily hi (HighD) and the daily low(LowD). I
wanted an indicator that would show these as well as the MedianPrice(H+L/2).
So I borrowed the code for the HighD and replaced the elements with
MedianPrice that I thought were appropriate as shown below. The problem is
that it doesn't show the MedianPrice accurately and my knowledge of Easy
Language is lacking for a fix. If any of you have a fix or a suggestion
please let me know. Thanks.

Brent

Inputs: DaysAgo(Numeric);
Var: Day1Done(0);
Array: MedArray[50](-1);

If DataCompression < 2 then begin
 If Date > Date[1]  then begin
  Day1Done=Day1Done+1;
  for Value1=50 downto 1 begin
   MedArray[Value1]=MedArray[Value1-1];
  end;
  MedArray[0]=MedianPrice;
 End;
 If Day1Done>0 and MedianPrice < MedArray[0] then MedArray[0]=MedianPrice;
 If DaysAgo<=50 then MedD=MedArray[DaysAgo];
End;