PDA

View Full Version : Help with RSI Plot


shm000
10-29-2008, 05:51 AM
Hi,
I'd like to plot RSI on a +50 to -50 scale instead of the traditional 100 to 0 so I can overlay it on top of a second osscilator. Can you help with this programming logic or point me to an example?

Thank in advance

NinjaTrader_Ben
10-29-2008, 08:14 AM
Hello,

Try something like this:

double temp_rsi = RSI(my_period, my_smoothing)[0];

if(temp_rsi ==0)
{
my_plot.Set(temp_rsi);
}
else
{
my_plot.Set(temp_rsi / 2);
}

Note: this is untested code, so you will want to test it first.

shm000
10-29-2008, 10:18 AM
Hi Ben,

Althoough the code you sent didn't exactly do what I needed, it definitely pointed me in the right direction and got solved it in about 5 minutes.

Thanks very much!

PS...has anyone to your knowledge ever tried to write the code, or been succesful in writing the code that would calculate the distance to the next pivot point? I'm working on an advanced stategy, and if you know if this would be possible it would help me to know so I can continue working on it or get a consultant.

thanks

NinjaTrader_Ben
10-29-2008, 11:02 AM
Hello,


The calculation itself is simple math. For example R1 - PP.

To get the various pivot values do something like this:

double pp = Pivots(PivotRange.Daily, HLCCalculationMode.DailyBars, 20).PP[0];

This link will help:
http://www.ninjatrader-support.com/HelpGuideV6/Pivots.html

Note this is not tested code, so please test it first.

shm000
10-30-2008, 08:24 AM
I appreciate your direction. I've been able to accopmplish what I wanted to. So thanks. One more quick question and I'll leave you alone.

I am interested in being able to plot, as a histogram, time and sales data for the current bar using the block trade filter feature that the T&S Window supplies. The realtime volume indiactors on the forum do not offer this filtering option. I rerally only care about block volume of certain sizes.

Is this possible? If so, I can't find any info in the help file about. Do you have any suggestions, or a way/code of accessing the T&S data?

Thanks again.

PS..I have almost fully converted over from eSignal to Ninja...and will be absolutely complete if I accomplish this last T&S / Block volume issue. NT is great, and when I do figure this out I will be re-subscribing to the real service

Scott

NinjaTrader_Ben
10-30-2008, 09:26 AM
Hello,


You will want to use OnMarketData() and e.Volume then filter it yourself with your code. This link will help:
http://www.ninjatrader-support.com/HelpGuideV6/OnMarketData.html