Gapless indicators - NinjaTrader Programming | futures io social day trading
futures io futures trading


Gapless indicators
Updated: Views / Replies:11,935 / 42
Created: by Big Mike Attachments:28

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors – all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you don’t need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 28  
 
Thread Tools Search this Thread
 

Gapless indicators

  #11 (permalink)
Elite Member
italy
 
Futures Experience: Intermediate
Platform: tradestation
Broker/Data: tradestation
Favorite Futures: fesx, es
 
Posts: 14 since Dec 2009
Thanks: 1 given, 7 received

Taming Opening Gaps Examples

The images below show the dramatic difference this approach can make.

In this example of ATR you’ll notice the 14 bars at the session open are artificially high without the “GapLess” code.



It’s the same with PercentR. It takes 14 bars to settle down and return to normal. GL (GapLess) allows PercentR to show a buy signal at the 8th bar of the day which would have been missed on the non-corrected version.



Notice how the Bollinger Band acts at the opening. It gives a false BUY signal on the first bar of the day. The GL version gives a buy signal several bars later, near the relative low of the first twenty bars of the day.



Here’s the GL version of the BB.



You can see the regular RSI gave a false buy signal at the opening bar.

The GL version of RSI gave the first buy signal over twenty bars later near the actual low.



The regular Stochastic is indicating an oversold condition at the market open.

The GL version of the Stochastic indicates the open is overbought and correctly gives a sell signal near the sixth bar of the day.

Reply With Quote
 
  #12 (permalink)
Elite Member
italy
 
Futures Experience: Intermediate
Platform: tradestation
Broker/Data: tradestation
Favorite Futures: fesx, es
 
Posts: 14 since Dec 2009
Thanks: 1 given, 7 received

Taming Opening Gaps -easylanguage

The code for each is included below in GAPLESS.ELD.
It includes %R, ATR, RSI, Fast Stochastics and Bollinger Bands

Attached Files
Register to download File Type: eld 20080601080830GAPLESS.ELD (16.5 KB, 30 views)
Reply With Quote
The following user says Thank You to viki for this post:
 
  #13 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,653 since Mar 2010
Thanks: 4,226 given, 25,601 received
Forum Reputation: Legendary

Restart EMA at Session Begin


I do not think that the approach of subtracting or adding a gap is valid.

Let us take the following example: Yesterday was a down day for ES that closed near the low. The EMA is some points above the close. During the night session ES retraces 38% of the move.

If you adjust for the gap, you will find the EMA above the open, which is higher than the high of the Globex session. I do not think that this makes sense.

A better approach would be resetting the EMA at the begin of the session. Just replace CurrentBar in the EMA formula of the EMA CurrentSessionBar, where CurrentSessionBar is an integer, which is reset to 0 at the begin of the session and increased by 1 with every new bar -> use FirstTickOfBar.

I have used a similar approach for the CurrentSessionVWAP.

It is important not to pollute the new EMA with any price action from yesterday. The same applies, if you want to use an EMA for the NYSE Tick. It simply does not make sense to include any tick readings from the day before.

Reply With Quote
The following 3 users say Thank You to Fat Tails for this post:
 
  #14 (permalink)
Elite Member
italy
 
Futures Experience: Intermediate
Platform: tradestation
Broker/Data: tradestation
Favorite Futures: fesx, es
 
Posts: 14 since Dec 2009
Thanks: 1 given, 7 received

"GapLess" BollingerBand

examples of indicator using "GapLess" code : Bollinger Bands

 
Code
inputs:
    BollingerPrice( Close ),
    TestPriceUBand( Close ),
    TestPriceLBand( Close ),
    Length( 20 ),
    NumDevsUp( 2 ),
    NumDevsDn( -2 ),
    Displace( 0 ) ;

variables:
    Avg( 0 ),
    SDev( 0 ),
    LowerBand( 0 ),
    UpperBand( 0 ),
    Price( 0 );

    // gapless day transitions - John McCormick May 2008
    
Vars:
    RelO(0),        // Relative Open
    RelH(0),        // Relative High
    RelL(0),        // Relative low
    RelC(0),        // Relative Close
    gap(0),            // the opening gap (modified by the gap coefficient)
    GapCoef(1.0),    // Gap Coefficient
    Accum(0);        // The sum of all the daily gaps

if date<>date[1] then 
  begin
    gap        =    GapCoef*(O-C[1]);
    Accum    =    Accum+gap;   
  end;

RelO    =    O-Accum;
RelC    =    C-Accum;
RelH    =    H-Accum;
RelL    =    L-Accum;

// Gapless - end

price = RelC;
If BollingerPrice=open then price = RelO;
If BollingerPrice=high then price = RelH;
If BollingerPrice=low then price = RelL;
Avg = AverageFC( Price, Length ) ;
SDev = StandardDev( Price, Length, 1 ) ;
UpperBand = Avg + NumDevsUp * SDev;
LowerBand = Avg + NumDevsDn * SDev;

if Displace >= 0 or CurrentBar > AbsValue( Displace ) then 
    begin
    Plot1[Displace]( UpperBand + accum, "UpperBand" ) ;
    Plot2[Displace]( LowerBand + accum, "LowerBand" ) ;
    Plot3[Displace]( Avg + accum, "MidLine" ) ;

    { Alert criteria }
    if Displace <= 0 then
        begin
        if TestPriceLBand crosses over LowerBand then
            Alert( "Price crossing over lower price band" ) 
        else if TestPriceUBand crosses under UpperBand then
            Alert( "Price crossing under upper price band" ) ;
        end ;
    end ;


{ ** Copyright (c) 2005 TradeStation Technologies, Inc. All rights reserved. ** 
  ** TradeStation reserves the right to modify or overwrite this analysis technique 
     with each release. ** }

Reply With Quote
The following user says Thank You to viki for this post:
 
  #15 (permalink)
Market Wizard
virginia
 
Futures Experience: Intermediate
Platform: ninja
Favorite Futures: ES
 
cory's Avatar
 
Posts: 5,218 since Jun 2009
Thanks: 628 given, 6,316 received
Forum Reputation: Legendary

some visual of gap chart vs gapless chart

Attached Thumbnails
Gapless indicators-es-12-10-5-min-gap-10_1_2010.jpg   Gapless indicators-es-12-10-5-min-gapless-10_1_2010.jpg  
Reply With Quote
 
  #16 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,653 since Mar 2010
Thanks: 4,226 given, 25,601 received
Forum Reputation: Legendary


cory View Post
some visual of gap chart vs gapless chart

You are kdding.

You do not want to backadjust ES every day. That way you will lose all relevant information on support and resistance, just to get a (useless) moving average.

I do not think that any professional trader would use such a chart.

But on the other hand there are no laws banning the use of gapless charts. And maybe I just do not understand them.

Reply With Quote
The following 2 users say Thank You to Fat Tails for this post:
 
  #17 (permalink)
Market Wizard
virginia
 
Futures Experience: Intermediate
Platform: ninja
Favorite Futures: ES
 
cory's Avatar
 
Posts: 5,218 since Jun 2009
Thanks: 628 given, 6,316 received
Forum Reputation: Legendary


Fat Tails View Post
You are kdding.

You do not want to backadjust ES every day. That way you will lose all relevant information on support and resistance, just to get a (useless) moving average.

I do not think that any professional trader would use such a chart.

But on the other hand there are no laws banning the use of gapless charts. And maybe I just do not understand them.

then maybe this illustration can shine some light on this murky subject

Attached Thumbnails
Gapless indicators-es-12-10-5-min-10_1_2010.jpg   Gapless indicators-mk-2010-10-01-5es.png  
Reply With Quote
 
  #18 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,653 since Mar 2010
Thanks: 4,226 given, 25,601 received
Forum Reputation: Legendary

You lose the following information with a gapless chart

- fib retracements
- support area
- resistance area
- when the gap is closed
- information on yesterday's high, low and close

Losing more than you will gain. That's the reason these charts are barely used.

Attached Thumbnails
Gapless indicators-es-12-10-5-min-01_10_2010.jpg  
Reply With Quote
The following 2 users say Thank You to Fat Tails for this post:
 
  #19 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,240 since Jun 2009
Thanks: 29,352 given, 83,230 received


Fat Tails View Post
You are kdding.

You do not want to backadjust ES every day. That way you will lose all relevant information on support and resistance, just to get a (useless) moving average.

I do not think that any professional trader would use such a chart.

But on the other hand there are no laws banning the use of gapless charts. And maybe I just do not understand them.

I am not trying to create a gapless chart, but a gapless indicator. Instead of an ema 20, for instance, taking 20 bars to catch up on a RTH chart after a big gap, I wanted to experiment with having a gapless EMA that would not be 'lagging' simply because of the gap. In other words, it's a 'smart' ema that could be set to 'ignore' the gap, thereby showing what an EMA 20 would look like (close) if the chart was ETH instead of RTH for the first 20 bars after the open.

Mike

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
 
  #20 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,653 since Mar 2010
Thanks: 4,226 given, 25,601 received
Forum Reputation: Legendary



Big Mike View Post
I am not trying to create a gapless chart, but a gapless indicator. Instead of an ema 20, for instance, taking 20 bars to catch up on a RTH chart after a big gap, I wanted to experiment with having a gapless EMA that would not be 'lagging' simply because of the gap. In other words, it's a 'smart' ema that could be set to 'ignore' the gap, thereby showing what an EMA 20 would look like (close) if the chart was ETH instead of RTH for the first 20 bars after the open.

Mike

This can only be achieved, if the indicator can access the data of the ETH session prior to the start of the RTH session. As far as I have seen, Multicharts also allows to use session times for each instrument.

On option would be to use a session template that starts 2 hours prior to the open. You could then start with a recursive EMA(1) formula and run that up to EMA (20) on the 20th bar. This would come close enough at the session start.

I have used a similar approach with NT 7.0, the only problem was that I used an SMA, which due to its recursive formula produced a significant rounding error. This problem could be solved with the setting MaximumBarsLookback.Infinite, but this is a specific NT problem.

Reply With Quote
The following 2 users say Thank You to Fat Tails for this post:

Reply



futures io > > > > > Gapless indicators

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Which indicators are leading indicators masood Traders Hideout 17 March 3rd, 2013 07:13 PM
Installed indicators all end up looking like RSI indicators! Angelo1 NinjaTrader 4 July 15th, 2011 06:10 AM
Market Analyzer Indicators to Summarize Chart Indicators nirajkrishna The Elite Circle 5 March 18th, 2011 08:13 PM
Indicators, to have them or not to have them?! George Psychology and Money Management 11 September 6th, 2009 11:30 AM
Way too many indicators! ntsst3 Traders Hideout 1 July 31st, 2009 09:19 PM


All times are GMT -4. The time now is 02:36 AM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts
Page generated 2017-12-14 in 0.15 seconds with 20 queries on phoenix via your IP 54.221.76.68