NexusFi: Find Your Edge


Home Menu

 





Ninja Range Bars With Accurate Closing Values


Discussion in NinjaTrader

Updated
    1. trending_up 1,825 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?
REcommedations for programming help
Sierra Chart
How to apply profiles
Traders Hideout
Exit Strategy
NinjaTrader
Trade idea based off three indicators.
Traders Hideout
PowerLanguage & EasyLanguage. How to get the platfor …
EasyLanguage Programming
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Just another trading journal: PA, Wyckoff & Trends
25 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
21 thanks
GFIs1 1 DAX trade per day journal
16 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