NexusFi: Find Your Edge


Home Menu

 





What is the difference between bar types RangeAlt and RangeNoGap?


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one RJay with 3 posts (5 thanks)
    2. looks_two aligator with 3 posts (3 thanks)
    3. looks_3 TimeTrade with 1 posts (0 thanks)
    4. looks_4 ThatManFromTexas with 1 posts (0 thanks)
    1. trending_up 2,768 views
    2. thumb_up 8 thanks given
    3. group 2 followers
    1. forum 8 posts
    2. attach_file 2 attachments




 
Search this Thread

What is the difference between bar types RangeAlt and RangeNoGap?

  #1 (permalink)
 
aligator's Avatar
 aligator 
Las Vegas, NV
Legendary Market Wizard
 
Experience: Advanced
Platform: Abacus, Slide Rule, HP-65
Trading: Futures, Stocks, Options
Posts: 3,621 since Aug 2010
Thanks Given: 1,071
Thanks Received: 5,994

What is the difference between bar types RangeAlt and RangeNoGap? Which is better? They seem to produce almost similar bars.

Visit my NexusFi Trade Journal Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
How to apply profiles
Traders Hideout
Trade idea based off three indicators.
Traders Hideout
Better Renko Gaps
The Elite Circle
MC PL editor upgrade
MultiCharts
What broker to use for trading palladium futures
Commodities
 
  #2 (permalink)
 
RJay's Avatar
 RJay 
Hartford, CT. USA
 
Experience: Intermediate
Platform: NinjaTrader
Broker: AMP/CQG, Kinetick
Trading: RTY
Posts: 683 since Jun 2009
Thanks Given: 758
Thanks Received: 787


aligator View Post
What is the difference between bar types RangeAlt and RangeNoGap? Which is better? They seem to produce almost similar bars.

Hi Aligator,

Since one of my creations is involved here, I have an interest. Post some side by side images for discussion. Better yet, post a link to the RangeAlt code. My RangeNoGap is already available in the download area.

RJay

Reply With Quote
  #3 (permalink)
 
aligator's Avatar
 aligator 
Las Vegas, NV
Legendary Market Wizard
 
Experience: Advanced
Platform: Abacus, Slide Rule, HP-65
Trading: Futures, Stocks, Options
Posts: 3,621 since Aug 2010
Thanks Given: 1,071
Thanks Received: 5,994



RJay View Post
Hi Aligator,

Since one of my creations is involved here, I have an interest. Post some side by side images for discussion. Better yet, post a link to the RangeAlt code. My RangeNoGap is already available in the download area.

RJay

Thanks @RJay.

Here is the RangeAlt bar type that I downloaded here on futures.io (formerly BMT) a couple of days ago, can't recall the link.

Just a word of caution; although this bar type has been around quite awhile and the code is fine, somehow it replaced another bar type that I had in the drop-down menu (Seem like it is using the same bar type number as LineBreakWicked in my case, which is missing now)

Attached Files
Elite Membership required to download: RangeAlt7.zip
Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #4 (permalink)
 
RJay's Avatar
 RJay 
Hartford, CT. USA
 
Experience: Intermediate
Platform: NinjaTrader
Broker: AMP/CQG, Kinetick
Trading: RTY
Posts: 683 since Jun 2009
Thanks Given: 758
Thanks Received: 787


aligator View Post
Thanks @RJay.

Here is the RangeAlt bar type that I downloaded here on futures.io (formerly BMT) a couple of days ago, can't recall the link.

Just a word of caution; although this bar type has been around quite awhile and the code is fine, somehow it replaced another bar type that I had in the drop-down menu (Seem like it is using the same bar type number as LineBreakWicked in my case, which is missing now)

RangeAlt Appears to be a simpler, possibly earlier version of range bar. RangeNoGap has all the Updates that are in NT7's current Range bars. See attached code.

ALT Range

if (bars.Instrument.MasterInstrument.Compare(close, bar.Low + rangeValue) > 0)
{
double newClose = bar.Low + rangeValue; // every bar closes either with high or low
UpdateBar(bars, bar.Open, newClose, bar.Low, newClose, time, 0, isRealtime);
AddBar(bars, close, close, close, close, time, volume, isRealtime);
}
else if (bars.Instrument.MasterInstrument.Compare(bar.High - rangeValue, close) > 0)
{
double newClose = bar.High - rangeValue; // every bar closes either with high or low
UpdateBar(bars, bar.Open, bar.High, newClose, newClose, time, 0, isRealtime);
AddBar(bars, close, close, close, close, time, volume, isRealtime);
}
else
UpdateBar(bars, open, (close > bar.High ? close : bar.High), (close < bar.Low ? close : bar.Low), close, time, volume, isRealtime);



RangeNoGap

if (bars.Instrument.MasterInstrument.Compare(close, bar.Low + rangeValue) > 0)
{
int NewBarCount = bars.Count - 2; bool isFirstNewBar = true;double newClose = bar.Low + rangeValue;
UpdateBar(bars, bar.Open, newClose, bar.Low, newClose, time, 0, isRealtime);double newBarOpen = newClose;
while (bars.Instrument.MasterInstrument.Compare(close, newClose) > 0)
{newClose = Math.Min(close, newBarOpen + rangeValue);

AddBar(bars, newBarOpen, newClose, newBarOpen, newClose, time, isFirstNewBar ? volume : 0, isRealtime);

newBarOpen = newClose;NewBarCount = bars.Count - 1;isFirstNewBar = false;
}
}
else if (bars.Instrument.MasterInstrument.Compare(bar.High - rangeValue, close) > 0)
{
int NewBarCount = bars.Count - 2;bool isFirstNewBar = true;double newClose = bar.High - rangeValue;
UpdateBar(bars, bar.Open, bar.High, newClose, newClose, time, 0, isRealtime);double newBarOpen = newClose;
while (bars.Instrument.MasterInstrument.Compare(newClose, close) > 0)
{
newClose = Math.Max(close, newBarOpen - rangeValue);

AddBar(bars, newBarOpen, newBarOpen, newClose, newClose, time, isFirstNewBar ? volume : 0, isRealtime);
newBarOpen = newClose;NewBarCount = bars.Count - 1;isFirstNewBar = false;
}
}
else
UpdateBar(bars, open, high, low, close, time, volume, isRealtime);

Reply With Quote
  #5 (permalink)
 
ThatManFromTexas's Avatar
 ThatManFromTexas 
Houston,Tx
 
Experience: Advanced
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: TF
Posts: 2,265 since Feb 2010
Thanks Given: 1,206
Thanks Received: 4,355


RJay View Post
.... RangeNoGap has all the Updates that are in NT7's current Range bars. ...

@RJay

What is the difference between your RangeNoGap and the standard range bar that comes with NT?

I'm just a simple man trading a simple plan.

My daddy always said, "Every day above ground is a good day!"
Reply With Quote
  #6 (permalink)
 
liquidcci's Avatar
 liquidcci 
Austin, TX
 
Experience: Master
Platform: ninjatrader, r-trader
Trading: NQ, CL
Posts: 866 since Jun 2011
Thanks Given: 610
Thanks Received: 1,091

I think the difference on these bars may be how the deal with the trading open. They may both do the same thing but I think range alt was an alternative bar from the regular range bar that controlled how bars printed on opening gap. Don't quote me on this as I may be wrong.

"The day I became a winning trader was the day it became boring. Daily losses no longer bother me and daily wins no longer excited me. Took years of pain and busting a few accounts before finally got my mind right. I survived the darkness within and now just chillax and let my black box do the work."
Reply With Quote
  #7 (permalink)
 
aligator's Avatar
 aligator 
Las Vegas, NV
Legendary Market Wizard
 
Experience: Advanced
Platform: Abacus, Slide Rule, HP-65
Trading: Futures, Stocks, Options
Posts: 3,621 since Aug 2010
Thanks Given: 1,071
Thanks Received: 5,994


ThatManFromTexas View Post
@RJay

What is the difference between your RangeNoGap and the standard range bar that comes with NT?

Here is a plot of Range, RangeNoGap, and RangeAlt side by side.

Attached Thumbnails
Click image for larger version

Name:	6E 06-12 (4 RangeAlt) _ 6E 06-12 (4 RangeNoGap) _ 6E 06-12 (4 Range)  5_8_2012.png
Views:	303
Size:	40.5 KB
ID:	72888  
Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:
  #8 (permalink)
 
RJay's Avatar
 RJay 
Hartford, CT. USA
 
Experience: Intermediate
Platform: NinjaTrader
Broker: AMP/CQG, Kinetick
Trading: RTY
Posts: 683 since Jun 2009
Thanks Given: 758
Thanks Received: 787


ThatManFromTexas View Post
@RJay

What is the difference between your RangeNoGap and the standard range bar that comes with NT?

Hi TMFT,


Code is virtually identical for both charts except for a few small differences.

There are no price gaps from bar body to bar body with RangeNoGap.

Range bars are programmed to have gaps

A 4 tick Range Bar can require 5 ticks to display a full 4 tick bar.
A 4 tick RangeNoGap only requires 4 ticks to display a full 4 tick bar.

RJay

Reply With Quote
Thanked by:
  #9 (permalink)
 TimeTrade 
Erfurt Germany
 
Experience: Master
Platform: rtMagic, NinjaTrader
Broker: AMP/CQG, IAB
Trading: ES, 6E, FDAX, FGBL
Posts: 338 since Aug 2011
Thanks Given: 54
Thanks Received: 461

RJay has realized a nice NoGap variant with using the "right" RangeSize for switch to th next bar.

While i well only using standard (with possible Gaps) variants, i use a simple logic to realize a variant for switch to the next bar to the next tick when the current tick is on the range border.

 
Code
PseudoCode:
if NextNewBarFlag then NextNewBarFlag=false; AddNewBar; exit;
if outside Range then AddNewBar; exit;
if equal Range then NextNewBarFlag=true;
UpdateBar;
exit;
The advantage of this is:
- its use only real traded prices and give nearly the same optical look comperable with the NoGap variant (its only need 4 ticks, when a Range 4 is selected)
- ~90% its give more as one price on the same level-> the next rangebar open exact and optical nice on the Close of bar before
- ~10% have Gaps, smaller Bars or dont close on the RangeBorder (optical is this not very nice, its shows exact the real live)
- with this logic its give only real traded prices, no zero volumes and/or additional ticks
- if needed its is simple to extend this "NextNewBarFlag" concept with a line for to check the HiLo size and add if not equal the range add one virtual price for realize a dummy tick that give the warranty any range nar has the same size (equal the range)...

I think with the simple NT7 variant, with RJay's 2 variants and this as 4. variant, we have its all combinations with a symetric fixed range period bars defined and differences between all this variants described

Reply With Quote




Last Updated on May 8, 2012


© 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