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 fx.practic, 10-15-2013, 12:53 AM
    5 responses
    5,404 views
    0 likes
    Last Post Bidder
    by Bidder
     
    Started by Shai Samuel, 07-02-2022, 02:46 PM
    4 responses
    95 views
    0 likes
    Last Post Bidder
    by Bidder
     
    Started by DJ888, Yesterday, 10:57 PM
    0 responses
    8 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by MacDad, 02-25-2024, 11:48 PM
    7 responses
    159 views
    0 likes
    Last Post loganjarosz123  
    Started by Belfortbucks, Yesterday, 09:29 PM
    0 responses
    8 views
    0 likes
    Last Post Belfortbucks  
    Working...
    X