Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

BB (TTM) Squeeze and PBF Squeeze replica ported to NT

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • dsraider
    replied
    Trader.Jon,

    Unfortunately, I have some proprietary stuff in that particular strat, so I can't just post the .cs. The best that I can offer is a point in the right direction. Can you give what I posted a try and let me know what happens?

    Dave

    Leave a comment:


  • Trader.Jon
    replied
    Originally posted by dsraider View Post
    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
    I added the RSqueeze Utility to declarations just like you did but did NOT anything to the initialize section. Everything works fine here. Let me know if this helps.

    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

    Leave a comment:


  • hawks67
    replied
    Rock solid, Dave. I'll give it a try. Thanks for your help.

    Leave a comment:


  • dsraider
    replied
    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
    I added the RSqueeze Utility to declarations just like you did but did NOT anything to the initialize section. Everything works fine here. Let me know if this helps.

    Dave

    Leave a comment:


  • hawks67
    replied
    Originally posted by dsraider View Post
    Hey 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?
    Well, yes and no. I've added using RSqueeze.Utility; to the
    #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...

    Leave a comment:


  • dsraider
    replied
    Hey 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?

    Leave a comment:


  • hawks67
    replied
    Originally posted by dsraider View Post
    mensat,

    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
    dsraider, could you share with us what other declaration was causing a conflict, and what else you may have done along the lines of modifications to the RSqueeze indicator so that it works within a strategy? Thanks much in advance!

    Gary

    Leave a comment:


  • dsraider
    replied
    mensat,

    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

    Leave a comment:


  • dsraider
    replied
    Originally posted by mensat View Post
    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.
    You're a good man for trying to help, sir, but that actually made it worse I know some custom indicators just don't like being coded as is. I must be missing a step somewhere.

    Thanks,
    Dave

    Leave a comment:


  • mensat
    replied
    Originally posted by dsraider View Post
    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?

    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.

    Leave a comment:


  • dsraider
    replied
    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.

    Leave a comment:


  • mensat
    replied
    Originally posted by dsraider View Post
    Thanks, 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?
    This indicator has lot of dataseries ( see on graph with RSqueeze and open data box) and must be coded separately:

    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]

    Leave a comment:


  • dsraider
    replied
    Thanks, 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?

    Leave a comment:


  • mensat
    replied
    Originally posted by dsraider View Post
    mensat, thanks for that tip but I'm now getting: The type or namespace name 'RSqueeze' could not be found (are you missing a using directive or an assembly reference?) and don't see a dll. Am I missing something?

    Thanks,
    Dave

    I had downloaded indicator from this site:



    and don't have any problem !

    Leave a comment:


  • NinjaTrader_Bertrand
    replied
    No, don't think so, should be just a regular zip import then for you...

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by kinfxhk, 07-14-2026, 09:39 AM
0 responses
134 views
0 likes
Last Post kinfxhk
by kinfxhk
 
Started by kinfxhk, 07-13-2026, 10:18 AM
0 responses
106 views
0 likes
Last Post kinfxhk
by kinfxhk
 
Started by kinfxhk, 07-13-2026, 09:50 AM
0 responses
89 views
0 likes
Last Post kinfxhk
by kinfxhk
 
Started by kinfxhk, 07-13-2026, 07:21 AM
0 responses
110 views
0 likes
Last Post kinfxhk
by kinfxhk
 
Started by kinfxhk, 07-11-2026, 02:11 AM
0 responses
88 views
0 likes
Last Post kinfxhk
by kinfxhk
 
Working...
X