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

Candle body size

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

    Candle body size

    I am trying to build a strategy where a condition of entry is previous bars must have a minimum body length. In other words the open to close is a minimum of ticks. I have tried this
    using the strategy wizard,
    Close[1] +8 * TickSize>Open[1]
    Close[2] +8 * TickSize>Open[2]
    I am thinking this means the close of the previous bar plus 8 ticks is greater than the open of the previous bar etc. I am using this in a short strategy. It's not working as I intended. My intention is to keep out of consolidation areas. I would love to find out what my error is, also if there is an alternate way to get the same results.

    Thanks

    #2
    Hello snotrag12,

    The logic that you have is going to be adding 8 Ticks to the Close price and seeing if it is greater than the open, which would not be quite what you would like. Example of ES: Close[1] Price is 1600 Open[1] Price is 1602.25.

    Close[1] +8 * TickSize = 1602 which is not greater than Open[1] 1602.25.

    For something like this you would need some custom coding or create an Indicator that calculates the Body size for you like the Range Indicator (note the Range Indicator takes the High-Low).
    JCNinjaTrader Customer Service

    Comment


      #3
      Originally posted by snotrag12 View Post
      I am trying to build a strategy where a condition of entry is previous bars must have a minimum body length. In other words the open to close is a minimum of ticks. I have tried this
      using the strategy wizard,
      Close[1] +8 * TickSize>Open[1]
      Close[2] +8 * TickSize>Open[2]
      I am thinking this means the close of the previous bar plus 8 ticks is greater than the open of the previous bar etc. I am using this in a short strategy. It's not working as I intended. My intention is to keep out of consolidation areas. I would love to find out what my error is, also if there is an alternate way to get the same results.

      Thanks
      Your code is doing what you think it should.

      If your logic is not doing as you expect, then you need to clarify your logic. Write down in language what you want to do. After that the coding is usually no longer a difficult issue.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Option Whisperer, Today, 09:55 AM
      1 response
      11 views
      0 likes
      Last Post bltdavid  
      Started by port119, Today, 02:43 PM
      0 responses
      1 view
      0 likes
      Last Post port119
      by port119
       
      Started by Philippe56140, Today, 02:35 PM
      0 responses
      3 views
      0 likes
      Last Post Philippe56140  
      Started by 00nevest, Today, 02:27 PM
      0 responses
      2 views
      0 likes
      Last Post 00nevest  
      Started by Jonafare, 12-06-2012, 03:48 PM
      5 responses
      3,986 views
      0 likes
      Last Post rene69851  
      Working...
      X