NexusFi: Find Your Edge


Home Menu

 





Ninja Range Bars With Accurate Closing Values


Discussion in NinjaTrader

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




 
Search this Thread

Ninja Range Bars With Accurate Closing Values

  #1 (permalink)
 AllenChuck 
Medina Ohio USA
 
Experience: Advanced
Platform: NinjaTrader
Broker: Amp/CQG
Trading: Nasdaq 100
Posts: 4 since Aug 2012
Thanks Given: 1
Thanks Received: 0

Has anyone successfully programmed "Type" Range Bars for Ninja (not as an indicator)?
I have had 2 Ninja contractors working on it for over a week now. We cannot get it to work properly when...
* There are 2 Ticks in a row where they have different prices, and we request 1 tick bars.
For example: tick1=750.1, tick2=750.2, tick3=750.3, tick4=750.4, tick5=750.5, etc.
When a sequence occurs similar to the one above, All of these bars are lumped into 1 big bar instead of several smaller bars. The bar would be similar to 750.1 to 750.5!...when it should be:
bar1=750.1 to 750.2, bar2=750.2 to 750.3, bar3=750.3 to 750.4, bar4=750.4 to 750.5
I started with Ninja's Range Bar "Type" code. "time, open, high, close,...etc." all match the Data Manager!
bar.Time, bar.Open, bar.High, ...etc. are all off by at least 1 bar & usually represent the highest high and lowest low for some unknown time range.
When more than 1 bar in a row has the same price, the bars are programmed & work perfectly.
* Tick1=750.1, Tick2=750.1, Tick3=750.2, Tick4=750.2...This results in a bar from 750.1 to 750.2.
This is guts of the code (this is only 1 of dozens of things we have tried!):
if(high - low >= rangeValue)
{
AddBar(bars, close, close, close, close, time, 0, isRealtime);
}
else
{
UpdateBar(bars, open, high, low, close, time, volume, isRealtime);
}
* All I am trying to do is create Range Bars where the Close is Valid and was Actually Traded!
* The Open Always Equals the previous Bar's Close
* As soon as the bar equals or exceeds the requested bar height
Close that bar & open a new bar where the Open==the previous Close.

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
Exit Strategy
NinjaTrader
NexusFi Journal Challenge - April 2024
Feedback and Announcements
ZombieSqueeze
Platforms and Indicators
Better Renko Gaps
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
61 thanks
Funded Trader platforms
38 thanks
NexusFi site changelog and issues/problem reporting
27 thanks
GFIs1 1 DAX trade per day journal
19 thanks
The Program
18 thanks




Last Updated on January 13, 2013


© 2024 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 - Privacy Policy - Downloads - Top
no new posts