DYO: Auto color change for Last Price


Q: Can you help me write a DYO that will show the current price in either Green or Orange based on whether the price is on an up tick or a down tick?

A: Here is the solution.  

 
Line A and B will set a Up tick flag to 1 in [241].
Line C and D will reset the flag to 0 on a down tick.
Line E remembers this tick for comparison on the next pass through.
Line E will initialize the paint can to green, but Line F will optionally change it to orange if the directional flag [241] is 0 for a down tick.
Line G puts on the price label in a larger font using the color in the paint can which is green or orange.

This DYO can be downloaded as template using the Internet Services form in Ensign Windows.

Template:    1694-UpDnColor


Last modified 8/7/08 3:48 PM