NexusFi: Find Your Edge


Home Menu

 





rSqueeze for strategy


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one dsraider with 5 posts (14 thanks)
    2. looks_two Big Mike with 3 posts (3 thanks)
    3. looks_3 hawks67 with 3 posts (1 thanks)
    4. looks_4 zeller4 with 2 posts (1 thanks)
      Best Posters
    1. looks_one dsraider with 2.8 thanks per post
    2. looks_two Big Mike with 1 thanks per post
    3. looks_3 zeller4 with 0.5 thanks per post
    4. looks_4 Henrik with 0.5 thanks per post
    1. trending_up 11,161 views
    2. thumb_up 20 thanks given
    3. group 5 followers
    1. forum 15 posts
    2. attach_file 2 attachments




 
Search this Thread

rSqueeze for strategy

  #11 (permalink)
 hawks67 
Chicago, IL
 
Experience: Intermediate
Platform: NinjaTrader
Broker: AGN/Rithmic
Trading: CL
Posts: 22 since Apr 2010
Thanks Given: 14
Thanks Received: 2

I was lucky enough to not even HAVE "using TradingStudies.NinjaScript.Utility;", so I've been able to incorporate my RSqueeze into a strat, but my problem has to do with secondary timeframes.

My normal way of doing things is thusly:

I instantiate a second timeframe indicator. I accomplish this with this line:
Add(PeriodType.Tick,768);
And then I decide to add the Stochastics from that 768-tick chart with this line:
Stochastics my768Stoch = Stochastics(BarsArray[1], 7, 14, 3);
And when I refer to it in the code below, I use "my768Stoch.K[0]". (Note that the number 1 in the BarsArray refers to the second timeframe. If I had a third timeframe and wanted the Stochastics from that chart, this would be a 2.) Works great.

Thing is, I can't seem to accomplish this same thing with the RSqueeze.

If I try this or any possible derivation thereof:
RSqueeze mySqueeze = RSqueeze(BarsArray[1], SqueezeStyle.CounterTrend);
I get this:
'RSqueeze' is a 'namespace' but is used like a 'type'
I have tried every possible combination I can think of, including using the right-click wizard thingy (all I can do with that is Insert Condition anyway), and nothing compiled. I have been able to successfully use the RSqueeze indicator and its values throughout the strategy, but only for the current timeframe (the timeframe on which the strat is run). I'd really like to be able to incorporate the RSqueeze from a secondary timeframe. Any geniuses out there who can give me a hint?

Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
Futures True Range Report
The Elite Circle
NexusFi Journal Challenge - April 2024
Feedback and Announcements
Deepmoney LLM
Elite Quantitative GenAI/LLM
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
Exit Strategy
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
60 thanks
Funded Trader platforms
43 thanks
NexusFi site changelog and issues/problem reporting
24 thanks
GFIs1 1 DAX trade per day journal
22 thanks
The Program
19 thanks
  #12 (permalink)
 zeller4 
Orlando Florida
 
Experience: Intermediate
Platform: NT8
Trading: CL, NQ, ES, RTY
Posts: 477 since Jun 2009
Thanks Given: 1,416
Thanks Received: 404

Definitely not a genius here but try this after looking in the RSqueeze indicator to see what result/value you want.
I could be wrong but I think the reason Stochastic works is it's a built-in.

 
Code

myRSqueezeValue = RSqueeze(Close,SqueezeStyle.BBSqueeze).MyValue[0];
(btw - not tested)

There are several plots in the RSqueeze, I only picked MyValue in case that's one you want.

Kirk

Reply With Quote
Thanked by:
  #13 (permalink)
 hawks67 
Chicago, IL
 
Experience: Intermediate
Platform: NinjaTrader
Broker: AGN/Rithmic
Trading: CL
Posts: 22 since Apr 2010
Thanks Given: 14
Thanks Received: 2


Thanks for the input, Kirk. I'll give it a shot...

Reply With Quote
  #14 (permalink)
 hawks67 
Chicago, IL
 
Experience: Intermediate
Platform: NinjaTrader
Broker: AGN/Rithmic
Trading: CL
Posts: 22 since Apr 2010
Thanks Given: 14
Thanks Received: 2

Actually, that's good for the current chart....but what I'm trying to do is reference the RSqueeze on another timeframe/chart.

Once I add the second timeframe:
Add(PeriodType.Tick,768);
I can instantiate a variable that references it by using BarsArray[1] :
DerivativeOscillator myDO2 = DerivativeOscillator(BarsArray[1], 14, 5, 3, 9);
But I can't get the RSqueeze syntax to compile. It *should* be something like this:
RSqueeze myRSqueeze = RSqueeze(BarsArray[1], (SqueezeStyle.CounterTrend));
or
RSqueeze mySqueeze = RSqueeze(BarsArray[1], RSqueeze(CounterTrend));
or something like it...

Either way, I get this as an error message:
'RSqueeze' is a 'namespace' but is used like a 'type'
And that refers to the RSqueeze in green in the examples above. That part of the syntax (at least!) needs to be something else, and I just can't come up with it.

Reply With Quote
  #15 (permalink)
 
prisonbreaker82's Avatar
 prisonbreaker82 
Rio de Janeiro
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire, IB
Trading: Equity & Futures
Posts: 312 since Jun 2010
Thanks Given: 58
Thanks Received: 141


dsraider View Post
Yep, that was it. Deleting that declaration, which I guess I didn't even need, made Dave much less of a dull boy. For anyone interested in using it in a strat, here's the code:

Uptrend:
&& RSqueeze(SqueezeStyle.BBSqueeze).PMomentumUp[0] > 0
&& RSqueeze(SqueezeStyle.BBSqueeze).PMomentumUp[0] != Close[1]

Downtrend:
&& RSqueeze(SqueezeStyle.BBSqueeze).NMomentumDown[0] < 0
&& RSqueeze(SqueezeStyle.BBSqueeze).NMomentumDown[0] != Close[1]

Squeeze On (blue dots):
&& RSqueeze(SqueezeStyle.BBSqueeze).SqueezeOn[0] == 0

Mike, thanks a lot for your offer to help.

Dave

Hi Dave,

I am very interested in using the Rsqueeze as a strategy. I am not a good programmer.. Can you please send the strategy you have?

Thanks in advance!

Isak

Visit my NexusFi Trade Journal Reply With Quote
  #16 (permalink)
 
Raj1's Avatar
 Raj1 
Toronto
 
Experience: Beginner
Platform: Ninja Trader
Broker: AMP FUTURES/ZENFIRE
Trading: YM
Posts: 130 since Jul 2009
Thanks Given: 253
Thanks Received: 58


dsraider View Post
Yep, that was it. Deleting that declaration, which I guess I didn't even need, made Dave much less of a dull boy. For anyone interested in using it in a strat, here's the code:

Uptrend:
&& RSqueeze(SqueezeStyle.BBSqueeze).PMomentumUp[0] > 0
&& RSqueeze(SqueezeStyle.BBSqueeze).PMomentumUp[0] != Close[1]

Downtrend:
&& RSqueeze(SqueezeStyle.BBSqueeze).NMomentumDown[0] < 0
&& RSqueeze(SqueezeStyle.BBSqueeze).NMomentumDown[0] != Close[1]

Squeeze On (blue dots):
&& RSqueeze(SqueezeStyle.BBSqueeze).SqueezeOn[0] == 0

Mike, thanks a lot for your offer to help.

Dave

@dsraider:
I am trying to get the alerts from Rsqueeze indicaror thro' my Ninja Market Analyser but in vain.
Can you help me to modify this code to use it in my Ninja Market analyser so as to give the Long, Squeeze and Short signals, when value is set @1,0 and -1 respectively.
Appreciate your help.
Raj1

Reply With Quote




Last Updated on September 4, 2013


© 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