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

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 zstheorist, Today, 07:52 PM
    0 responses
    7 views
    0 likes
    Last Post zstheorist  
    Started by pmachiraju, 11-01-2023, 04:46 AM
    8 responses
    150 views
    0 likes
    Last Post rehmans
    by rehmans
     
    Started by mattbsea, Today, 05:44 PM
    0 responses
    6 views
    0 likes
    Last Post mattbsea  
    Started by RideMe, 04-07-2024, 04:54 PM
    6 responses
    33 views
    0 likes
    Last Post RideMe
    by RideMe
     
    Started by tkaboris, Today, 05:13 PM
    0 responses
    6 views
    0 likes
    Last Post tkaboris  
    Working...
    X