NexusFi: Find Your Edge


Home Menu

 





Skew & Chop Indicator - collaboration invited


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one cclsys with 11 posts (9 thanks)
    2. looks_two cory with 4 posts (0 thanks)
    3. looks_3 Zondor with 2 posts (0 thanks)
    4. looks_4 Big Mike with 1 posts (2 thanks)
    1. trending_up 10,100 views
    2. thumb_up 11 thanks given
    3. group 5 followers
    1. forum 19 posts
    2. attach_file 10 attachments




 
Search this Thread

Skew & Chop Indicator - collaboration invited

  #11 (permalink)
 
cclsys's Avatar
 cclsys 
Sydney, NS
 
Experience: Intermediate
Platform: Ninja
Broker: Zen-Fire
Trading: TF,S,GC
Posts: 605 since Nov 2009
Thanks Given: 248
Thanks Received: 393

Code is attached. Will monitor for a few days to ensure is working properly but pretty sure it is. The only change was the start-end time call for the hvwap.


How the indy works:

There are two aspects.

The first is just plotting the skew, which is the difference between the vwap and the PVP. The vwap is on the chart as the middle line. The PVP is the white hash representing the price (roughly) at which the most volume has traded during the session as defined by the start time.

The second are band lines I added in based on the ATR. I believe the inner bands represent 2* the ATR above/below the current PVP, and the outer lines represent 9*. These might be changed to use Mike's Daily ATR feature. The idea behind the bands was this: often around the PVP there is a lot of backing and filling (which is why that price level becomes the one with the most volume), so this can often be a zone where there is consolidation/stasis. So the bands above/below the PVP are a simplistic attempt to identify graphically when price might be beginning to take off (up or down). The backcolor feature in the indy attempts to highlight when the price is stuck within the inner bands near the PVP showing a potential chop/trading range type situation; but also this can indicate a potential end or change of move after a good swing.

The green line is the difference between the close and the PVP which can be chosen via the first user input.

The PVP 'flips', when the skew changes from positive to negative (gold to cyan in my color scheme) are often very accurate and timely indications of the end of a move and the possible beginning of a change in direction.

This vwap-PVP does not really work as a stand-alone trend determinant. I think the Collective MA is probably better. But they do reveal information that simple MA-type lines, no matter how smartly configured as with the Collective, do not, simply because they are based mainly on volume-at-price versus any relationship between Price [0] and Price[1] in terms of directional bias.

Any ideas for improving this initial Skew Indicator attempt warmly invited. I suspect that it might be helpful for strategy conditions as well as a trading indy. I won't be surprised to learn that somebody else is selling this somewhere, but personally I have never seen it, and I like coming up with new twists on current concepts.

Edit: have added DValueSkew0210c which now has the DailyATR(7) as the Outer Band determinant for the indy, with 2* ATR(37) as the inner bands still. Again, thanks to BM for the coding on the Daily ATR. Also fixed an error in the EndTime which I thought had changed properly but had not. Sorry for any confusion. Have removed the first one.

Of old the skilled first made themselves invincible to await the enemy's vincibility.
Invincibility lies in oneself. Vincibility lies in the enemy.
Thus the skilled can make themselves invincible.
They cannot cause the enemy's vincibility.
Thus it is said: 'Victory can be known; it cannot be made.'
Attached Files
Elite Membership required to download: DValueSkew0210c.zip
Visit my NexusFi Trade Journal Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Deepmoney LLM
Elite Quantitative GenAI/LLM
Better Renko Gaps
The Elite Circle
Online prop firm The Funded Trader (TFT) going under?
Traders Hideout
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
Build trailing stop for micro index(s)
Psychology and Money Management
 
  #12 (permalink)
 
cory's Avatar
 cory 
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,098 since Jun 2009
Thanks Given: 877
Thanks Received: 8,090


Big Mike View Post
Move the start-time and end-time parameter to the Category["Parameters"] and it will be able to be specified by another indicator.

Mike

Where have you been all this time?

Reply With Quote
  #13 (permalink)
 
cclsys's Avatar
 cclsys 
Sydney, NS
 
Experience: Intermediate
Platform: Ninja
Broker: Zen-Fire
Trading: TF,S,GC
Posts: 605 since Nov 2009
Thanks Given: 248
Thanks Received: 393


Noticed that the inner bands don't work with longer-term charts so changed the code to be a multiple of the outer bands which are based on 7-day daily atr.

That should be it.

Default start time is 8.20 because I follow gold.
Default session-length is 23.9 hours (24 doesn't work for some reason).
The default is to exclude weekend sessions but that is perhaps a mistake to leave it like that. Easy to change in the input.

Of old the skilled first made themselves invincible to await the enemy's vincibility.
Invincibility lies in oneself. Vincibility lies in the enemy.
Thus the skilled can make themselves invincible.
They cannot cause the enemy's vincibility.
Thus it is said: 'Victory can be known; it cannot be made.'
Attached Files
Elite Membership required to download: DValueSkew0210d.zip
Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #14 (permalink)
 
Zondor's Avatar
 Zondor 
Portland Oregon, United States
 
Experience: Beginner
Platform: Ninjatrader®
Broker: CQG, Kinetick
Trading: Gameplay Klownbine® Trading of Globex
Posts: 1,333 since Jul 2009
Thanks Given: 1,246
Thanks Received: 2,731

The skew indicator is generating a runtime error in NT7, on tick interval charts.

On a 1,000 tick chart of ES, the OnBarUpdate() method has an unhandled error: on bar 256 barsAgo was 256 but needs to be between 0 and 255. I'll have a look and try to fix it. Most likely a minor problem.

It works fine on a 10 minute chart of ES.

Nice work, and thanks, cclsys and Mike.

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #15 (permalink)
 
cclsys's Avatar
 cclsys 
Sydney, NS
 
Experience: Intermediate
Platform: Ninja
Broker: Zen-Fire
Trading: TF,S,GC
Posts: 605 since Nov 2009
Thanks Given: 248
Thanks Received: 393

An example of a negative skew flip combined with TOD (time of day) in indexes. Now I entered earlier than 3.30 EST just for fun, as soon as flip happened because it happened as soon as I loaded the TF chart.

But it worked nicely although if had waited until Retest-Fail on the 3.30 bar (the ideal setup for this TOD trade marked with orange line and vertical gray line on the 3.30 bar), would have entered higher and not had to wait. The 'floor' often makes a sharp move in price around 3.30 to unwind day-trader positions (those that take positions only for the day and usually exit at the close). So if the market has been up, often they will pull it back down to catch their trailing stops.



Of old the skilled first made themselves invincible to await the enemy's vincibility.
Invincibility lies in oneself. Vincibility lies in the enemy.
Thus the skilled can make themselves invincible.
They cannot cause the enemy's vincibility.
Thus it is said: 'Victory can be known; it cannot be made.'
Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #16 (permalink)
 
cclsys's Avatar
 cclsys 
Sydney, NS
 
Experience: Intermediate
Platform: Ninja
Broker: Zen-Fire
Trading: TF,S,GC
Posts: 605 since Nov 2009
Thanks Given: 248
Thanks Received: 393

I am getting log errors on hvwap now although everything seems to be running fine notwithstanding.

" Failed to restore indicator 'NinjaTrader.Indicator.hVWAP'. Most likely (a) the implementation changed or (b) one or more properties have been renamed or removed or (c) the custom assembly which implements this indicator no longer is there.

hvwap compiles and runs fine.

Of old the skilled first made themselves invincible to await the enemy's vincibility.
Invincibility lies in oneself. Vincibility lies in the enemy.
Thus the skilled can make themselves invincible.
They cannot cause the enemy's vincibility.
Thus it is said: 'Victory can be known; it cannot be made.'
Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #17 (permalink)
 
cclsys's Avatar
 cclsys 
Sydney, NS
 
Experience: Intermediate
Platform: Ninja
Broker: Zen-Fire
Trading: TF,S,GC
Posts: 605 since Nov 2009
Thanks Given: 248
Thanks Received: 393

There is another error msg with hvwap now: the pop-up windows window saying there is a problem with serializing.

The only change I made to original code was to change from "Settings" to "Parameters" as per Mike's guidelines above the start and end time strings.

I have tried to serialize lifting serialization code from Colors but don't know the right lingo (or if it is even possible to serialize strings).

 
Code
[Description("hvwapash2 Start Time. hh:mm:ss (24 hr clock).  If Start Time >= End Time then indicator ends on following day.  Does not span more than 24 hours.")]
        [Category("Parameters")] // changed from "Settings" to make it callable elsewhere. Works, but error in log.
        [Gui.Design.DisplayName("\t\t\t\t\t\tStart Time")]
        public string StartTimeString
        {
            get
            {
                TimeSpan.TryParse(startTimeString, out startTime);
                
                if((startTime.Days > 0) || (startTime.Milliseconds > 0)) TimeSpan.TryParse("00:00:00", out startTime); 
                
                startTimeString = startTime.ToString();
                
                return startTimeString;
            }
            set
            {
                startTimeString = value;
            }
        }
    /*    [Browsable(false)]
        public string StartTimeStringSerialize
        {
            get { return NinjaTrader.Gui.Design.SerializableString(startTimeString); }
            set { startTimeString = NinjaTrader.Gui.Design.SerializableString.FromString(value); }
        }
    */
Any suggestions from anyone as to how to fix this?

Am attaching hwvapAsh2 as something that can be played with without messing up original indy.

Of old the skilled first made themselves invincible to await the enemy's vincibility.
Invincibility lies in oneself. Vincibility lies in the enemy.
Thus the skilled can make themselves invincible.
They cannot cause the enemy's vincibility.
Thus it is said: 'Victory can be known; it cannot be made.'
Attached Files
Elite Membership required to download: hvwapash2.zip
Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #18 (permalink)
 
cory's Avatar
 cory 
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,098 since Jun 2009
Thanks Given: 877
Thanks Received: 8,090

use [ ] not < > ; as far as error in log I loaded dskew into my ES 5m chart and I didn't see any error msg in my log.

Reply With Quote
  #19 (permalink)
 
cclsys's Avatar
 cclsys 
Sydney, NS
 
Experience: Intermediate
Platform: Ninja
Broker: Zen-Fire
Trading: TF,S,GC
Posts: 605 since Nov 2009
Thanks Given: 248
Thanks Received: 393

I am not 100% sure about this but I think the problem is that some of my templates which load in a workspace include hvwap and by changing from Settings to Properties I screwed them up. Because you are right: no error with Skew indy which is referencing a version of hvwap I made (and which has the exact same code as hvwap after my alterations).


Later: no, that's not it. Weird. I actually erased hvwap from my indicators directory (saved elsewhere). None of my current indies reference hvwap (or nothing would compile). And yet the error msg remains. Maybe after rebooting things will be better but for now it's just another one of those endless Ninja mysteries.

Thanks for code tip. Will go and change it now!

Of old the skilled first made themselves invincible to await the enemy's vincibility.
Invincibility lies in oneself. Vincibility lies in the enemy.
Thus the skilled can make themselves invincible.
They cannot cause the enemy's vincibility.
Thus it is said: 'Victory can be known; it cannot be made.'
Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #20 (permalink)
 
masoud's Avatar
 masoud 
canada
 
Experience: Beginner
Platform: ninja
Trading: ES CL
Posts: 48 since Dec 2010
Thanks Given: 19
Thanks Received: 16


Hi CClsys,

What is the news indocator you use in this chart? does it works on NT7?

Thanks,
Masoud


cclsys View Post
An example of a negative skew flip combined with TOD (time of day) in indexes. Now I entered earlier than 3.30 EST just for fun, as soon as flip happened because it happened as soon as I loaded the TF chart.

But it worked nicely although if had waited until Retest-Fail on the 3.30 bar (the ideal setup for this TOD trade marked with orange line and vertical gray line on the 3.30 bar), would have entered higher and not had to wait. The 'floor' often makes a sharp move in price around 3.30 to unwind day-trader positions (those that take positions only for the day and usually exit at the close). So if the market has been up, often they will pull it back down to catch their trailing stops.



Reply With Quote




Last Updated on February 7, 2011


© 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