TradeStation Volume Ratio - for Ninja 6.5 - NinjaTrader Programming | futures trading

Go Back

> Futures Trading, News, Charts and Platforms > Platforms and Indicators > NinjaTrader > NinjaTrader Programming

TradeStation Volume Ratio - for Ninja 6.5
Started:March 25th, 2010 (02:24 PM) by Todd Views / Replies:2,050 / 2
Last Reply:March 26th, 2010 (12:33 AM) Attachments:0

Welcome to

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • 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, and we will never resell your private information.

-- Big Mike

Thread Tools Search this Thread

TradeStation Volume Ratio - for Ninja 6.5

Old March 25th, 2010, 02:24 PM   #1 (permalink)
Elite Member
Alpharetta, GA
Futures Experience: Intermediate
Platform: ninja
Broker/Data: Mirus / Zenfire
Favorite Futures: ES
Todd's Avatar
Posts: 257 since Jun 2009
Thanks: 28 given, 39 received

TradeStation Volume Ratio - for Ninja 6.5

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.

Here is the code for the indicator...
AvgLength14 ), 
UpVolAlertPct), { UpVol alert if AvgUpVolPct DnVolPct ) > UpVolAlertPct }
DnVolAlertPct( -), { DnVol alert if AvgUpVolPct DnVolPct ) <
DnVolAlertPct }
ColorNormLength14 ), { Number of bars over which to normalize the indicator
for gradient coloring.  See also:  comments in function NormGradientColor. }
UpColorYellow ), { Color to use for indicator values that are relatively high
  over ColorNormLength bars
. }
DnColorCyan ) ;  { Color to use for indicator values that are relatively low
  over ColorNormLength bars
. }
Set either UpColor and/or DnColor to -1 to disable gradient plot coloring.
When disabledPlot1 color is determined by settings in indicator properties
 dialog box
.  Plot2 (ZeroLinecolor always comes from indicator properties
    dialog box
. }
ColorLevel) ;
BarType <= 1 then ie, if tick or minute bars }
UpTicks DownTicks ;
TotalTicks 0 then
100 * ( UpTicks DownTicks ) / TotalTicks 
VolRatio ;
VolRatioAvg XAverageVolRatioAvgLength ) ; 
Plot1VolRatioAvg"VolRatioAvg" ) ;
Plot20"ZeroLine" ) ;
Gradient coloring }
UpColor >= and DnColor >= 0 then
DnColor ) ;
SetPlotColor1ColorLevel ) ;
end ;
Alert criteria }
VolRatioAvg crosses over UpVolAlertPct then
"UpVol alert" )
 else if 
VolRatioAvg crosses under DnVolAlertPct then
"DnVol alert" ) ;

Last edited by sam028; March 26th, 2010 at 05:10 PM.
Reply With Quote

Old March 25th, 2010, 02:24 PM   #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.


Old March 26th, 2010, 12:33 AM   #3 (permalink)
Elite Member
Salt Lake City, UT
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Dormans/Zen-fire
Favorite Futures: 6E ES YM
Posts: 223 since Mar 2010
Thanks: 42 given, 310 received

I've seen similar indicators for this in Ninja

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.

Reply With Quote

Reply > Futures Trading, News, Charts and Platforms > Platforms and Indicators > NinjaTrader > NinjaTrader Programming > TradeStation Volume Ratio - for Ninja 6.5

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

NinjaTrader 8: Programming Profitable Trading Edges w/Scott Hodson

Elite only

Anthony Drager: Executing on Intermarket Correlations & Order Flow, Part 2

Elite only

Adam Grimes: Five critically important keys to professional trading

Elite only

Machine Learning Concepts w/FIO member NJAMC

Elite only

MarketDelta Cloud Platform: Announcing new mobile features

Dec 1

NinjaTrader 8: Features and Enhancements

Dec 6

Similar Threads
Thread Thread Starter Forum Replies Last Post
fractal pivots (tradestation) for ninja trader esam_jir NinjaTrader Programming 11 March 2nd, 2012 09:44 AM
Convert Ninja Indicators to Tradestation daytrader4 The Elite Circle 2 December 15th, 2010 04:16 PM
Indi from Tradestation to Ninja 7.. edi025 NinjaTrader Programming 5 December 11th, 2010 07:42 PM
Get TradeStation talking to Ninja with GV? drmartell Traders Hideout 5 November 1st, 2010 10:48 AM

All times are GMT -4. The time now is 07:24 PM.

Copyright © 2016 by 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 2016-10-26 in 0.08 seconds with 19 queries on phoenix via your IP