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 Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    580 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    335 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    102 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    554 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    552 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X