• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

distance between the open and high

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    distance between the open and high

    Excuse my English please.

    Please, I'd like to know how to program this:
    if in a bar the distance between the open and high is greater than the distance between the close and the minimum of that same bar then the bar is drawn in yellow.
    thank you very much.

    #2
    Hello julifro,
    Thanks for your post.

    You could do this with something similar to the following snippet:

    Code:
    protected override void OnBarUpdate()
    {
    	if ( Math.Abs(Open[0]-High[0]) > (Math.Abs(Close[0]-Low[0])) )
    	{
    		BarBrush = Brushes.Yellow;
    	}			
    }
    For more information on BarBrush, or for a full list of members of the System.Math class please visit the following publicly available links.

    MSDN- Math Class
    https://msdn.microsoft.com/en-us/lib...v=vs.110).aspx

    Help Guide- BarBrush
    https://ninjatrader.com/support/help.../?barbrush.htm

    Please let me know if you have any questions.
    Josh G.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by saltminer, Today, 06:22 PM
    0 responses
    2 views
    0 likes
    Last Post saltminer  
    Started by saltminer, Today, 06:20 PM
    0 responses
    1 view
    0 likes
    Last Post saltminer  
    Started by escobar63, Today, 05:06 PM
    0 responses
    5 views
    0 likes
    Last Post escobar63  
    Started by i2w8am9ii2, Today, 04:41 PM
    0 responses
    5 views
    0 likes
    Last Post i2w8am9ii2  
    Started by Renorail, Today, 03:40 PM
    3 responses
    11 views
    0 likes
    Last Post Renorail  
    Working...
    X