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

Re: Color on Histogram solution



PureBytes Links

Trading Reference Links


Pierre, thanks very much for some of the last posts with intersting lessons in EL 
and TS - good thing that we have solved the Y2k patch problem discussion, with 
OR finally coming out of the woods and giving us a rest till next summer.


PO ecrit on some date somewhere in Paris: (free translation from AOLfrench):
> When updating every tick, TS calculates and plot the considered value like
> if the last tick of the "underconstruction bar" was closed with a close
> value that is precisely the last tick value. The above  quoted statement
> is true  only for systems ( where update every tick is impossible)
> 
> No need of  global variable DLL or repainting with the background color.
> Suffice to think on how TS works: The code is executed from top to end.
> The idea it to plot ( plot1 and 2) first with a zero value. Then plot
> again  (plot1 and 2) the colored histogram with the real value MACDD that
> will be updated on every tick, and that will plot over a 0 amplitude
> histogram ( e.g on a clear background).
> 
> Here is the  TS code:
> 
> {
> MaxBarsBack set to 1 ( yes!)


Is that a MUST here ?


> Plot1: green histogram
> plot2: red histogram
> }
> 
> Inputs: FastMA(12),SlowMA(26),MacdMA(9);
> 
> value1=MACD(Close,FastMA,SlowMA)-(XAverage(MACD(Close,FastMA,SlowMA),MacdM
> A)); { Note that the MACD calculation here is not optimized for speed. It
> should be... }


Can you elaborate about the "need for speed optimization". What happens if not 
optimized ? As we all have "powerfull" pcs with lots of rams isnt it simple enough 
to be done straight ?.....what happens with LARGE, heavy codes ? Will it delay 
the display of the PRICE and the INDICATOR ? Something which allways 
bugged me: If I have lots of pages open AND lots of indicators on lots of 
different symbols - DO I see everything "5 seconds" or so later than just open a 
single QUOTE PAGE ????

 > plot1(0,"+");
> plot2(0,"-");     <======reset plot values to 0 before plotting  the MACDD
> values ( erases last bar value)
> 
> if value1>value1[1] then begin
>  plot1(value1,"+");   <=========plots according to MACD climbing
>  end else begin
>  plot2(value1,"-");    <=========plots according to MACD falling
> end;

1) I plot this a bit different (and thats how I understood the ORIGINAL question) 
to see just a NEGATIVE or POSITIVE value better and clearer I plot:

if value1 > 0 then begin   <== just plots if its ABOVE or BELOW
Plot1(value1,"+");
end else begin
plot2(value1,"-");
end;

2) isnt MY stuff more difficult to get colours ok ? - its weekend and I cant test 
REALTIME :-(((

3) Also Im suprised about using the plot statements twice - havent read that in 
OMEGA manual (have I ever read it ? <g>) - is that "common practice" ?

4) THANKS
rgds hans