Login Page - Create Account

Support Board


Date/Time: Sun, 28 Apr 2024 19:43:56 +0000



[Programming Help] - Simple question about help with code for study

View Count: 600

[2017-03-25 21:07:02]
User62936 - Posts: 64
I am trying to color my bars but having trouble with the code. Right now, I have this simple code to alert me when any 5 second bar is greater than 4 ticks in the ES using the Color Bar Based On Alert Condition study. It works well, and this is how it looks and how its coded. (this is on top of a code that I have to color all the bars white, which is what I like on the charts where I have the Historical Market Depth Graph on like in this example)

The problem I'm having is that I'm wanting now to make the down bars red, and up bars green. When I try to split this code up over 2 studies, one for up and have it color green, and one for down and have it color red, I can't get anything to work. I use the first line as before, and add in =AND(O>C) or switch the greater-than sign to less than, and nothing works. Obviously I haven't got a clue, so please be kind and help if you know. :)
imageSH_ Mar. 25, 2017 13.55.49.jpg / V - Attached On 2017-03-25 21:05:18 UTC - Size: 141.02 KB - 258 views
[2017-03-26 01:28:23]
mkata - Posts: 103
Try this:
=AND(O>C,H-L>TICKSIZE*3)

Each condition gets separated by a comma.
[2017-03-26 02:13:53]
User62936 - Posts: 64
Success! Thanks so much. Attached are two screenshots, first with the down bar and the code, and the second with the up bar, complete with also the downbar already programmed running in the second study. (changed to candle chart to make it easier to see)

Do you have code for entering only long just before price is guaranteed to rise, and conversely, shorting just before price goes down? :)
imageSH_ Mar. 25, 2017 19.04.28.jpg / V - Attached On 2017-03-26 02:12:47 UTC - Size: 63.69 KB - 222 views
imageSH_ Mar. 25, 2017 19.08.35.jpg / V - Attached On 2017-03-26 02:12:52 UTC - Size: 75.05 KB - 242 views
[2017-03-26 02:17:19]
User62936 - Posts: 64
Oh, and lastly, here is how it all looks when put together with the Historical Market Depth Graph. Here is a shot from later in the day just as the info must have been coming out about the AHCA delayed vote. Sure makes it much clearer with the colors. Thanks again.
Date Time Of Last Edit: 2017-03-26 02:18:48
imageES-201706-GLOBEX 5 Sec #25 2017-03-25 19_15_43.252.png / V - Attached On 2017-03-26 02:17:02 UTC - Size: 97.71 KB - 204 views

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account