Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
BB (TTM) Squeeze and PBF Squeeze replica ported to NT
Collapse
X
-
Originally posted by dsraider View PostThanks, guys. Mensat, that link did it. Unfortunately, though, it doesn't seem to want to be coded as per normal. Any tips for getting a strat to recognize momentum and squeeze on/off?
example :
...... Down trend ....
&& RSqueeze(SqueezeStyle.PBFSqueeze).NMomentumDown[0] < 0 // right value
&& RSqueeze(SqueezeStyle.PBFSqueeze).NMomentumDown[0] != Close[0] // any data serie set to Close[0] if this data serie has not right value
&& RSqueeze(SqueezeStyle.PBFSqueeze).SqueezeOn == 0
.... UP trend ...
&& RSqueeze(SqueezeStyle.PBFSqueeze).PMomentumUp[0] > 0
&& RSqueeze(SqueezeStyle.PBFSqueeze).PMomentumUp[0] != Close[0]
Comment
-
mensat, I really appreciate your help but I'm getting the following:
&& RSqueeze(SqueezeStyle.BBSqueeze).PMomentumUp[1] > 0
'SqueezeStyle' is an ambiguous reference between 'TradingStudies.NinjaScript.Utility.SqueezeStyle' and 'RSqueeze.Utility.SqueezeStyle' CS0104 - click for info
The best overloaded method match for 'NinjaTrader.Strategy.Strategy.RSqueeze(RSqueeze.U tility.SqueezeStyle)' has some invalid arguments CS1502 - click for info
Argument '1': cannot convert from 'TradingStudies.NinjaScript.Utility.SqueezeStyle' to 'RSqueeze.Utility.SqueezeStyle' CS1503 - click for info
What I did?Last edited by dsraider; 03-12-2010, 12:00 PM.
Comment
-
Originally posted by dsraider View Postmensat, I really appreciate your help but I'm getting the following:
&& RSqueeze(SqueezeStyle.BBSqueeze).PMomentumUp[1] > 0
'SqueezeStyle' is an ambiguous reference between 'TradingStudies.NinjaScript.Utility.SqueezeStyle' and 'RSqueeze.Utility.SqueezeStyle' CS0104 - click for info
The best overloaded method match for 'NinjaTrader.Strategy.Strategy.RSqueeze(RSqueeze.U tility.SqueezeStyle)' has some invalid arguments CS1502 - click for info
Argument '1': cannot convert from 'TradingStudies.NinjaScript.Utility.SqueezeStyle' to 'RSqueeze.Utility.SqueezeStyle' CS1503 - click for info
What I did?
I don't know.
Try reinstall indicator !?
In section Initialize insert line Add(RSqueeze(SqueezeStyle.PBFSqueeze));
and uncomment other lines with indicator and try compile and see if in strategy chart is RSqueeze indicator.
Comment
-
Originally posted by mensat View PostIn section Initialize insert line Add(RSqueeze(SqueezeStyle.PBFSqueeze));
and uncomment other lines with indicator and try compile and see if in strategy chart is RSqueeze indicator.
Thanks,
Dave
Comment
-
Originally posted by dsraider View Postmensat,
You were absolutely right. Another declaration was causing a conflict. After deleting that (and making a few slight changes), the Squeeze now works. Thanks very much for your help.
Dave
Gary
Comment
-
Originally posted by dsraider View PostHey hawks,
Poor choice of words on my part. The other changes I made had to do with unrelated code. Were you not able to compile using what's posted?
#region Using declarations section as suggested earlier, and I added Add(RSqueeze(SqueezeStyle.PBFSqueeze)); to the
Initialize() section. Just doing this results in a successful compile.
Thing is, I like instantiating my indicators thusly:
CCI myCCI = CCI(BarsArray[0], 45, 200, -200);
so that later I can just do this:
if (myCCI.CCI[0] > x) {do something here}
So my problem here is with instantiating the RSqueeze indicator. I don't have any idea what the variables are (equivalent to the CCI's 45, -200 and 200) that need to be added to this:
RSqueeze myRSQ = RSqueeze(BarsArray[0], RSqueeze(SqueezeStyle.PBFSqueeze) );
If I try to compile with that line in there, I get these error messages, none of which point me towards anything that really helps:
Strategy\Strat768.cs 'RSqueeze' is a 'namespace' but is used like a 'type' CS0118 - click for info
Strategy\Strat768.cs The best overloaded method match for 'NinjaTrader.Strategy.Strategy.RSqueeze(NinjaTrade r.Data.IDataSeries, RSqueeze.Utility.SqueezeStyle)' has some invalid arguments CS1502 - click for info
Strategy\Strat768.cs Argument '2': cannot convert from 'NinjaTrader.Indicator.RSqueeze' to 'RSqueeze.Utility.SqueezeStyle' CS1503 - click for info
Any suggestions? If you could paste a snippet of your strategy code showing how you use the RSqueeze in some sort of a conditional statement, I'd be most grateful...
Comment
-
Unfortunately, most of what you just said is over my head. However, this is what I have:
Code:&& RSqueeze(SqueezeStyle.BBSqueeze).PMomentumDown[2] > 0 && RSqueeze(SqueezeStyle.BBSqueeze).PMomentumDown[2] != Close[2] && RSqueeze(SqueezeStyle.BBSqueeze).PMomentumUp[1] > 0 && RSqueeze(SqueezeStyle.BBSqueeze).PMomentumUp[1] != Close[1] && RSqueeze(SqueezeStyle.BBSqueeze).SqueezeOn[2] == 0 && RSqueeze(SqueezeStyle.BBSqueeze).SqueezeOn[1] == 0
Dave
Comment
-
Originally posted by dsraider View PostUnfortunately, most of what you just said is over my head. However, this is what I have:
Code:&& RSqueeze(SqueezeStyle.BBSqueeze).PMomentumDown[2] > 0 && RSqueeze(SqueezeStyle.BBSqueeze).PMomentumDown[2] != Close[2] && RSqueeze(SqueezeStyle.BBSqueeze).PMomentumUp[1] > 0 && RSqueeze(SqueezeStyle.BBSqueeze).PMomentumUp[1] != Close[1] && RSqueeze(SqueezeStyle.BBSqueeze).SqueezeOn[2] == 0 && RSqueeze(SqueezeStyle.BBSqueeze).SqueezeOn[1] == 0
Dave
Dave, can you please postup your .cs to allow us less code astute to use the indicator in our own strategies as well?
Thanks,
Jon
Comment
-
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by AdamDJ8, Today, 09:18 PM
|
0 responses
1 view
0 likes
|
Last Post
by AdamDJ8
Today, 09:18 PM
|
||
Started by knowmad, Today, 03:52 AM
|
2 responses
26 views
0 likes
|
Last Post
by knowmad
Today, 09:03 PM
|
||
Started by ETFVoyageur, Today, 07:05 PM
|
0 responses
7 views
0 likes
|
Last Post
by ETFVoyageur
Today, 07:05 PM
|
||
Started by Orion815, 05-02-2024, 08:39 AM
|
2 responses
18 views
0 likes
|
Last Post
by Orion815
Today, 06:24 PM
|
||
Started by suroot, 02-25-2017, 04:43 AM
|
11 responses
2,552 views
0 likes
|
Last Post
by Zilvercat
Today, 05:36 PM
|
Comment