I use TradeStation and Ninja Trader. I found the following code for something called Volume Ratio. I'm thinking that this is an indicator that comes with their standard package. Can someone tell me if something exists like this for ninja? This seems like a great indicator. It was very easy to see the volume divergence on ES today.. see screenshot. 2010-03-25_1423
Here is the code for the indicator...
Last edited by sam028; March 26th, 2010 at 05:10 PM.
I know Ninja, I don't know TS. There are versions similar to this for Ninja (but without the alerts). I say similar because I don't understand how TS defines an uptick verus a downtick....knowing this defintion defines the behavior of the indicator. For example is an uptick defined as a sale at or above the ASK or is an uptick simply above the last sale - or something other? Another consideration is the tic value based on trades (number of orders ) or on contracts/trade (this is what typical volume is, total number of contracts)...for example 1 trade can be for 10 contracts - so does TS use a value of 1 or a value of 10 when it adjusts the the uptick or downtic variables? The term tic gets used interchangeably here.
I have created a number of indicators for Ninja focused on this. One simply overrides the OnMarketData method to access this level of information. You then decide how you want to accumulate the values based on your defined logic.
The logic within this TS code looks to be: defines alert factors based on +-5%, define totaltics as uptics+downtics, the volume ratio is defined as ((uptics-downtics)/totaltics ) normalized to fit in a +-100 value range, this is calculated for each bar and averaged over a 14 bar period to smooth out spikes. Gradient color is applied with + values moving towards blue and - values moving towards red.
I assume the TS XAverage is an eXpoential average?
if I read this correctly, it would be relatively easy to duplicate in ninjascript, but I am certain there are similar version in the indicator download area of the support forum.