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

todays current close to yesterdays EOD close



PureBytes Links

Trading Reference Links

Hi 

I am tring to get a net change for todays real time prices compared to
yesterdays EOD close.
Am trying to make a index (like the SPX)  of my portfolio.

I have the data streams in Data1 to Data 3.
And am planning to increase it to Data 20.

eg.

Time     Todays Close       Yesterdays close      Net change
0930          1,100                     1,000                  + 100          
1000            950                      1,000                  -    50       
1030          1,200                     1,000                   + 200         
1100          1,300                     1,000                   + 300         

Is there a way to write Value1 & Value2 without wasting these variables.
( Only Value1 to 50 can be used ). The indicator below will verify.

Thanks

Frank
===============================================


Input:

{
Price2(Close of Data2),
}

Len1(5),
len2(8);

If D > D[1] then
Value1 = C[1] ;
Value2 = (C - Value1) ;

If D > D[1] then
Value3 = C[1] of Data2;
Value4 = (C of Data2 - Value3) ;


If D > D[1] then
Value5 = C[1] of Data3;
Value6 = (C of Data3 - Value5) ;

Value60 =  + Value2 +Value4 +  Value6  ;

Plot1(WAverage(Value60,Len1),"AvgWgh1");
Plot2(WAverage(Value60,Len2),"AvgWgh2");