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

  • prisonbreaker82
    replied
    RSquezze with sound alert when red dot appears

    Hi,

    Can anyone indicate how to add a sound alert if a red dot (squeeze opportunity) appears in the indicator.

    I thought of adding this

    // Sound
    private bool _redplotalertsoundon;
    private string _redplotalertfilename = "alert1.wav";

    but where should I add the "PlaySound(_redplotalertfilename);" line to execute the audio alert?

    Please find attached indicator.

    Isak
    Attached Files

    Leave a comment:


  • bharatk8
    replied
    is this MT4 code BB with momentum by john carter code available in NT?

    is this MT4 code for BB squeeze with momentum by john carter code available in NT?



    // This indicator is based on a strategy mentioned in John Carter's book, Mastering the Trade. The basic idea
    // behind the strategy is that markets tend to move from periods of low volatility to high volatility and
    // visa versa. The strategy aims to capture moves from low to high volatility. For gauging this he uses two
    // common indicators - Bollinger Bands and Keltner Channels (ok, not so common!). He also uses the Momentum
    // indicator to provide a trade bias as soon as the Bollinger Bands come back outside the Keltner Channels.
    //
    // The Squeeze_Break indicator combines this into a signal indicator and has the following components:
    // 1. A positive green histogram means that the Bollinger Bands are outside the Keltner Channels
    // and the market is lightly to be trending or volatile. The stronger the histogram the stronger
    // the directional price move.
    // 2. A negative red histogram means that the Bollinger Bands are inside the Keltner Channels
    // and the market is lightly to be consolidating. The stronger the red histogram the tighter
    // price action is becoming.
    // 3. Incorporated into the indicator is a Momentum indicator. According to the strategy J. Carter
    // goes long when the Bollinger Bands break outside the Keltner Bands and the Momentum indicator
    // is above the zero line. He goes short when the Momentum indicator is below the zero line on the
    // break.
    // 4. I've also added other indicator info in the top left hand corner to give a broader idea
    // of current market conditions.
    // 5. The indicator provides audio alerts when a potential breakout is occurring.
    //
    // This indicator tends to be better with the larger timeframes. Personally I don't trade on an alert
    // signal alone. It's just a handy tool for warning me of potential breakout trades.
    // ================================================== ================================================== =======

    #property copyright "DesORegan"
    #property link "mailto: oregan_des@..."



    // ====================
    // indicator properties
    // ====================
    #property indicator_separate_window
    #property indicator_buffers 3
    #property indicator_color1 ForestGreen
    #property indicator_color2 Red
    #property indicator_color3 Blue


    // ===================
    // User Inputs
    // ===================
    extern int Boll_Period=20;
    extern double Boll_Dev=2.0;
    extern int Keltner_Period=20;
    extern double Keltner_Mul=1.5;
    extern int Momentum_Period=12;
    extern int Back_Bars=1000;
    extern bool Alert_On=true;
    extern bool On_Screen_Info=true;


    // =========================
    // Buffer Array Declarations
    // =========================
    double Pos_Diff[]; // Pos Histogram
    double Neg_Diff[]; // Neg Histogram
    double Momentum[]; // Momentum Indicator


    // ===========================
    // Internal Array Declarations
    // ===========================
    double Squeeze[]; // Used to track which "i" (index value) is above
    // and below zero line. 0 followed by 1 triggers alert

    // =========================
    // Internal Global Variables
    // =========================

    datetime Last_Alert_Time = 0; // Used to prevent continuous alerts on current bar


    //+----------------------------------------------------------+
    //| Custom indicator initialization function |
    //+----------------------------------------------------------+
    int init()
    {

    IndicatorDigits(4); // indicator value precision


    //======================
    // Indicator Setup
    //======================
    SetIndexStyle(0,DRAW_HISTOGRAM,EMPTY,3);
    SetIndexBuffer(0,Pos_Diff);
    SetIndexStyle(1,DRAW_HISTOGRAM,EMPTY,3);
    SetIndexBuffer(1,Neg_Diff);
    SetIndexStyle(2,DRAW_LINE,STYLE_DOT);
    SetIndexBuffer(2,Momentum);


    // ===================
    // Indicator Labels
    // ===================
    IndicatorShortName("Squeeze_Break (Boll:"+Boll_Period+","+DoubleToStr(Boll_Dev,1)+"; Kelt:"+Keltner_Period+","+DoubleToStr(Keltner_Mul, 1)+";Mom:"+Momentum_Period+")");


    // ====================
    // Array Initialization
    // ====================
    ArrayResize(Squeeze, Back_Bars); // Stores whether histogram is above/below zero line
    ArrayInitialize(Squeeze, 0); // initialises array with 0's




    return(0);
    }




    //+----------------------------------------------------------+
    //| Custom indicator deinitialization function |
    //+----------------------------------------------------------+
    int deinit()
    {

    ObjectsDeleteAll();
    Comment(" ","\n",
    " ","\n",
    " ","\n",
    " ","\n",
    " ");


    return(0);
    }




    //+----------------------------------------------------------+
    //| Custom indicator iteration function |
    //+----------------------------------------------------------+
    int start()
    {

    //=======================
    // Indicator Optimization
    //=======================
    int Counted_Bars = IndicatorCounted();
    if(Counted_Bars < 0) return;
    if(Counted_Bars > 0) Counted_Bars = Counted_Bars - Keltner_Period;
    int limit = Bars - Counted_Bars;


    //=======================
    // On-Screen Information
    //=======================
    if (On_Screen_Info == true)
    {
    double ATR =iATR(Symbol(),PERIOD_D1,14,0);
    double Todays_Range = iHigh(Symbol(),PERIOD_D1,0) - iLow(Symbol(),PERIOD_D1,0);
    double ADX = iADX(Symbol(),0,12,PRICE_CLOSE,MODE_MAIN,0);
    double RSI = iRSI(Symbol(),0,12,PRICE_CLOSE,0);
    double MACD_Main = iMACD(Symbol(),0,12,26,9,PRICE_CLOSE,MODE_MAIN,0);
    double MACD_Signal = iMACD(Symbol(),0,12,26,9,PRICE_CLOSE,MODE_SIGNAL,0 );
    double Sto_Main = iStochastic(Symbol(),0,10,3,3,MODE_SMA,1,MODE_MAIN ,0);
    double Sto_Signal = iStochastic(Symbol(),0,10,3,3,MODE_SMA,1,MODE_SIGN AL,0);


    Comment("----------------------------------------------------------",
    "\nDaily ATR(14): ",ATR," Todays Range: ",Todays_Range,
    "\nADX(12): ",NormalizeDouble(ADX,2)," RSI(12): ",NormalizeDouble(RSI,2),
    "\nMACD(12,26,9): ",MACD_Main,", ",MACD_Signal,
    "\nStochastic(10,3,3): ",NormalizeDouble(Sto_Main,2),", ",NormalizeDouble(Sto_Signal,2),
    "\n----------------------------------------------------------");
    }




    //======================
    // Main Indicator Loop
    //======================

    for(int i = limit; i >= 0; i--) //main indicator FOR loop
    {

    // ======================
    // Indicator Calculations
    // ======================
    double MA_Hi = iMA(Symbol(),0,Keltner_Period,0,MODE_SMA,PRICE_HIG H,i);
    double MA_Lo = iMA(Symbol(),0,Keltner_Period,0,MODE_SMA,PRICE_LOW ,i);
    double Kelt_Mid_Band = iMA(Symbol(),0,Keltner_Period,0,MODE_SMA,PRICE_TYP ICAL,i);
    double Kelt_Upper_Band = Kelt_Mid_Band + ((MA_Hi - MA_Lo)*Keltner_Mul);
    double Kelt_Lower_Band = Kelt_Mid_Band - ((MA_Hi - MA_Lo)*Keltner_Mul);
    double Boll_Upper_Band = iBands(Symbol(),0, Boll_Period,Boll_Dev,0,PRICE_CLOSE, MODE_UPPER,i);
    double Boll_Lower_Band = iBands(Symbol(),0, Boll_Period,Boll_Dev,0,PRICE_CLOSE, MODE_LOWER,i);


    // ======================
    // Buffer Calculations
    // ======================

    Momentum[i] = (Close[i] - Close[i+Momentum_Period]);


    if (Boll_Upper_Band >= Kelt_Upper_Band || Boll_Lower_Band <= Kelt_Lower_Band)
    {
    Pos_Diff[i] = (MathAbs(Boll_Upper_Band - Kelt_Upper_Band)+MathAbs(Boll_Lower_Band - Kelt_Lower_Band));
    Squeeze[i] = 1;
    }
    else
    {
    Pos_Diff[i] = 0;
    }


    if (Boll_Upper_Band < Kelt_Upper_Band && Boll_Lower_Band > Kelt_Lower_Band)
    {
    Neg_Diff[i] = -(MathAbs(Boll_Upper_Band - Kelt_Upper_Band)+MathAbs(Boll_Lower_Band - Kelt_Lower_Band));
    Squeeze[i] = 0;
    }
    else
    {
    Neg_Diff[i] = 0;
    }


    // ======================
    // Trigger Check
    // ======================
    if (Squeeze[i] == 1 && Squeeze[i+1] == 0 && Momentum[i] > 0 && i == 0) // a cross above zero line and Mom > 0
    {
    if (Last_Alert_Time != Time[0])
    {
    if (Alert_On == true) Alert("Alert: Possible Breakout - "+Symbol()+" - "+TimeToStr(TimeLocal()));
    Last_Alert_Time = Time[0];
    ObjectCreate("Breakout"+Time[0],OBJ_ARROW,0,Time[0],Ask);
    ObjectSet("Breakout"+Time[0],OBJPROP_ARROWCODE,1);
    ObjectSet("Breakout"+Time[0],OBJPROP_COLOR,Blue);
    ObjectSet("Breakout"+Time[0],OBJPROP_WIDTH,2);
    }
    }


    if (Squeeze[i] == 1 && Squeeze[i+1] == 0 && Momentum[i] < 0 && i == 0 ) // a cross above zero line and Mom < 0
    {
    if (Last_Alert_Time != Time[0])
    {
    if (Alert_On == true) Alert("Alert: Possible Breakout - "+Symbol()+" - "+TimeToStr(TimeLocal()));
    Last_Alert_Time = Time[0];
    ObjectCreate("Breakout"+Time[0],OBJ_ARROW,0,Time[0],Bid);
    ObjectSet("Breakout"+Time[0],OBJPROP_ARROWCODE,1);
    ObjectSet("Breakout"+Time[0],OBJPROP_COLOR,Red);
    ObjectSet("Breakout"+Time[0],OBJPROP_WIDTH,2);
    }
    }



    } // end of main indicator FOR loop






    return(0);
    }

    Leave a comment:


  • FirehawkAZ26
    replied
    RS Squeeze

    Just wanted to add another quick comment ive used the 512 tick chart on the ES and Euro and find it is synced well the YM ( Mini Dow) i find it just does not synce right with it i plan to try it on some other contracts in the futures

    Leave a comment:


  • FirehawkAZ26
    replied
    RS Squeeze

    I myself have been using this indicator for a few years now this is my first time on NT but as far as what time signatures to use the most accurate timing would have to be the 512 tick chart its what john carter from trade the markets originally used im not sure if he still uses it now but i still find it handy for finding a entry set up

    Leave a comment:


  • NinjaTrader_Austin
    replied
    Here is what I've found: http://www.ninjatrader.com/support/f...ad.php?t=12838

    Leave a comment:


  • PipsPlease
    replied
    Thanks, Austin! ...I'll find it sooner or later. ...If anyone has a lead, I'd greatly appreciate it.

    Leave a comment:


  • NinjaTrader_Austin
    replied
    JC, I believe a NinjaTrader version of TTM is floating around the internet somewhere; unfortunately I'm not exactly sure where.

    To answer your questions:
    1) No, NinjaTrader's ATM's work on NT's charts, not on eSignal's charts.
    2) NT displays and charts the exact information it receives from the data provider. It behaves as a radio receiver, more or less. So if Forex.com is your data provider, then yes, NT's charts are a direct feed.

    Leave a comment:


  • PipsPlease
    replied
    Thanks, Bertrand!

    It seems that some of the other clients may have already converted it to Ninja Script; I've yet to see the code, but it may not be 'exactly' what I'm looking for. i.e. identical to the TTM version.

    Two more question's for you, or anyone else trading NT on Forex.com: I'll also be using E-Signal on Forex.com, can I trade the NT ATM on an E-Signal chart, or indicators like the Squeeze on E-Signal? And, are the NT charts a direct feed from Forex.com (like E-Signal)? ...I'm curious to see if when opened at the same time, both NT and E-Signal price action are identical.

    JC

    Leave a comment:


  • NinjaTrader_Bertrand
    replied
    JC, welcome to NinjaTrader and our forums - you could connect to Gain / Forex.com's data in NinjaTrader and then apply the Squeeze indicator developed here in this thread to your charts. The TradeStation indicator code would need to be converted to our NinjaScript programming language first -

    Leave a comment:


  • PipsPlease
    replied
    Can the BB Squeeze be used on Forex.com

    Hello Everyone,

    I'm brand new to Ninja Trader (literally 1 hour), and I hope you can help me out!

    I'll be using NJ on Forex.com, and I was wondering if the BB Squeeze can be used through NJ on Forex.com? If so, is it viewed on NJ's charts or E-Signal (which I have on Forex.com as well)?

    Moreover, I have the ELD code (Tradestation) the Squeeze, and I was wondering if it can work on NJ through Forex.com, or do I have to figure out how to write the script/code myself?

    Thank you in advance for your input!

    JC

    Leave a comment:


  • MoreYummy
    replied
    it is server not found... maybe just my isp?

    Leave a comment:


  • xTrader1
    replied
    Try again. It happened to me either.

    Leave a comment:


  • MoreYummy
    replied
    That site is timed out.

    Leave a comment:


  • xTrader1
    replied
    See Roonius site:

    see:


    Must register.

    Leave a comment:


  • steve11
    replied
    N7 ttm squezze

    Would someone be kind enough to post the n7 zip
    for ttm squezze to run on n7

    thanks

    steve

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by kinfxhk, 07-14-2026, 09:39 AM
0 responses
131 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
88 views
0 likes
Last Post kinfxhk
by kinfxhk
 
Started by kinfxhk, 07-13-2026, 07:21 AM
0 responses
107 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