Thread: How to code?
View Single Post
  #1033 (permalink)  
Old 06-18-2008, 12:48 PM
mladen's Avatar
mladen mladen is offline
Senior Member
 
Join Date: Oct 2006
Posts: 329
mladen is on a distinguished road
Thumbs up just a thought

That picture from tradestation shows an interesting thing to us complaining at Metatrader problems : basically in tradestation if you are trying to simply apply a color to a current bar it is going to work OK in all the modes (histo, point, cross, ... all the styles tradestation knows) EXCEPT line style. If you try to change the color in a line style the color change is going to lag one bar and in order to make it properly source must be changed (in the case of that picture to something like this
PHP Code:
if Value1>Value1[1then
        SetPlotColor
[1](1,Green)
else    
SetPlotColor[1](1,red); 
meaning, you have to change the color of the PREVIOUS bar
this peace of code also means that you can not change the style from line style because then the color is going to FORECAST the change and thus it will make it a classical case of repainting indicator

so every coding language has its problems, and maybe we should simply find solutions in our environment (solutions are there, all we have to do is to find them out)



Quote:
Originally Posted by graemenash View Post
Basically I'd like it to look like this:
Attached Images
File Type: gif ts lines.gif (6.7 KB, 152 views)

Last edited by mladen; 06-18-2008 at 01:05 PM.
Reply With Quote