NexusFi: Find Your Edge


Home Menu

 





TradeStation Volume Ratio - for Ninja 6.5


Discussion in NinjaTrader

Updated
    1. trending_up 4,368 views
    2. thumb_up 0 thanks given
    3. group 1 followers
    1. forum 2 posts
    2. attach_file 0 attachments




 
Search this Thread

TradeStation Volume Ratio - for Ninja 6.5

  #1 (permalink)
 
Todd's Avatar
 Todd 
Alpharetta, GA
 
Experience: Intermediate
Platform: ninja
Broker: Mirus / Zenfire
Trading: ES
Posts: 234 since Jun 2009
Thanks Given: 28
Thanks Received: 40

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...
 
Code
                            
inputs
 
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
. }
variables:
 
TotalTicks), 
 
VolRatio),
 
VolRatioAvg),
 
ColorLevel) ;
 
if 
BarType <= 1 then ie, if tick or minute bars }
 
begin
 TotalTicks 
UpTicks DownTicks ;
 if 
TotalTicks 0 then
  VolRatio 
100 * ( UpTicks DownTicks ) / TotalTicks 
 
else
  
VolRatio ;
 
VolRatioAvg XAverageVolRatioAvgLength ) ; 
 
Plot1VolRatioAvg"VolRatioAvg" ) ;
 
Plot20"ZeroLine" ) ;
 { 
Gradient coloring }
 if 
UpColor >= and DnColor >= 0 then
  begin
  ColorLevel 
NormGradientColorVolRatioAvgtrueColorNormLengthUpColor,
   
DnColor ) ;
  
SetPlotColor1ColorLevel ) ;
  
end ;
 { 
Alert criteria }
 if 
VolRatioAvg crosses over UpVolAlertPct then
  Alert
"UpVol alert" )
 else if 
VolRatioAvg crosses under DnVolAlertPct then
  Alert
"DnVol alert" ) ;
 
end 

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
MC PL editor upgrade
MultiCharts
Better Renko Gaps
The Elite Circle
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Increase in trading performance by 75%
The Elite Circle
ZombieSqueeze
Platforms and Indicators
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
30 thanks
Spoo-nalysis ES e-mini futures S&P 500
28 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
20 thanks
GFIs1 1 DAX trade per day journal
16 thanks
  #3 (permalink)
 tulanch 
Salt Lake City, UT
 
Experience: Intermediate
Platform: SC, NT, MT
Broker: AMP
Trading: NQ ES YM Bonds
Posts: 265 since Mar 2010
Thanks Given: 50
Thanks Received: 387


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




Last Updated on March 26, 2010


© 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