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.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    128 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    74 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    116 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    110 views
    1 like
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    89 views
    0 likes
    Last Post CarlTrading  
    Working...
    X