Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

How to detect pin bars?

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

    How to detect pin bars?

    Hey guys -
    Can anyone tell me how to detect bars like this (i.e. Open and Close in top 30% with long tail)?
    Thank you!
    Attached Files

    #2
    Hello PN720,

    You could use the bars OHLC values and some math to do that. To see how big the wick is in a percent against the next lowest value like the close or open you would have to calculate a percent based on the value of the Low and the close price.

    You could potentially do something like getting what percentage the wick is of the whole total of the bar. A total of a bar could be the high minus the low to give a total difference in price. You could then use the Close/open whichever was lowest and subtract the low to get the amount of lower wick. With those two values you could make a percent of the total:

    Code:
    double a = High[0] - Low[0];
    double b = Math.Min(Open[0], Close[0]) - Low[0];
    double c = b/a;
    double d = c*100;
    From quickly plotting this it appears to be working and showing greater percents for bars with long lower wicks. You could use this as a starting point at thinking of directions you wanted to go at determining that with greater accuracy.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by arvidvanstaey, Today, 02:19 PM
    4 responses
    11 views
    0 likes
    Last Post arvidvanstaey  
    Started by samish18, 04-17-2024, 08:57 AM
    16 responses
    60 views
    0 likes
    Last Post samish18  
    Started by jordanq2, Today, 03:10 PM
    2 responses
    9 views
    0 likes
    Last Post jordanq2  
    Started by traderqz, Today, 12:06 AM
    10 responses
    18 views
    0 likes
    Last Post traderqz  
    Started by algospoke, 04-17-2024, 06:40 PM
    5 responses
    47 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X