Search This Blog

Sunday, January 5, 2014

Polynomial Regression Channel Analysis for Ninjatrader

Hello Traders,

The topic for today is the PRC ( Polynomial Regression Channel ).

What is, and how can be used the PRC ?

There are hundreds of sites, mostly mathematical sites where we can get a lot of info about it.

This is a brief summary :

When we have a series of data points ( price bars ) and we want to find a formula that best fits all points of the analyzed data set, we can use a linear regression :

Where Y = a.X + b
( picture from wikipedia )
Linear regression.svg

and it represent all the data points by a straight line.

This is the more elemental and easy to calculate... but with more error.

If we increase the degree of the polynomial to 2, then we get a parabola ;
Where Y = a.X2 + b.X + c
( charts generated with arachnoid page )

This kind of polynomial is always predicting a turning point ( polynomials with odd degree ( 1, 3, 5, etc ) will have the starting point and ending point with same trend )

So, for trading analysis, most people use degree = 3

On the following examples, I am using bigger samples ; 128 data points ( bars )
The PRC line is the gray dot-dashed line, and then I add two Bollinger bands. And the space between them is painted to create a zone:

On this CL 5 Minutes Chart we can see a 1 degree ( straight line ) polynomial calculated over the last 128 bars.


This is a 5 Minutes Gold Chart using a grade 3 polynomial :

So, selecting a big enough sample size and using a 3 degree optimized polynomial, we can create accurate trading zones that we can use on our daily trading.

We can use the PRC approach to any time frame, even a quick tick chart.
But I suggest using more slow and widely used charts, in the range of 5 Minutes or even higher. The most people looking and trading those levels, the better it will work...

On this example, we can see a 150 Ticks Gold Chart, using the levels provided from the 5 Min 3rd degree PRC ( previous chart )



Using the custom Indicator Pack TIS_PRC_OT from The Indicator Store we get the Basic PRC Indicator and its Muti Time Frame Version.

We can apply the TIS_PRC_OT indicator to any of our work charts, any time frame ( range, tick , volume, etc )...it will always calculate the levels from the user defined time frame ( shown in the red box ). By default I use 5 Minutes, but again, we can select any time frame, even non standard types.

One important factor that must be taken into account ;
All the data points of the sample ( 128 on last examples ) are recalculated at each new sample.
That means that the PRC analysis repaints.
This is one of the reasons why it is suggested to use high time frame PRC's to define the levels and use them into a quick day trading chart, where we can get a target in an insignificant number of samples ( bars ) of the original Chart were the PRC was calculated.

Hope this information has been useful for you...
Please let me know if you have any questions...


Best Regards,
Pablo

logo Pablo Maglio The Indicator Store 

Facebook Twitter LinkedIn Blogger Elance  G+  YouTube

Thursday, January 2, 2014

Semi Automatic Systems for Ninjatrader - January 2014

Hello Traders,

Following our plans to upgrade all our PMS Systems to the last version, as shown on PMS_Reversal System for Ninjatrader Upgrade

We are prod to announce that our 3 Setups ; EMA, SRS and Reversal are upgraded to the last version including Position Management and Money Management.

About the PMS Systems
The PMS Systems are an integration of a Setup Indicator and an Entry Technique.
As we know, Ninja do NOT allow to use Chart Trader on a Chart were we have a strategy applied...
To solve that issue, we developed the PMS Systems ; that integrates an indicator and a strategy...

The indicator is applied to the Chart, and it calculates all the trade Setup and Entry Price.

Once the Indicator ( PMS_SRS, PMS_EMA or PMS_Reversal ) is applied to the Chart, we get the following toolbar, with indications of the name of the Setup ( EMA on this example ), Enable Next Long , Enable Next Short and the name of the ATM to be used on Orders.

The Strategy ( with same name as the Indicator ) is applied to Control Center Strategy Tab, not to the chart, so we can use Chart Trader.
The indicator send Entry Price Info to the strategy, and it convert them to orders to be sent to the exchange.
The Orders can then be moved and managed by the user without affecting the strategy.

All the settings are defined in the Indicator. The strategy has no parameters other than the Instrument to trade, and the Account were to send the Orders.

The current version of PMS on all our Setups now include these settings :
  • ATM_Name : default name of ATM. Can be changed from the toolbar
  • Manual Mode : If Long button is enabled, after a fill it gets disabled, so we need to press it again for a new trade. If manual mode is set to false, the button status will remain unchanged after a fill
  • MM_Max_Daily_Loss : It is a negative value. If Daily Loss is equal or greater, the system will not take more trades
  • MM_Max_Daily_Profit : It is a positive value. If Daily Profit is equal or greater, the system will not take more trades
  • Position Manage : If we get a signal while being in the Market we have 4 options : 1=do nothing, 2=Enter New trade, 3=Close current Position, 4=Reverse (default and suggested)
  • Show_PnL : Show Current Daily PnL and Last Trade Result

Please let me know if you have any question...

Best Regards,
Pablo

logo Pablo Maglio The Indicator Store 

Facebook Twitter LinkedIn Blogger Elance  G+  YouTube