Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

would this work?

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

    would this work?

    Basically I want to take trades only when my body is bigger than my tailes to limit potential doji type bars.

    would this work?

    candlerange = math.abs(high[0] - low[0])
    candlebody = math.abs(close[0] - open[0])

    if ( candlerange*.33 <= candlebody)

    #2
    Hello ssjaznguy,

    Thanks for your post.

    The if statement will check if the candle's High/Low range is less than 3 times the size of the Open/Close range (candle body.) You may want to flip the equality sign or move the multiplier to the other side but you would be on the right track for ensuring that the candle body range is larger than the high low range times SomeMultiplier.

    Also to note if you are just looking to filter out doji's where Open and Close match, you could check if (Close[0] != Open[0]). If you want to filter where Open High Low and Close match, you can check if (Open[0] != Close[0] && Open[0] != High[0] && Open[0] != Low[0]).

    We look forward to assisting.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by AaronKoRn, Today, 03:05 PM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_Emily  
    Started by zacharydw00, Today, 02:21 PM
    2 responses
    12 views
    0 likes
    Last Post zacharydw00  
    Started by Harvard, Today, 12:01 PM
    2 responses
    13 views
    0 likes
    Last Post Harvard
    by Harvard
     
    Started by DanDaMan, Today, 12:40 PM
    5 responses
    15 views
    0 likes
    Last Post NinjaTrader_Zachary  
    Started by bob999, 02-16-2021, 10:00 AM
    3 responses
    29 views
    0 likes
    Last Post NinjaTrader_Kate  
    Working...
    X