Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bill Williams Awesome Oscillator - TwinPeaks Strategy

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

    Bill Williams Awesome Oscillator - TwinPeaks Strategy




    Twin peaks signals

    A buy (sell) signal called the Twin Peaks buy (sell) signal is generated when the histogram is lower (higher) than the zero line, and the last indicator's bottom is higher (last indicator's top is lower) than the preceding one. Between these two bottoms (tops) the histogram can never be higher (lower) than zero:


    The Awesome Oscillator Twin Peaks signal


    The Twin Peaks buy signal is the only buy signal that is created below the zero line. Similarly, the Twin Peaks sell signal is the only sell signal that is created above the zero line.

    Place a Buy Stop (Sell Stop) one tick higher than the top (lower than the bottom) of the signal bar. In the case of a buy signal, histogram “C” bar (a signal one) is always green, otherwise it is red.

    Never buy on a red histogram bar and never sell on a green one. If an “unfriendly” histogram bar occurs before the execution of a pending order, which was placed in the direction of the Awesome Oscillator signal, the signal has to be ignored and the order has to be deleted.


    ================================================== =======

    PLEASE correct me if my code is wrong;

    To create this in NinjaTrader using the bwAO indicator posted elsewhere on this forum,

    PHP Code:
          protected override void Initialize()
            {
                Add(bwAO());
                CalculateOnBarClose = true;
            }
    
            /// <summary>
            /// Called on each bar update event (incoming tick)
            /// </summary>
            protected override void OnBarUpdate()
            {
                // Condition set BUY -- LastBar Red, CurrentBar Green, Value Below 0
                if ( bwAO().AOValue[0] < BuyBelow  &&  bwAO().AONeg[1] < 0  &&  bwAO().AOPos[0] < 0)
                {
                    EnterLong(LotSize, "");
                }
                if ( bwAO().AOValue[0] > SellAbove  && bwAO().AOPos[1] > 0  &&  bwAO().AONeg[0] > 0 )
                {
                    ExitLong();
                }
            } 
    
    BUY when Red switches to Green below BuyBelow (double).

    SELL when Green switches to Red above SellAbove (double)



    One problem I have had is that the code above arbitrarily sells at the zero line. This may be due to the code in the indicator which states;


    PHP Code:
    if(FirstTickOfBar)
                    ao1=ao;
                AOValue.Set(ao); 
    
    Questions:

    1. is the code above correct for buy and sell (positive and negative) ?
    2. how do I avoid selling prematurely at the zero line ? (I tried adding: && bwAO().AOValue[0] != 0 to the Sell Condition)
    Last edited by Faspomy; 10-08-2008, 12:35 PM. Reason: fixed an error in the code

    #2
    You only need to check AOValue. You do not need to check AONeg or AOPos. Those plots are there for plotting purposes only and just break up the AOValue into separate plots for the different colors.

    In terms of if your code works or not you will simply need to debug it as per this tip: http://www.ninjatrader-support.com/v...ead.php?t=3418

    Print the values out for the bwAO and see why your sell condition is really evaluating to true. Then you can proceed to adjust it accordingly. Good luck.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      I downloaded the bwAO a few days ago and have been working with it to possibly use as a filter in a strategy. I have printed and evaluated AO Value, Pos and Neg and understand those, but I dont yet understand how to tell if AOPos is rising in red color, or green color...can you help me a little? Also, how do you use it?? on a tick chart, minute, range or other?

      Thanks
      Bob

      Comment


        #4
        Bob,

        If you want to check green or red, check the plot values for AOPos and AONeg respectively.

        If you want to see if it is rising within the green plot or within the red plot, use Rising() or Falling().
        Code:
        if (Rising(bwAO().AOPos)
             // Do something
        Something like that. Above is untested code, but should give you an idea.

        Unfortunately I would not have information on what is important or not on the AO indicator. I would suggest trying to search google to find information on Bill William's system to understand how to use it.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Thanks Josh, will look further...

          BTW, used to live in Boulder.... Loved it.

          Originally posted by NinjaTrader_Josh View Post
          Bob,

          If you want to check green or red, check the plot values for AOPos and AONeg respectively.

          If you want to see if it is rising within the green plot or within the red plot, use Rising() or Falling().
          Code:
          if (Rising(bwAO().AOPos)
               // Do something
          Something like that. Above is untested code, but should give you an idea.

          Unfortunately I would not have information on what is important or not on the AO indicator. I would suggest trying to search google to find information on Bill William's system to understand how to use it.

          Comment


            #6
            can anyone post a recent link to the awesome oscillator file? the old links don't seem to be working.

            Thanks.

            Comment


              #7
              Sure, please check into our sharing section for those - http://www.ninjatrader.com/support/f...awesome&desc=1

              Comment


                #8
                Got it. Thanks

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                649 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                370 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                109 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                573 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                576 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X