NexusFi: Find Your Edge


Home Menu

 





Draw Box around bar pattern


Discussion in NinjaTrader

Updated
    1. trending_up 2,716 views
    2. thumb_up 5 thanks given
    3. group 2 followers
    1. forum 2 posts
    2. attach_file 1 attachments




 
Search this Thread
  #1 (permalink)
 
Slipknot511's Avatar
 Slipknot511 
Springfield,Missouri, USA
 
Experience: Advanced
Platform: NinjaTrader (It's a love/hate relationship)
Trading: CL, TF, 6E
Posts: 169 since May 2010
Thanks Given: 60
Thanks Received: 315

I'd like some assistance to get me started with an indicator.
I use range bars and would like an indicator that would draw a box whenever X number of bars form with less than Y range(ticks). COBC=true. I would like it to update as more bars meet the criteria.
I would like X & Y to be user selectable.
That's it.
Attached is an example where X=6 and Y=6.


Attached Images
 
Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Day 96 Missiles Hit Kuwait and Bahrain: June 15 Peace at …
Prediction Markets & Event Contracts
Victory Day Delivers: Russia-Ukraine Ceasefire Market Cl …
Prediction Markets & Event Contracts
Thursday May 28: GDP + Core PCE + Jobless Claims All at …
Traders Hideout
Hormuz Normalization Collapses to 19.5% -- Iran Regime F …
Prediction Markets & Event Contracts
CFTC Approves First US Bitcoin Perpetual Futures -- Kals …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
8 thanks
Darmok and Jalad at Tanagra
3 thanks
  #3 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Legendary Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Interactive Brokers
Trading: Futures & Stocks
Posts: 9,887 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,117



Slipknot511 View Post
I'd like some assistance to get me started with an indicator.
I use range bars and would like an indicator that would draw a box whenever X number of bars form with less than Y range(ticks). COBC=true. I would like it to update as more bars meet the criteria.
I would like X & Y to be user selectable.
That's it.
Attached is an example where X=6 and Y=6.

To draw the box you can use the NinjaScript method DrawRectangle(). DrawRectangle() has a fill color, but you can set that to transparent.

For the box you need to enter

(1) a tag
(2) start and end position as defined by the bars
(3) high and low

(1) For the tag use any combination of letter + an integer startBar, for example "tag"+startBar. As you want to update the box, when the number of bars increases, the integer startBar should not change, but contain the CurrentBar value for the first bar of the pattern.

(2) Depends on your condition.

(3) I would use MAX and MIN over the lookback period and add a margin to draw the box a little above the high and below the low. The margin can be defined as a multiple of ATR(14). This way it will autoadjust to the bar volatility.


Reply With Quote




Last Updated on March 25, 2011


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts