Loading ...
Sorry, an error occurred while loading the content.

Re: [TOS_thinkscript] Re: Time Line Alert

Expand Messages
  • Nathan Crude
    Great, thanks. :-)
    Message 1 of 28 , May 1, 2011
    View Source
    • 0 Attachment
      Great, thanks. :-)



      On Apr 30, 2011, at 10:02 PM, tradescripter wrote:

       

      Run "On Demand" in the live trading. It replays historical data as if it's live.

      Trade Scripter

      --- Nathan wrote:
      >
      > Is there a way of triggering the sounds over the weekend when the markets are closed ? Just want to test out the 4 different effects...
      >
      > ?
      >
      > Cheers.
      >
      >
      >
      >
      >
      > On Apr 30, 2011, at 11:45 AM, Richard Houser wrote:
      >
      > >
      > > No, and not that I know of. It seems like TOS uses system sounds, but like so many other things about the language, the reference to the sound files seems to be hard coded.
      > >
      > >
      > >
      > > From: TOS_thinkscript@yahoogroups.com [mailto:TOS_thinkscript@yahoogroups.com] On Behalf Of Nathan Crude
      > > Sent: Saturday, April 30, 2011 8:01 AM
      > > To: TOS_thinkscript@yahoogroups.com
      > > Subject: Re: [TOS_thinkscript] Time Line Alert
      > >
      > >
      > >
      > >
      > >
      > > Great, thanks.
      > >
      > >
      > >
      > > Can I add custom wav files for personal audible messages ? Is there a folder where the sounds are kept, for instance ?
      > >
      > >
      > >
      > > Cheers.
      > >
      > >
      > >
      > >
      > >
      > >
      > >
      > >
      > >
      > >
      > >
      > > On Apr 30, 2011, at 8:18 AM, Richard Houser wrote:
      > >
      > >
      > >
      > >
      > >
      > >
      > >
      > >
      > > Try adding:
      > >
      > >
      > >
      > > alert( StartPoint or IntervalPoint, "Hit timeline", Alert.ONCE, Sound.DING );
      > >
      > >
      > >
      > > From: TOS_thinkscript@yahoogroups.com [mailto:TOS_thinkscript@yahoogroups.com] On Behalf Of Nathan Crude
      > > Sent: Saturday, April 30, 2011 5:51 AM
      > > To: TOS_thinkscript@yahoogroups.com
      > > Subject: [TOS_thinkscript] Time Line Alert
      > >
      > >
      > >
      > >
      > >
      > > Hi,
      > >
      > > I have the below code working nice. How can I add an audio alert to it ? So it beeps or uses any wav type file on hitting the time line ?
      > >
      > > input StartTime = 938;
      > > input Interval_In_Minutes = 60;
      > >
      > > def AftrStartTime = secondsFromTime(StartTime-1)>59;
      > > def StartPoint = !AftrStartTime[1] and AftrStartTime;
      > >
      > > def MinutesGoneBy = if AftrStartTime then secondsFromTime(StartTime)/60 else 0;
      > >
      > > def IntervalPast = if AftrStartTime then
      > > roundDown(MinutesGoneBy/Interval_In_Minutes,0) else 0;
      > >
      > > def IntervalPoint=IntervalPast > IntervalPast[1];
      > >
      > > addVerticalLine(StartPoint or IntervalPoint,"33", color.YELLOW);
      > >
      > >
      > >
      > >
      > >
      > >
      > >
      > >
      >


    • Nathan Crude
      What other notification ways are there ? Is there a way to get the message centre to open like it does when TOS send a system message.... ?
      Message 2 of 28 , May 1, 2011
      View Source
      • 0 Attachment
        What other notification ways are there ? Is there a way to get the message centre to open like it does when TOS send a system message.... ?


        On Apr 30, 2011, at 11:45 AM, Richard Houser wrote:

         

        No, and not that I know of. It seems like TOS uses system sounds, but like so many other things about the language, the reference to the sound files seems to be hard coded.

         

        From: TOS_thinkscript@yahoogroups.com [mailto:TOS_thinkscript@yahoogroups.com] On Behalf Of Nathan Crude
        Sent: Saturday, April 30, 2011 8:01 AM
        To: TOS_thinkscript@yahoogroups.com
        Subject: Re: [TOS_thinkscript] Time Line Alert

         

         

        Great, thanks.

         

        Can I add custom wav files for personal audible messages ? Is there a folder where the sounds are kept, for instance ?

         

        Cheers.

         

         

         

         

         

        On Apr 30, 2011, at 8:18 AM, Richard Houser wrote:



         

         

        Try adding:

         

        alert( StartPoint or IntervalPoint, "Hit timeline", Alert.ONCE, Sound.DING );

         

        From: TOS_thinkscript@yahoogroups.com [mailto:TOS_thinkscript@yahoogroups.com] On Behalf Of Nathan Crude
        Sent: Saturday, April 30, 2011 5:51 AM
        To: TOS_thinkscript@yahoogroups.com
        Subject: [TOS_thinkscript] Time Line Alert

         

         

        Hi,

        I have the below code working nice. How can I add an audio alert to it ? So it beeps or uses any wav type file on hitting the time line ?

        input StartTime = 938;
        input Interval_In_Minutes = 60;

        def AftrStartTime = secondsFromTime(StartTime-1)>59;
        def StartPoint = !AftrStartTime[1] and AftrStartTime;

        def MinutesGoneBy = if AftrStartTime then secondsFromTime(StartTime)/60 else 0;

        def IntervalPast = if AftrStartTime then
        roundDown(MinutesGoneBy/Interval_In_Minutes,0) else 0;

        def IntervalPoint=IntervalPast > IntervalPast[1];

        addVerticalLine(StartPoint or IntervalPoint,"33", color.YELLOW);

         

         



      • Nathan Crude
        What other forms of notification are there ? Other than audio. For instance, can a pop window come up by the message centre, with the message centre sound,
        Message 3 of 28 , May 1, 2011
        View Source
        • 0 Attachment
          What other forms of notification are there ? Other than audio.

          For instance, can a pop window come up by the message centre, with the message centre sound, based on something happening in a chart ?




          On Apr 30, 2011, at 11:45 AM, Richard Houser wrote:

           

          No, and not that I know of. It seems like TOS uses system sounds, but like so many other things about the language, the reference to the sound files seems to be hard coded.

           

          From: TOS_thinkscript@yahoogroups.com [mailto:TOS_thinkscript@yahoogroups.com] On Behalf Of Nathan Crude
          Sent: Saturday, April 30, 2011 8:01 AM
          To: TOS_thinkscript@yahoogroups.com
          Subject: Re: [TOS_thinkscript] Time Line Alert

           

           

          Great, thanks.

           

          Can I add custom wav files for personal audible messages ? Is there a folder where the sounds are kept, for instance ?

           

          Cheers.

           

           

           

           

           

          On Apr 30, 2011, at 8:18 AM, Richard Houser wrote:



           

           

          Try adding:

           

          alert( StartPoint or IntervalPoint, "Hit timeline", Alert.ONCE, Sound.DING );

           

          From: TOS_thinkscript@yahoogroups.com [mailto:TOS_thinkscript@yahoogroups.com] On Behalf Of Nathan Crude
          Sent: Saturday, April 30, 2011 5:51 AM
          To: TOS_thinkscript@yahoogroups.com
          Subject: [TOS_thinkscript] Time Line Alert

           

           

          Hi,

          I have the below code working nice. How can I add an audio alert to it ? So it beeps or uses any wav type file on hitting the time line ?

          input StartTime = 938;
          input Interval_In_Minutes = 60;

          def AftrStartTime = secondsFromTime(StartTime-1)>59;
          def StartPoint = !AftrStartTime[1] and AftrStartTime;

          def MinutesGoneBy = if AftrStartTime then secondsFromTime(StartTime)/60 else 0;

          def IntervalPast = if AftrStartTime then
          roundDown(MinutesGoneBy/Interval_In_Minutes,0) else 0;

          def IntervalPoint=IntervalPast > IntervalPast[1];

          addVerticalLine(StartPoint or IntervalPoint,"33", color.YELLOW);

           

           



        • Richard Houser
          The alert function will generate a sound and pop-up a message center alert as well. I don t know if it does the latter using On Demand, but it will during
          Message 4 of 28 , May 1, 2011
          View Source
          • 0 Attachment

            The alert function will generate a sound and pop-up a message center alert as well. I don't know if it does the latter using On Demand, but it will during trading hours.

             

            From: TOS_thinkscript@yahoogroups.com [mailto:TOS_thinkscript@yahoogroups.com] On Behalf Of Nathan Crude
            Sent: Sunday, May 01, 2011 5:37 AM
            To: TOS_thinkscript@yahoogroups.com
            Subject: Re: [TOS_thinkscript] Time Line Alert

             

             

            What other forms of notification are there ? Other than audio.

             

            For instance, can a pop window come up by the message centre, with the message centre sound, based on something happening in a chart ?

             

             

             

             

            On Apr 30, 2011, at 11:45 AM, Richard Houser wrote:



             

             

            No, and not that I know of. It seems like TOS uses system sounds, but like so many other things about the language, the reference to the sound files seems to be hard coded.

             

            From: TOS_thinkscript@yahoogroups.com [mailto:TOS_thinkscript@yahoogroups.com] On Behalf Of Nathan Crude
            Sent: Saturday, April 30, 2011 8:01 AM
            To: TOS_thinkscript@yahoogroups.com
            Subject: Re: [TOS_thinkscript] Time Line Alert

             

             

            Great, thanks.

             

            Can I add custom wav files for personal audible messages ? Is there a folder where the sounds are kept, for instance ?

             

            Cheers.

             

             

             

             

             

            On Apr 30, 2011, at 8:18 AM, Richard Houser wrote:




             

             

            Try adding:

             

            alert( StartPoint or IntervalPoint, "Hit timeline", Alert.ONCE, Sound.DING );

             

            From: TOS_thinkscript@yahoogroups.com [mailto:TOS_thinkscript@yahoogroups.com] On Behalf Of Nathan Crude
            Sent: Saturday, April 30, 2011 5:51 AM
            To: TOS_thinkscript@yahoogroups.com
            Subject: [TOS_thinkscript] Time Line Alert

             

             

            Hi,

            I have the below code working nice. How can I add an audio alert to it ? So it beeps or uses any wav type file on hitting the time line ?

            input StartTime = 938;
            input Interval_In_Minutes = 60;

            def AftrStartTime = secondsFromTime(StartTime-1)>59;
            def StartPoint = !AftrStartTime[1] and AftrStartTime;

            def MinutesGoneBy = if AftrStartTime then secondsFromTime(StartTime)/60 else 0;

            def IntervalPast = if AftrStartTime then
            roundDown(MinutesGoneBy/Interval_In_Minutes,0) else 0;

            def IntervalPoint=IntervalPast > IntervalPast[1];

            addVerticalLine(StartPoint or IntervalPoint,"33", color.YELLOW);

             

             

             

             

          • Nathan Crude
            Ahha, OK. That makes sense, so I can just use the NoSound option then to generate a written Message Centre Alert without a conflicting audio alert.. Great.
            Message 5 of 28 , May 1, 2011
            View Source
            • 0 Attachment
              Ahha, OK. That makes sense, so I can just use the NoSound option then to generate a written Message Centre Alert without a conflicting audio alert.. Great. Thank-you.

              :-)




              On May 1, 2011, at 10:29 AM, Richard Houser wrote:

               

              The alert function will generate a sound and pop-up a message center alert as well. I don't know if it does the latter using On Demand, but it will during trading hours.

               

              From: TOS_thinkscript@yahoogroups.com [mailto:TOS_thinkscript@yahoogroups.com] On Behalf Of Nathan Crude
              Sent: Sunday, May 01, 2011 5:37 AM
              To: TOS_thinkscript@yahoogroups.com
              Subject: Re: [TOS_thinkscript] Time Line Alert

               

               

              What other forms of notification are there ? Other than audio.

               

              For instance, can a pop window come up by the message centre, with the message centre sound, based on something happening in a chart ?

               

               

               

               

              On Apr 30, 2011, at 11:45 AM, Richard Houser wrote:



               

               

              No, and not that I know of. It seems like TOS uses system sounds, but like so many other things about the language, the reference to the sound files seems to be hard coded.

               

              From: TOS_thinkscript@yahoogroups.com [mailto:TOS_thinkscript@yahoogroups.com] On Behalf Of Nathan Crude
              Sent: Saturday, April 30, 2011 8:01 AM
              To: TOS_thinkscript@yahoogroups.com
              Subject: Re: [TOS_thinkscript] Time Line Alert

               

               

              Great, thanks.

               

              Can I add custom wav files for personal audible messages ? Is there a folder where the sounds are kept, for instance ?

               

              Cheers.

               

               

               

               

               

              On Apr 30, 2011, at 8:18 AM, Richard Houser wrote:




               

               

              Try adding:

               

              alert( StartPoint or IntervalPoint, "Hit timeline", Alert.ONCE, Sound.DING );

               

              From: TOS_thinkscript@yahoogroups.com [mailto:TOS_thinkscript@yahoogroups.com] On Behalf Of Nathan Crude
              Sent: Saturday, April 30, 2011 5:51 AM
              To: TOS_thinkscript@yahoogroups.com
              Subject: [TOS_thinkscript] Time Line Alert

               

               

              Hi,

              I have the below code working nice. How can I add an audio alert to it ? So it beeps or uses any wav type file on hitting the time line ?

              input StartTime = 938;
              input Interval_In_Minutes = 60;

              def AftrStartTime = secondsFromTime(StartTime-1)>59;
              def StartPoint = !AftrStartTime[1] and AftrStartTime;

              def MinutesGoneBy = if AftrStartTime then secondsFromTime(StartTime)/60 else 0;

              def IntervalPast = if AftrStartTime then
              roundDown(MinutesGoneBy/Interval_In_Minutes,0) else 0;

              def IntervalPoint=IntervalPast > IntervalPast[1];

              addVerticalLine(StartPoint or IntervalPoint,"33", color.YELLOW);

               

               

               

               



            • Nathan Crude
              Hi, I have the below code for CCI. What do I add to it to be able to set an alert for a given level of CCI... For example, the below code sets levels at -100
              Message 6 of 28 , May 3, 2011
              View Source
              • 0 Attachment
                Hi,

                I have the below code for CCI. What do I add to it to be able to set an alert for a given level of CCI...

                For example, the below code sets levels at -100 and +100, this is fine, but what if I want an audio alert on touching a given number outside of that range, ie -150 or -180, what code would I add to add an alarm for a given level (able to change the alarm level in preferences though) ?

                So its like adding a second line really, with an audio alert on its hit...




                I tried adding

                alert( over_bought or over_sold, Alert.ONCE, Sound.DING );

                But it says "incompatible parameter".



                declare lower;

                input length = 14;
                input over_sold = -100;
                input over_bought = 100;

                def price = close + low + high;
                def linDev = lindev(price, length);
                plot CCI = if linDev == 0 then 0 else (price - Average(price, length)) / linDev / 0.015;
                plot OverBought = over_bought;
                plot ZeroLine = 0;
                plot OverSold = over_sold;

                CCI.setDefaultColor(GetColor(9));
                OverBought.setDefaultColor(GetColor(5));
                ZeroLine.setDefaultColor(GetColor(5));
                OverSold.setDefaultColor(GetColor(5));
              • Richard Houser
                Try this. It s a little more involved than you requested, but I think you ll find it more effective to use, if not strip out what you don t want. declare
                Message 7 of 28 , May 3, 2011
                View Source
                • 0 Attachment

                  Try this. It's a little more involved than you requested, but I think you'll find it more effective to use, if not strip out what you don't want.

                  declare lower;

                  input length      =   14;
                  input alertOS     = -100;
                  input alertOB     =  100;
                  input over_sold   = -100;
                  input over_bought =  100;

                  def price = close + low + high;
                  def linDev = lindev(price, length);

                  plot CCI = if linDev == 0 then 0 else (price - Average(price, length)) / linDev / 0.015;
                  CCI.setDefaultColor(GetColor(9));

                  plot OverBought = over_bought;
                  OverBought
                  .SetDefaultColor(GetColor(5));
                  OverBought
                  .HideBubble();
                  OverBought
                  .HideTitle();

                  plot ZeroLine = 0;
                  ZeroLine
                  .SetDefaultColor(GetColor(5));
                  ZeroLine
                  .HideBubble();
                  ZeroLine
                  .HideTitle();

                  plot OverSold = over_sold;
                  OverSold
                  .setDefaultColor(GetColor(5));
                  OverSold
                  .HideBubble();
                  OverSold
                  .HideTitle();

                  plot aOB = if CCI[1] < alertOB and CCI > alertOB then alertOB else Double.NaN;
                  aOB
                  .SetPaintingStrategy( PaintingStrategy.ARROW_UP );
                  aOB
                  .SetDefaultColor( Color.UPTICK );
                  aOB
                  .HideBubble();
                  aOB
                  .HideTitle();

                  plot aOS = if CCI[1] > alertOS and CCI < alertOS then alertOS else Double.NaN;
                  aOS
                  .SetPaintingStrategy( PaintingStrategy.ARROW_DOWN );
                  aOS
                  .SetDefaultColor( Color.DOWNTICK );
                  aOS
                  .HideBubble();
                  aOS
                  .HideTitle();

                  alert( aOB, concat( "CCI is OverBought: ", CCI ), Alert.ONCE, Sound.Ding );
                  alert( aOS, concat( "CCI is OverSold: ", CCI ),   Alert.ONCE, Sound.Bell );

                   

                  From: TOS_thinkscript@yahoogroups.com [mailto:TOS_thinkscript@yahoogroups.com] On Behalf Of Nathan Crude
                  Sent: Tuesday, May 03, 2011 7:39 AM
                  To: TOS_thinkscript@yahoogroups.com
                  Subject: [TOS_thinkscript] CCI Alert

                   

                   

                  Hi,

                  I have the below code for CCI. What do I add to it to be able to set an alert for a given level of CCI...

                  For example, the below code sets levels at -100 and +100, this is fine, but what if I want an audio alert on touching a given number outside of that range, ie -150 or -180, what code would I add to add an alarm for a given level (able to change the alarm level in preferences though) ?

                  So its like adding a second line really, with an audio alert on its hit...

                  I tried adding

                  alert( over_bought or over_sold, Alert.ONCE, Sound.DING );

                  But it says "incompatible parameter".

                  declare lower;

                  input length = 14;
                  input over_sold = -100;
                  input over_bought = 100;

                  def price = close + low + high;
                  def linDev = lindev(price, length);
                  plot CCI = if linDev == 0 then 0 else (price - Average(price, length)) / linDev / 0.015;
                  plot OverBought = over_bought;
                  plot ZeroLine = 0;
                  plot OverSold = over_sold;

                  CCI.setDefaultColor(GetColor(9));
                  OverBought.setDefaultColor(GetColor(5));
                  ZeroLine.setDefaultColor(GetColor(5));
                  OverSold.setDefaultColor(GetColor(5));

                • Nathan Crude
                  That´s totally perfect Richard. Thanks so much :-) ... That´s totally perfect Richard. Thanks so much :-) On May 3, 2011, at 10:04 AM, Richard Houser wrote:
                  Message 8 of 28 , May 3, 2011
                  View Source
                  • 0 Attachment
                    That´s totally perfect Richard. Thanks so much :-)



                    On May 3, 2011, at 10:04 AM, Richard Houser wrote:

                     

                    Try this. It's a little more involved than you requested, but I think you'll find it more effective to use, if not strip out what you don't want.

                    declare lower;

                    input length      =   14;
                    input alertOS     = -100;
                    input alertOB     =  100;
                    input over_sold   = -100;
                    input over_bought =  100;

                    def price = close + low + high;
                    def linDev = lindev(price, length);

                    plot CCI = if linDev == 0 then 0 else (price - Average(price, length)) / linDev / 0.015;
                    CCI.setDefaultColor(GetColor(9));

                    plot OverBought = over_bought;
                    OverBought
                    .SetDefaultColor(GetColor(5));
                    OverBought
                    .HideBubble();
                    OverBought
                    .HideTitle();

                    plot ZeroLine = 0;
                    ZeroLine
                    .SetDefaultColor(GetColor(5));
                    ZeroLine
                    .HideBubble();
                    ZeroLine
                    .HideTitle();

                    plot OverSold = over_sold;
                    OverSold
                    .setDefaultColor(GetColor(5));
                    OverSold
                    .HideBubble();
                    OverSold
                    .HideTitle();

                    plot aOB = if CCI[1] < alertOB and CCI > alertOB then alertOB else Double.NaN;
                    aOB
                    .SetPaintingStrategy( PaintingStrategy.ARROW_UP );
                    aOB
                    .SetDefaultColor( Color.UPTICK );
                    aOB
                    .HideBubble();
                    aOB
                    .HideTitle();

                    plot aOS = if CCI[1] > alertOS and CCI < alertOS then alertOS else Double.NaN;
                    aOS
                    .SetPaintingStrategy( PaintingStrategy.ARROW_DOWN );
                    aOS
                    .SetDefaultColor( Color.DOWNTICK );
                    aOS
                    .HideBubble();
                    aOS
                    .HideTitle();

                    alert( aOB, concat( "CCI is OverBought: ", CCI ), Alert.ONCE, Sound.Ding );
                    alert( aOS, concat( "CCI is OverSold: ", CCI ),   Alert.ONCE, Sound.Bell );

                     

                    From: TOS_thinkscript@yahoogroups.com [mailto:TOS_thinkscript@yahoogroups.com] On Behalf Of Nathan Crude
                    Sent: Tuesday, May 03, 2011 7:39 AM
                    To: TOS_thinkscript@yahoogroups.com
                    Subject: [TOS_thinkscript] CCI Alert

                     

                     

                    Hi,

                    I have the below code for CCI. What do I add to it to be able to set an alert for a given level of CCI...

                    For example, the below code sets levels at -100 and +100, this is fine, but what if I want an audio alert on touching a given number outside of that range, ie -150 or -180, what code would I add to add an alarm for a given level (able to change the alarm level in preferences though) ?

                    So its like adding a second line really, with an audio alert on its hit...

                    I tried adding

                    alert( over_bought or over_sold, Alert.ONCE, Sound.DING );

                    But it says "incompatible parameter".

                    declare lower;

                    input length = 14;
                    input over_sold = -100;
                    input over_bought = 100;

                    def price = close + low + high;
                    def linDev = lindev(price, length);
                    plot CCI = if linDev == 0 then 0 else (price - Average(price, length)) / linDev / 0.015;
                    plot OverBought = over_bought;
                    plot ZeroLine = 0;
                    plot OverSold = over_sold;

                    CCI.setDefaultColor(GetColor(9));
                    OverBought.setDefaultColor(GetColor(5));
                    ZeroLine.setDefaultColor(GetColor(5));
                    OverSold.setDefaultColor(GetColor(5));



                  • garuba_r
                    Richard, Thanks For this... I made the following change so I can get alarms when CCI crosses back into the -100 to 100 range but now I get no alarms.. ideas??
                    Message 9 of 28 , Jun 17, 2011
                    View Source
                    • 0 Attachment
                      Richard,

                      Thanks For this... I made the following change so I can get alarms when CCI crosses back into the -100 to 100 range but now I get no alarms.. ideas??

                      declare lower;

                      input length = 14;
                      input alertOS = 100;
                      input alertOB = -100;
                      input over_sold = 100;
                      input over_bought = -100;


                      --- In TOS_thinkscript@yahoogroups.com, "Richard Houser" <rhouser@...> wrote:
                      >
                      > Try this. It's a little more involved than you requested, but I think you'll
                      > find it more effective to use, if not strip out what you don't want.
                      >
                      > declare lower;
                      >
                      > input length = 14;
                      > input alertOS = -100;
                      > input alertOB = 100;
                      > input over_sold = -100;
                      > input over_bought = 100;
                      >
                      > def price = close + low + high;
                      > def linDev = lindev(price, length);
                      >
                      > plot CCI = if linDev == 0 then 0 else (price - Average(price, length)) /
                      > linDev / 0.015;
                      > CCI.setDefaultColor(GetColor(9));
                      >
                      > plot OverBought = over_bought;
                      > OverBought.SetDefaultColor(GetColor(5));
                      > OverBought.HideBubble();
                      > OverBought.HideTitle();
                      >
                      > plot ZeroLine = 0;
                      > ZeroLine.SetDefaultColor(GetColor(5));
                      > ZeroLine.HideBubble();
                      > ZeroLine.HideTitle();
                      >
                      > plot OverSold = over_sold;
                      > OverSold.setDefaultColor(GetColor(5));
                      > OverSold.HideBubble();
                      > OverSold.HideTitle();
                      >
                      > plot aOB = if CCI[1] < alertOB and CCI > alertOB then alertOB else
                      > Double.NaN;
                      > aOB.SetPaintingStrategy( PaintingStrategy.ARROW_UP );
                      > aOB.SetDefaultColor( Color.UPTICK );
                      > aOB.HideBubble();
                      > aOB.HideTitle();
                      >
                      > plot aOS = if CCI[1] > alertOS and CCI < alertOS then alertOS else
                      > Double.NaN;
                      > aOS.SetPaintingStrategy( PaintingStrategy.ARROW_DOWN );
                      > aOS.SetDefaultColor( Color.DOWNTICK );
                      > aOS.HideBubble();
                      > aOS.HideTitle();
                      >
                      > alert( aOB, concat( "CCI is OverBought: ", CCI ), Alert.ONCE, Sound.Ding );
                      > alert( aOS, concat( "CCI is OverSold: ", CCI ), Alert.ONCE, Sound.Bell );
                      >
                      >
                      >
                      >
                      >
                      > From: TOS_thinkscript@yahoogroups.com
                      > [mailto:TOS_thinkscript@yahoogroups.com] On Behalf Of Nathan Crude
                      > Sent: Tuesday, May 03, 2011 7:39 AM
                      > To: TOS_thinkscript@yahoogroups.com
                      > Subject: [TOS_thinkscript] CCI Alert
                      >
                      >
                      >
                      >
                      >
                      > Hi,
                      >
                      > I have the below code for CCI. What do I add to it to be able to set an
                      > alert for a given level of CCI...
                      >
                      > For example, the below code sets levels at -100 and +100, this is fine, but
                      > what if I want an audio alert on touching a given number outside of that
                      > range, ie -150 or -180, what code would I add to add an alarm for a given
                      > level (able to change the alarm level in preferences though) ?
                      >
                      > So its like adding a second line really, with an audio alert on its hit...
                      >
                      > I tried adding
                      >
                      > alert( over_bought or over_sold, Alert.ONCE, Sound.DING );
                      >
                      > But it says "incompatible parameter".
                      >
                      > declare lower;
                      >
                      > input length = 14;
                      > input over_sold = -100;
                      > input over_bought = 100;
                      >
                      > def price = close + low + high;
                      > def linDev = lindev(price, length);
                      > plot CCI = if linDev == 0 then 0 else (price - Average(price, length)) /
                      > linDev / 0.015;
                      > plot OverBought = over_bought;
                      > plot ZeroLine = 0;
                      > plot OverSold = over_sold;
                      >
                      > CCI.setDefaultColor(GetColor(9));
                      > OverBought.setDefaultColor(GetColor(5));
                      > ZeroLine.setDefaultColor(GetColor(5));
                      > OverSold.setDefaultColor(GetColor(5));
                      >
                    • garuba_r
                      Richard, Thanks For this... I made the following change so I can get alarms when CCI crosses back into the -100 to 100 range but now I get no alarms.. ideas??
                      Message 10 of 28 , Jun 17, 2011
                      View Source
                      • 0 Attachment
                        Richard,

                        Thanks For this... I made the following change so I can get alarms when CCI crosses back into the -100 to 100 range but now I get no alarms.. ideas??

                        declare lower;

                        input length = 14;
                        input alertOS = 100;
                        input alertOB = -100;
                        input over_sold = 100;
                        input over_bought = -100;


                        --- In TOS_thinkscript@yahoogroups.com, "Richard Houser" <rhouser@...> wrote:
                        >
                        > Try this. It's a little more involved than you requested, but I think you'll
                        > find it more effective to use, if not strip out what you don't want.
                        >
                        > declare lower;
                        >
                        > input length = 14;
                        > input alertOS = -100;
                        > input alertOB = 100;
                        > input over_sold = -100;
                        > input over_bought = 100;
                        >
                        > def price = close + low + high;
                        > def linDev = lindev(price, length);
                        >
                        > plot CCI = if linDev == 0 then 0 else (price - Average(price, length)) /
                        > linDev / 0.015;
                        > CCI.setDefaultColor(GetColor(9));
                        >
                        > plot OverBought = over_bought;
                        > OverBought.SetDefaultColor(GetColor(5));
                        > OverBought.HideBubble();
                        > OverBought.HideTitle();
                        >
                        > plot ZeroLine = 0;
                        > ZeroLine.SetDefaultColor(GetColor(5));
                        > ZeroLine.HideBubble();
                        > ZeroLine.HideTitle();
                        >
                        > plot OverSold = over_sold;
                        > OverSold.setDefaultColor(GetColor(5));
                        > OverSold.HideBubble();
                        > OverSold.HideTitle();
                        >
                        > plot aOB = if CCI[1] < alertOB and CCI > alertOB then alertOB else
                        > Double.NaN;
                        > aOB.SetPaintingStrategy( PaintingStrategy.ARROW_UP );
                        > aOB.SetDefaultColor( Color.UPTICK );
                        > aOB.HideBubble();
                        > aOB.HideTitle();
                        >
                        > plot aOS = if CCI[1] > alertOS and CCI < alertOS then alertOS else
                        > Double.NaN;
                        > aOS.SetPaintingStrategy( PaintingStrategy.ARROW_DOWN );
                        > aOS.SetDefaultColor( Color.DOWNTICK );
                        > aOS.HideBubble();
                        > aOS.HideTitle();
                        >
                        > alert( aOB, concat( "CCI is OverBought: ", CCI ), Alert.ONCE, Sound.Ding );
                        > alert( aOS, concat( "CCI is OverSold: ", CCI ), Alert.ONCE, Sound.Bell );
                        >
                        >
                        >
                        >
                        >
                        > From: TOS_thinkscript@yahoogroups.com
                        > [mailto:TOS_thinkscript@yahoogroups.com] On Behalf Of Nathan Crude
                        > Sent: Tuesday, May 03, 2011 7:39 AM
                        > To: TOS_thinkscript@yahoogroups.com
                        > Subject: [TOS_thinkscript] CCI Alert
                        >
                        >
                        >
                        >
                        >
                        > Hi,
                        >
                        > I have the below code for CCI. What do I add to it to be able to set an
                        > alert for a given level of CCI...
                        >
                        > For example, the below code sets levels at -100 and +100, this is fine, but
                        > what if I want an audio alert on touching a given number outside of that
                        > range, ie -150 or -180, what code would I add to add an alarm for a given
                        > level (able to change the alarm level in preferences though) ?
                        >
                        > So its like adding a second line really, with an audio alert on its hit...
                        >
                        > I tried adding
                        >
                        > alert( over_bought or over_sold, Alert.ONCE, Sound.DING );
                        >
                        > But it says "incompatible parameter".
                        >
                        > declare lower;
                        >
                        > input length = 14;
                        > input over_sold = -100;
                        > input over_bought = 100;
                        >
                        > def price = close + low + high;
                        > def linDev = lindev(price, length);
                        > plot CCI = if linDev == 0 then 0 else (price - Average(price, length)) /
                        > linDev / 0.015;
                        > plot OverBought = over_bought;
                        > plot ZeroLine = 0;
                        > plot OverSold = over_sold;
                        >
                        > CCI.setDefaultColor(GetColor(9));
                        > OverBought.setDefaultColor(GetColor(5));
                        > ZeroLine.setDefaultColor(GetColor(5));
                        > OverSold.setDefaultColor(GetColor(5));
                        >
                      • Richard Houser
                        While the changes you made to the inputs coerced the arrows to where you wanted, it did not create a proper logical condition for the alerts to fire. Try this
                        Message 11 of 28 , Jun 17, 2011
                        View Source
                        • 0 Attachment

                          While the changes you made to the inputs coerced the arrows to where you wanted, it did not create a proper logical condition for the alerts to fire. Try this instead:
                          declare lower;

                          input length      =   14;
                          input alertOS     = -100;
                          input alertOB     =  100;
                          input over_sold   = -100;
                          input over_bought =  100;

                          def price = close + low + high;
                          def linDev = lindev(price, length);

                          plot CCI = if linDev == 0
                                      then 0
                                      else (price - Average(price, length)) / linDev / 0.015; CCI.setDefaultColor(GetColor(9));

                          plot OverBought = over_bought;
                          OverBought.SetDefaultColor(GetColor(5));
                          OverBought.HideBubble();
                          OverBought.HideTitle();

                          plot ZeroLine = 0;
                          ZeroLine.SetDefaultColor(GetColor(5));
                          ZeroLine.HideBubble();
                          ZeroLine.HideTitle();

                          plot OverSold = over_sold;
                          OverSold.setDefaultColor(GetColor(5));
                          OverSold.HideBubble();
                          OverSold.HideTitle();

                          plot goLong  = if CCI[1] < alertOS and CCI > alertOS
                                          then alertOS
                                          else Double.NaN;
                          goLong.SetPaintingStrategy( PaintingStrategy.ARROW_UP );

                          goLong.SetDefaultColor( Color.UPTICK );

                          goLong.HideBubble();

                          goLong.HideTitle();

                          plot goShort = if CCI[1] > alertOB and CCI < alertOB
                                          then alertOB
                                          else Double.NaN;
                          goShort.SetPaintingStrategy( PaintingStrategy.ARROW_DOWN );

                          goShort.SetDefaultColor( Color.DOWNTICK );

                          goShort.HideBubble();

                          goShort.HideTitle();

                          alert( goLong,  concat( "CCI signals a BUY: ",  concat( CCI[1], concat( " -> ", CCI ))), Alert.ONCE, Sound.Ding );

                          alert( goShort, concat( "CCI signals a SELL: ", concat( CCI[1], concat( " -> ", CCI ))), Alert.ONCE, Sound.Bell );

                           

                           

                          From: TOS_thinkscript@yahoogroups.com [mailto:TOS_thinkscript@yahoogroups.com] On Behalf Of garuba_r
                          Sent: Friday, June 17, 2011 10:29 AM
                          To: TOS_thinkscript@yahoogroups.com
                          Subject: [TOS_thinkscript] Re: CCI Alert

                           

                           

                          Richard,

                          Thanks For this... I made the following change so I can get alarms when CCI crosses back into the -100 to 100 range but now I get no alarms.. ideas??

                          declare lower;

                          input length = 14;
                          input alertOS = 100;
                          input alertOB = -100;
                          input over_sold = 100;
                          input over_bought = -100;

                          --- In TOS_thinkscript@yahoogroups.com, "Richard Houser" <rhouser@...> wrote:
                          >
                          > Try this. It's a little more involved than you requested, but I think you'll
                          > find it more effective to use, if not strip out what you don't want.
                          >
                          > declare lower;
                          >
                          > input length = 14;
                          > input alertOS = -100;
                          > input alertOB = 100;
                          > input over_sold = -100;
                          > input over_bought = 100;
                          >
                          > def price = close + low + high;
                          > def linDev = lindev(price, length);
                          >
                          > plot CCI = if linDev == 0 then 0 else (price - Average(price, length)) /
                          > linDev / 0.015;
                          > CCI.setDefaultColor(GetColor(9));
                          >
                          > plot OverBought = over_bought;
                          > OverBought.SetDefaultColor(GetColor(5));
                          > OverBought.HideBubble();
                          > OverBought.HideTitle();
                          >
                          > plot ZeroLine = 0;
                          > ZeroLine.SetDefaultColor(GetColor(5));
                          > ZeroLine.HideBubble();
                          > ZeroLine.HideTitle();
                          >
                          > plot OverSold = over_sold;
                          > OverSold.setDefaultColor(GetColor(5));
                          > OverSold.HideBubble();
                          > OverSold.HideTitle();
                          >
                          > plot aOB = if CCI[1] < alertOB and CCI > alertOB then alertOB else
                          > Double.NaN;
                          > aOB.SetPaintingStrategy( PaintingStrategy.ARROW_UP );
                          > aOB.SetDefaultColor( Color.UPTICK );
                          > aOB.HideBubble();
                          > aOB.HideTitle();
                          >
                          > plot aOS = if CCI[1] > alertOS and CCI < alertOS then alertOS else
                          > Double.NaN;
                          > aOS.SetPaintingStrategy( PaintingStrategy.ARROW_DOWN );
                          > aOS.SetDefaultColor( Color.DOWNTICK );
                          > aOS.HideBubble();
                          > aOS.HideTitle();
                          >
                          > alert( aOB, concat( "CCI is OverBought: ", CCI ), Alert.ONCE, Sound.Ding );
                          > alert( aOS, concat( "CCI is OverSold: ", CCI ), Alert.ONCE, Sound.Bell );
                          >
                          >
                          >
                          >
                          >
                          > From: TOS_thinkscript@yahoogroups.com
                          > [mailto:TOS_thinkscript@yahoogroups.com] On Behalf Of Nathan Crude
                          > Sent: Tuesday, May 03, 2011 7:39 AM
                          > To: TOS_thinkscript@yahoogroups.com
                          > Subject: [TOS_thinkscript] CCI Alert
                          >
                          >
                          >
                          >
                          >
                          > Hi,
                          >
                          > I have the below code for CCI. What do I add to it to be able to set an
                          > alert for a given level of CCI...
                          >
                          > For example, the below code sets levels at -100 and +100, this is fine, but
                          > what if I want an audio alert on touching a given number outside of that
                          > range, ie -150 or -180, what code would I add to add an alarm for a given
                          > level (able to change the alarm level in preferences though) ?
                          >
                          > So its like adding a second line really, with an audio alert on its hit...
                          >
                          > I tried adding
                          >
                          > alert( over_bought or over_sold, Alert.ONCE, Sound.DING );
                          >
                          > But it says "incompatible parameter".
                          >
                          > declare lower;
                          >
                          > input length = 14;
                          > input over_sold = -100;
                          > input over_bought = 100;
                          >
                          > def price = close + low + high;
                          > def linDev = lindev(price, length);
                          > plot CCI = if linDev == 0 then 0 else (price - Average(price, length)) /
                          > linDev / 0.015;
                          > plot OverBought = over_bought;
                          > plot ZeroLine = 0;
                          > plot OverSold = over_sold;
                          >
                          > CCI.setDefaultColor(GetColor(9));
                          > OverBought.setDefaultColor(GetColor(5));
                          > ZeroLine.setDefaultColor(GetColor(5));
                          > OverSold.setDefaultColor(GetColor(5));
                          >

                        • garuba_r
                          Richard, Wow.. not as simple as I thought.. A LOT I have to learn.. Any idea on how to strip these down to a complex formula for a study alert so the alerts
                          Message 12 of 28 , Jun 17, 2011
                          View Source
                          • 0 Attachment
                            Richard,

                            Wow.. not as simple as I thought.. A LOT I have to learn.. Any idea on how to strip these down to a complex formula for a study alert so the alerts can be emailed even if TOS is off?? So far it doesn't want "plot" commands or any charting command. I am building my system around 4 Hour charts and leaving TOS on not always an option.

                            A million thank you's.. Really appreciated.

                            --- In TOS_thinkscript@yahoogroups.com, "Richard Houser" <rhouser@...> wrote:
                            >
                            > While the changes you made to the inputs coerced the arrows to where you
                            > wanted, it did not create a proper logical condition for the alerts to fire.
                            > Try this instead:
                            > declare lower;
                            >
                            > input length = 14;
                            > input alertOS = -100;
                            > input alertOB = 100;
                            > input over_sold = -100;
                            > input over_bought = 100;
                            >
                            > def price = close + low + high;
                            > def linDev = lindev(price, length);
                            >
                            > plot CCI = if linDev == 0
                            > then 0
                            > else (price - Average(price, length)) / linDev / 0.015;
                            > CCI.setDefaultColor(GetColor(9));
                            >
                            > plot OverBought = over_bought;
                            > OverBought.SetDefaultColor(GetColor(5));
                            > OverBought.HideBubble();
                            > OverBought.HideTitle();
                            >
                            > plot ZeroLine = 0;
                            > ZeroLine.SetDefaultColor(GetColor(5));
                            > ZeroLine.HideBubble();
                            > ZeroLine.HideTitle();
                            >
                            > plot OverSold = over_sold;
                            > OverSold.setDefaultColor(GetColor(5));
                            > OverSold.HideBubble();
                            > OverSold.HideTitle();
                            >
                            > plot goLong = if CCI[1] < alertOS and CCI > alertOS
                            > then alertOS
                            > else Double.NaN;
                            > goLong.SetPaintingStrategy( PaintingStrategy.ARROW_UP );
                            >
                            > goLong.SetDefaultColor( Color.UPTICK );
                            >
                            > goLong.HideBubble();
                            >
                            > goLong.HideTitle();
                            >
                            > plot goShort = if CCI[1] > alertOB and CCI < alertOB
                            > then alertOB
                            > else Double.NaN;
                            > goShort.SetPaintingStrategy( PaintingStrategy.ARROW_DOWN );
                            >
                            > goShort.SetDefaultColor( Color.DOWNTICK );
                            >
                            > goShort.HideBubble();
                            >
                            > goShort.HideTitle();
                            >
                            > alert( goLong, concat( "CCI signals a BUY: ", concat( CCI[1], concat( " ->
                            > ", CCI ))), Alert.ONCE, Sound.Ding );
                            >
                            > alert( goShort, concat( "CCI signals a SELL: ", concat( CCI[1], concat( " ->
                            > ", CCI ))), Alert.ONCE, Sound.Bell );
                            >
                            >
                            >
                            >
                            >
                            >
                            >
                            > From: TOS_thinkscript@yahoogroups.com
                            > [mailto:TOS_thinkscript@yahoogroups.com] On Behalf Of garuba_r
                            > Sent: Friday, June 17, 2011 10:29 AM
                            > To: TOS_thinkscript@yahoogroups.com
                            > Subject: [TOS_thinkscript] Re: CCI Alert
                            >
                            >
                            >
                            >
                            >
                            > Richard,
                            >
                            > Thanks For this... I made the following change so I can get alarms when CCI
                            > crosses back into the -100 to 100 range but now I get no alarms.. ideas??
                            >
                            > declare lower;
                            >
                            > input length = 14;
                            > input alertOS = 100;
                            > input alertOB = -100;
                            > input over_sold = 100;
                            > input over_bought = -100;
                            >
                            > --- In TOS_thinkscript@yahoogroups.com
                            > <mailto:TOS_thinkscript%40yahoogroups.com> , "Richard Houser" <rhouser@>
                            > wrote:
                            > >
                            > > Try this. It's a little more involved than you requested, but I think
                            > you'll
                            > > find it more effective to use, if not strip out what you don't want.
                            > >
                            > > declare lower;
                            > >
                            > > input length = 14;
                            > > input alertOS = -100;
                            > > input alertOB = 100;
                            > > input over_sold = -100;
                            > > input over_bought = 100;
                            > >
                            > > def price = close + low + high;
                            > > def linDev = lindev(price, length);
                            > >
                            > > plot CCI = if linDev == 0 then 0 else (price - Average(price, length)) /
                            > > linDev / 0.015;
                            > > CCI.setDefaultColor(GetColor(9));
                            > >
                            > > plot OverBought = over_bought;
                            > > OverBought.SetDefaultColor(GetColor(5));
                            > > OverBought.HideBubble();
                            > > OverBought.HideTitle();
                            > >
                            > > plot ZeroLine = 0;
                            > > ZeroLine.SetDefaultColor(GetColor(5));
                            > > ZeroLine.HideBubble();
                            > > ZeroLine.HideTitle();
                            > >
                            > > plot OverSold = over_sold;
                            > > OverSold.setDefaultColor(GetColor(5));
                            > > OverSold.HideBubble();
                            > > OverSold.HideTitle();
                            > >
                            > > plot aOB = if CCI[1] < alertOB and CCI > alertOB then alertOB else
                            > > Double.NaN;
                            > > aOB.SetPaintingStrategy( PaintingStrategy.ARROW_UP );
                            > > aOB.SetDefaultColor( Color.UPTICK );
                            > > aOB.HideBubble();
                            > > aOB.HideTitle();
                            > >
                            > > plot aOS = if CCI[1] > alertOS and CCI < alertOS then alertOS else
                            > > Double.NaN;
                            > > aOS.SetPaintingStrategy( PaintingStrategy.ARROW_DOWN );
                            > > aOS.SetDefaultColor( Color.DOWNTICK );
                            > > aOS.HideBubble();
                            > > aOS.HideTitle();
                            > >
                            > > alert( aOB, concat( "CCI is OverBought: ", CCI ), Alert.ONCE, Sound.Ding
                            > );
                            > > alert( aOS, concat( "CCI is OverSold: ", CCI ), Alert.ONCE, Sound.Bell );
                            > >
                            > >
                            > >
                            > >
                            > >
                            > > From: TOS_thinkscript@yahoogroups.com
                            > <mailto:TOS_thinkscript%40yahoogroups.com>
                            > > [mailto:TOS_thinkscript@yahoogroups.com
                            > <mailto:TOS_thinkscript%40yahoogroups.com> ] On Behalf Of Nathan Crude
                            > > Sent: Tuesday, May 03, 2011 7:39 AM
                            > > To: TOS_thinkscript@yahoogroups.com
                            > <mailto:TOS_thinkscript%40yahoogroups.com>
                            > > Subject: [TOS_thinkscript] CCI Alert
                            > >
                            > >
                            > >
                            > >
                            > >
                            > > Hi,
                            > >
                            > > I have the below code for CCI. What do I add to it to be able to set an
                            > > alert for a given level of CCI...
                            > >
                            > > For example, the below code sets levels at -100 and +100, this is fine,
                            > but
                            > > what if I want an audio alert on touching a given number outside of that
                            > > range, ie -150 or -180, what code would I add to add an alarm for a given
                            > > level (able to change the alarm level in preferences though) ?
                            > >
                            > > So its like adding a second line really, with an audio alert on its hit...
                            > >
                            > > I tried adding
                            > >
                            > > alert( over_bought or over_sold, Alert.ONCE, Sound.DING );
                            > >
                            > > But it says "incompatible parameter".
                            > >
                            > > declare lower;
                            > >
                            > > input length = 14;
                            > > input over_sold = -100;
                            > > input over_bought = 100;
                            > >
                            > > def price = close + low + high;
                            > > def linDev = lindev(price, length);
                            > > plot CCI = if linDev == 0 then 0 else (price - Average(price, length)) /
                            > > linDev / 0.015;
                            > > plot OverBought = over_bought;
                            > > plot ZeroLine = 0;
                            > > plot OverSold = over_sold;
                            > >
                            > > CCI.setDefaultColor(GetColor(9));
                            > > OverBought.setDefaultColor(GetColor(5));
                            > > ZeroLine.setDefaultColor(GetColor(5));
                            > > OverSold.setDefaultColor(GetColor(5));
                            > >
                            >
                          • Richard Houser
                            OK, the answer is yes you can create a complex formula Alert Study, and yes you CAN use a plot statement in the complex formula. It will be more efficient to
                            Message 13 of 28 , Jun 17, 2011
                            View Source
                            • 0 Attachment

                              OK, the answer is yes you can create a "complex formula" Alert Study, and yes you CAN use a plot statement in the complex formula. It will be more efficient to break the alert into a goLong (BUY) and goShort (SELL) alerts, here's the code. Unfortunately you can only have one event trigger in a study alert, so choose the one you want to  monitor, copy and paste into the edit box (having deleted any code that previously appeared in the edit box), set the trigger to "true" and create the alert. Repeat the process for the other alert, notice I broke the code to include the appropriate test in the terminal plot statement.

                              You can use this code as a model for creating other alerts. Don't forget to setup the global alert parameters using the "Alert Setup"  in the "ALERT ENTRY TOOLS" sub-frame.

                              =====[ Begin goLONG Alert ]=====
                              input length      =   14;
                              input alertOS     = -100;
                              input alertOB     =  100;
                              input over_sold   = -100;
                              input over_bought =  100;

                              def price = close + low + high;
                              def linDev = lindev(price, length);
                              def CCI = if linDev == 0 then 0 else (price - Average(price, length)) / linDev / 0.015;
                              plot goLong  = if CCI[1] < alertOS and CCI > alertOS then yes else no;
                              #=====[End of goLONG]=====


                              #=====[ Begin goSHORT Alert ]=====
                              input length      =   14;
                              input alertOS     = -100;
                              input alertOB     =  100;
                              input over_sold   = -100;
                              input over_bought =  100;

                              def price = close + low + high;
                              def linDev = lindev(price, length);
                              def CCI = if linDev == 0 then 0 else (price - Average(price, length)) / linDev / 0.015;
                              plot goShort = if CCI[1] > alertOB and CCI < alertOB then yes else no;
                              #=====[End of goSHORT]=====

                               

                               

                               

                              From: TOS_thinkscript@yahoogroups.com [mailto:TOS_thinkscript@yahoogroups.com] On Behalf Of garuba_r
                              Sent: Friday, June 17, 2011 1:54 PM
                              To: TOS_thinkscript@yahoogroups.com
                              Subject: [TOS_thinkscript] Re: CCI Alert

                               

                               

                              Richard,

                              Wow.. not as simple as I thought.. A LOT I have to learn.. Any idea on how to strip these down to a complex formula for a study alert so the alerts can be emailed even if TOS is off?? So far it doesn't want "plot" commands or any charting command. I am building my system around 4 Hour charts and leaving TOS on not always an option.

                              A million thank you's.. Really appreciated.

                              --- In TOS_thinkscript@yahoogroups.com, "Richard Houser" <rhouser@...> wrote:
                              >
                              > While the changes you made to the inputs coerced the arrows to where you
                              > wanted, it did not create a proper logical condition for the alerts to fire.
                              > Try this instead:
                              > declare lower;
                              >
                              > input length = 14;
                              > input alertOS = -100;
                              > input alertOB = 100;
                              > input over_sold = -100;
                              > input over_bought = 100;
                              >
                              > def price = close + low + high;
                              > def linDev = lindev(price, length);
                              >
                              > plot CCI = if linDev == 0
                              > then 0
                              > else (price - Average(price, length)) / linDev / 0.015;
                              > CCI.setDefaultColor(GetColor(9));
                              >
                              > plot OverBought = over_bought;
                              > OverBought.SetDefaultColor(GetColor(5));
                              > OverBought.HideBubble();
                              > OverBought.HideTitle();
                              >
                              > plot ZeroLine = 0;
                              > ZeroLine.SetDefaultColor(GetColor(5));
                              > ZeroLine.HideBubble();
                              > ZeroLine.HideTitle();
                              >
                              > plot OverSold = over_sold;
                              > OverSold.setDefaultColor(GetColor(5));
                              > OverSold.HideBubble();
                              > OverSold.HideTitle();
                              >
                              > plot goLong = if CCI[1] < alertOS and CCI > alertOS
                              > then alertOS
                              > else Double.NaN;
                              > goLong.SetPaintingStrategy( PaintingStrategy.ARROW_UP );
                              >
                              > goLong.SetDefaultColor( Color.UPTICK );
                              >
                              > goLong.HideBubble();
                              >
                              > goLong.HideTitle();
                              >
                              > plot goShort = if CCI[1] > alertOB and CCI < alertOB
                              > then alertOB
                              > else Double.NaN;
                              > goShort.SetPaintingStrategy( PaintingStrategy.ARROW_DOWN );
                              >
                              > goShort.SetDefaultColor( Color.DOWNTICK );
                              >
                              > goShort.HideBubble();
                              >
                              > goShort.HideTitle();
                              >
                              > alert( goLong, concat( "CCI signals a BUY: ", concat( CCI[1], concat( " ->
                              > ", CCI ))), Alert.ONCE, Sound.Ding );
                              >
                              > alert( goShort, concat( "CCI signals a SELL: ", concat( CCI[1], concat( " ->
                              > ", CCI ))), Alert.ONCE, Sound.Bell );
                              >
                              >
                              >
                              >
                              >
                              >
                              >
                              > From: TOS_thinkscript@yahoogroups.com
                              > [mailto:TOS_thinkscript@yahoogroups.com] On Behalf Of garuba_r
                              > Sent: Friday, June 17, 2011 10:29 AM
                              > To: TOS_thinkscript@yahoogroups.com
                              > Subject: [TOS_thinkscript] Re: CCI Alert
                              >
                              >
                              >
                              >
                              >
                              > Richard,
                              >
                              > Thanks For this... I made the following change so I can get alarms when CCI
                              > crosses back into the -100 to 100 range but now I get no alarms.. ideas??
                              >
                              > declare lower;
                              >
                              > input length = 14;
                              > input alertOS = 100;
                              > input alertOB = -100;
                              > input over_sold = 100;
                              > input over_bought = -100;
                              >
                              > --- In TOS_thinkscript@yahoogroups.com
                              > <mailto:TOS_thinkscript%40yahoogroups.com> , "Richard Houser" <rhouser@>
                              > wrote:
                              > >
                              > > Try this. It's a little more involved than you requested, but I think
                              > you'll
                              > > find it more effective to use, if not strip out what you don't want.
                              > >
                              > > declare lower;
                              > >
                              > > input length = 14;
                              > > input alertOS = -100;
                              > > input alertOB = 100;
                              > > input over_sold = -100;
                              > > input over_bought = 100;
                              > >
                              > > def price = close + low + high;
                              > > def linDev = lindev(price, length);
                              > >
                              > > plot CCI = if linDev == 0 then 0 else (price - Average(price, length)) /
                              > > linDev / 0.015;
                              > > CCI.setDefaultColor(GetColor(9));
                              > >
                              > > plot OverBought = over_bought;
                              > > OverBought.SetDefaultColor(GetColor(5));
                              > > OverBought.HideBubble();
                              > > OverBought.HideTitle();
                              > >
                              > > plot ZeroLine = 0;
                              > > ZeroLine.SetDefaultColor(GetColor(5));
                              > > ZeroLine.HideBubble();
                              > > ZeroLine.HideTitle();
                              > >
                              > > plot OverSold = over_sold;
                              > > OverSold.setDefaultColor(GetColor(5));
                              > > OverSold.HideBubble();
                              > > OverSold.HideTitle();
                              > >
                              > > plot aOB = if CCI[1] < alertOB and CCI > alertOB then alertOB else
                              > > Double.NaN;
                              > > aOB.SetPaintingStrategy( PaintingStrategy.ARROW_UP );
                              > > aOB.SetDefaultColor( Color.UPTICK );
                              > > aOB.HideBubble();
                              > > aOB.HideTitle();
                              > >
                              > > plot aOS = if CCI[1] > alertOS and CCI < alertOS then alertOS else
                              > > Double.NaN;
                              > > aOS.SetPaintingStrategy( PaintingStrategy.ARROW_DOWN );
                              > > aOS.SetDefaultColor( Color.DOWNTICK );
                              > > aOS.HideBubble();
                              > > aOS.HideTitle();
                              > >
                              > > alert( aOB, concat( "CCI is OverBought: ", CCI ), Alert.ONCE, Sound.Ding
                              > );
                              > > alert( aOS, concat( "CCI is OverSold: ", CCI ), Alert.ONCE, Sound.Bell );
                              > >
                              > >
                              > >
                              > >
                              > >
                              > > From: TOS_thinkscript@yahoogroups.com
                              > <mailto:TOS_thinkscript%40yahoogroups.com>
                              > > [mailto:TOS_thinkscript@yahoogroups.com
                              > <mailto:TOS_thinkscript%40yahoogroups.com> ] On Behalf Of Nathan Crude
                              > > Sent: Tuesday, May 03, 2011 7:39 AM
                              > > To: TOS_thinkscript@yahoogroups.com
                              > <mailto:TOS_thinkscript%40yahoogroups.com>
                              > > Subject: [TOS_thinkscript] CCI Alert
                              > >
                              > >
                              > >
                              > >
                              > >
                              > > Hi,
                              > >
                              > > I have the below code for CCI. What do I add to it to be able to set an
                              > > alert for a given level of CCI...
                              > >
                              > > For example, the below code sets levels at -100 and +100, this is fine,
                              > but
                              > > what if I want an audio alert on touching a given number outside of that
                              > > range, ie -150 or -180, what code would I add to add an alarm for a given
                              > > level (able to change the alarm level in preferences though) ?
                              > >
                              > > So its like adding a second line really, with an audio alert on its hit...
                              > >
                              > > I tried adding
                              > >
                              > > alert( over_bought or over_sold, Alert.ONCE, Sound.DING );
                              > >
                              > > But it says "incompatible parameter".
                              > >
                              > > declare lower;
                              > >
                              > > input length = 14;
                              > > input over_sold = -100;
                              > > input over_bought = 100;
                              > >
                              > > def price = close + low + high;
                              > > def linDev = lindev(price, length);
                              > > plot CCI = if linDev == 0 then 0 else (price - Average(price, length)) /
                              > > linDev / 0.015;
                              > > plot OverBought = over_bought;
                              > > plot ZeroLine = 0;
                              > > plot OverSold = over_sold;
                              > >
                              > > CCI.setDefaultColor(GetColor(9));
                              > > OverBought.setDefaultColor(GetColor(5));
                              > > ZeroLine.setDefaultColor(GetColor(5));
                              > > OverSold.setDefaultColor(GetColor(5));
                              > >
                              >

                            • garuba_r
                              Thanks Richard... How did you learn TOS scripting?... Man has to learn to fish.. ;-))
                              Message 14 of 28 , Jun 17, 2011
                              View Source
                              • 0 Attachment
                                Thanks Richard... How did you learn TOS scripting?... Man has to learn to fish.. ;-))

                                --- In TOS_thinkscript@yahoogroups.com, "Richard Houser" <rhouser@...> wrote:
                                >
                                > OK, the answer is yes you can create a "complex formula" Alert Study, and
                                > yes you CAN use a plot statement in the complex formula. It will be more
                                > efficient to break the alert into a goLong (BUY) and goShort (SELL) alerts,
                                > here's the code. Unfortunately you can only have one event trigger in a
                                > study alert, so choose the one you want to monitor, copy and paste into the
                                > edit box (having deleted any code that previously appeared in the edit box),
                                > set the trigger to "true" and create the alert. Repeat the process for the
                                > other alert, notice I broke the code to include the appropriate test in the
                                > terminal plot statement.
                                >
                                > You can use this code as a model for creating other alerts. Don't forget to
                                > setup the global alert parameters using the "Alert Setup" in the "ALERT
                                > ENTRY TOOLS" sub-frame.
                                >
                                > =====[ Begin goLONG Alert ]=====
                                > input length = 14;
                                > input alertOS = -100;
                                > input alertOB = 100;
                                > input over_sold = -100;
                                > input over_bought = 100;
                                >
                                > def price = close + low + high;
                                > def linDev = lindev(price, length);
                                > def CCI = if linDev == 0 then 0 else (price - Average(price, length)) /
                                > linDev / 0.015;
                                > plot goLong = if CCI[1] < alertOS and CCI > alertOS then yes else no;
                                > #=====[End of goLONG]=====
                                >
                                >
                                > #=====[ Begin goSHORT Alert ]=====
                                > input length = 14;
                                > input alertOS = -100;
                                > input alertOB = 100;
                                > input over_sold = -100;
                                > input over_bought = 100;
                                >
                                > def price = close + low + high;
                                > def linDev = lindev(price, length);
                                > def CCI = if linDev == 0 then 0 else (price - Average(price, length)) /
                                > linDev / 0.015;
                                > plot goShort = if CCI[1] > alertOB and CCI < alertOB then yes else no;
                                > #=====[End of goSHORT]=====
                                >
                                >
                                >
                                >
                                >
                                >
                                >
                                >
                                >
                                > From: TOS_thinkscript@yahoogroups.com
                                > [mailto:TOS_thinkscript@yahoogroups.com] On Behalf Of garuba_r
                                > Sent: Friday, June 17, 2011 1:54 PM
                                > To: TOS_thinkscript@yahoogroups.com
                                > Subject: [TOS_thinkscript] Re: CCI Alert
                                >
                                >
                                >
                                >
                                >
                                > Richard,
                                >
                                > Wow.. not as simple as I thought.. A LOT I have to learn.. Any idea on how
                                > to strip these down to a complex formula for a study alert so the alerts can
                                > be emailed even if TOS is off?? So far it doesn't want "plot" commands or
                                > any charting command. I am building my system around 4 Hour charts and
                                > leaving TOS on not always an option.
                                >
                                > A million thank you's.. Really appreciated.
                                >
                                > --- In TOS_thinkscript@yahoogroups.com
                                > <mailto:TOS_thinkscript%40yahoogroups.com> , "Richard Houser" <rhouser@>
                                > wrote:
                                > >
                                > > While the changes you made to the inputs coerced the arrows to where you
                                > > wanted, it did not create a proper logical condition for the alerts to
                                > fire.
                                > > Try this instead:
                                > > declare lower;
                                > >
                                > > input length = 14;
                                > > input alertOS = -100;
                                > > input alertOB = 100;
                                > > input over_sold = -100;
                                > > input over_bought = 100;
                                > >
                                > > def price = close + low + high;
                                > > def linDev = lindev(price, length);
                                > >
                                > > plot CCI = if linDev == 0
                                > > then 0
                                > > else (price - Average(price, length)) / linDev / 0.015;
                                > > CCI.setDefaultColor(GetColor(9));
                                > >
                                > > plot OverBought = over_bought;
                                > > OverBought.SetDefaultColor(GetColor(5));
                                > > OverBought.HideBubble();
                                > > OverBought.HideTitle();
                                > >
                                > > plot ZeroLine = 0;
                                > > ZeroLine.SetDefaultColor(GetColor(5));
                                > > ZeroLine.HideBubble();
                                > > ZeroLine.HideTitle();
                                > >
                                > > plot OverSold = over_sold;
                                > > OverSold.setDefaultColor(GetColor(5));
                                > > OverSold.HideBubble();
                                > > OverSold.HideTitle();
                                > >
                                > > plot goLong = if CCI[1] < alertOS and CCI > alertOS
                                > > then alertOS
                                > > else Double.NaN;
                                > > goLong.SetPaintingStrategy( PaintingStrategy.ARROW_UP );
                                > >
                                > > goLong.SetDefaultColor( Color.UPTICK );
                                > >
                                > > goLong.HideBubble();
                                > >
                                > > goLong.HideTitle();
                                > >
                                > > plot goShort = if CCI[1] > alertOB and CCI < alertOB
                                > > then alertOB
                                > > else Double.NaN;
                                > > goShort.SetPaintingStrategy( PaintingStrategy.ARROW_DOWN );
                                > >
                                > > goShort.SetDefaultColor( Color.DOWNTICK );
                                > >
                                > > goShort.HideBubble();
                                > >
                                > > goShort.HideTitle();
                                > >
                                > > alert( goLong, concat( "CCI signals a BUY: ", concat( CCI[1], concat( " ->
                                > > ", CCI ))), Alert.ONCE, Sound.Ding );
                                > >
                                > > alert( goShort, concat( "CCI signals a SELL: ", concat( CCI[1], concat( "
                                > ->
                                > > ", CCI ))), Alert.ONCE, Sound.Bell );
                                > >
                                > >
                                > >
                                > >
                                > >
                                > >
                                > >
                                > > From: TOS_thinkscript@yahoogroups.com
                                > <mailto:TOS_thinkscript%40yahoogroups.com>
                                > > [mailto:TOS_thinkscript@yahoogroups.com
                                > <mailto:TOS_thinkscript%40yahoogroups.com> ] On Behalf Of garuba_r
                                > > Sent: Friday, June 17, 2011 10:29 AM
                                > > To: TOS_thinkscript@yahoogroups.com
                                > <mailto:TOS_thinkscript%40yahoogroups.com>
                                > > Subject: [TOS_thinkscript] Re: CCI Alert
                                > >
                                > >
                                > >
                                > >
                                > >
                                > > Richard,
                                > >
                                > > Thanks For this... I made the following change so I can get alarms when
                                > CCI
                                > > crosses back into the -100 to 100 range but now I get no alarms.. ideas??
                                > >
                                > > declare lower;
                                > >
                                > > input length = 14;
                                > > input alertOS = 100;
                                > > input alertOB = -100;
                                > > input over_sold = 100;
                                > > input over_bought = -100;
                                > >
                                > > --- In TOS_thinkscript@yahoogroups.com
                                > <mailto:TOS_thinkscript%40yahoogroups.com>
                                > > <mailto:TOS_thinkscript%40yahoogroups.com> , "Richard Houser" <rhouser@>
                                > > wrote:
                                > > >
                                > > > Try this. It's a little more involved than you requested, but I think
                                > > you'll
                                > > > find it more effective to use, if not strip out what you don't want.
                                > > >
                                > > > declare lower;
                                > > >
                                > > > input length = 14;
                                > > > input alertOS = -100;
                                > > > input alertOB = 100;
                                > > > input over_sold = -100;
                                > > > input over_bought = 100;
                                > > >
                                > > > def price = close + low + high;
                                > > > def linDev = lindev(price, length);
                                > > >
                                > > > plot CCI = if linDev == 0 then 0 else (price - Average(price, length)) /
                                > > > linDev / 0.015;
                                > > > CCI.setDefaultColor(GetColor(9));
                                > > >
                                > > > plot OverBought = over_bought;
                                > > > OverBought.SetDefaultColor(GetColor(5));
                                > > > OverBought.HideBubble();
                                > > > OverBought.HideTitle();
                                > > >
                                > > > plot ZeroLine = 0;
                                > > > ZeroLine.SetDefaultColor(GetColor(5));
                                > > > ZeroLine.HideBubble();
                                > > > ZeroLine.HideTitle();
                                > > >
                                > > > plot OverSold = over_sold;
                                > > > OverSold.setDefaultColor(GetColor(5));
                                > > > OverSold.HideBubble();
                                > > > OverSold.HideTitle();
                                > > >
                                > > > plot aOB = if CCI[1] < alertOB and CCI > alertOB then alertOB else
                                > > > Double.NaN;
                                > > > aOB.SetPaintingStrategy( PaintingStrategy.ARROW_UP );
                                > > > aOB.SetDefaultColor( Color.UPTICK );
                                > > > aOB.HideBubble();
                                > > > aOB.HideTitle();
                                > > >
                                > > > plot aOS = if CCI[1] > alertOS and CCI < alertOS then alertOS else
                                > > > Double.NaN;
                                > > > aOS.SetPaintingStrategy( PaintingStrategy.ARROW_DOWN );
                                > > > aOS.SetDefaultColor( Color.DOWNTICK );
                                > > > aOS.HideBubble();
                                > > > aOS.HideTitle();
                                > > >
                                > > > alert( aOB, concat( "CCI is OverBought: ", CCI ), Alert.ONCE, Sound.Ding
                                > > );
                                > > > alert( aOS, concat( "CCI is OverSold: ", CCI ), Alert.ONCE, Sound.Bell
                                > );
                                > > >
                                > > >
                                > > >
                                > > >
                                > > >
                                > > > From: TOS_thinkscript@yahoogroups.com
                                > <mailto:TOS_thinkscript%40yahoogroups.com>
                                > > <mailto:TOS_thinkscript%40yahoogroups.com>
                                > > > [mailto:TOS_thinkscript@yahoogroups.com
                                > <mailto:TOS_thinkscript%40yahoogroups.com>
                                > > <mailto:TOS_thinkscript%40yahoogroups.com> ] On Behalf Of Nathan Crude
                                > > > Sent: Tuesday, May 03, 2011 7:39 AM
                                > > > To: TOS_thinkscript@yahoogroups.com
                                > <mailto:TOS_thinkscript%40yahoogroups.com>
                                > > <mailto:TOS_thinkscript%40yahoogroups.com>
                                > > > Subject: [TOS_thinkscript] CCI Alert
                                > > >
                                > > >
                                > > >
                                > > >
                                > > >
                                > > > Hi,
                                > > >
                                > > > I have the below code for CCI. What do I add to it to be able to set an
                                > > > alert for a given level of CCI...
                                > > >
                                > > > For example, the below code sets levels at -100 and +100, this is fine,
                                > > but
                                > > > what if I want an audio alert on touching a given number outside of that
                                > > > range, ie -150 or -180, what code would I add to add an alarm for a
                                > given
                                > > > level (able to change the alarm level in preferences though) ?
                                > > >
                                > > > So its like adding a second line really, with an audio alert on its
                                > hit...
                                > > >
                                > > > I tried adding
                                > > >
                                > > > alert( over_bought or over_sold, Alert.ONCE, Sound.DING );
                                > > >
                                > > > But it says "incompatible parameter".
                                > > >
                                > > > declare lower;
                                > > >
                                > > > input length = 14;
                                > > > input over_sold = -100;
                                > > > input over_bought = 100;
                                > > >
                                > > > def price = close + low + high;
                                > > > def linDev = lindev(price, length);
                                > > > plot CCI = if linDev == 0 then 0 else (price - Average(price, length)) /
                                > > > linDev / 0.015;
                                > > > plot OverBought = over_bought;
                                > > > plot ZeroLine = 0;
                                > > > plot OverSold = over_sold;
                                > > >
                                > > > CCI.setDefaultColor(GetColor(9));
                                > > > OverBought.setDefaultColor(GetColor(5));
                                > > > ZeroLine.setDefaultColor(GetColor(5));
                                > > > OverSold.setDefaultColor(GetColor(5));
                                > > >
                                > >
                                >
                              • Richard Houser
                                I started programming in Oct. 1966 and have continued to program in a variety of languages since then. thinkscript is yet another programming language, similar
                                Message 15 of 28 , Jun 17, 2011
                                View Source
                                • 0 Attachment

                                  I started programming in Oct. 1966 and have continued to program in a variety of languages since then. thinkscript is yet another programming language, similar to many more limited than most.

                                   

                                  From: TOS_thinkscript@yahoogroups.com [mailto:TOS_thinkscript@yahoogroups.com] On Behalf Of garuba_r
                                  Sent: Friday, June 17, 2011 10:08 PM
                                  To: TOS_thinkscript@yahoogroups.com
                                  Subject: [TOS_thinkscript] Re: CCI Alert

                                   

                                   

                                  Thanks Richard... How did you learn TOS scripting?... Man has to learn to fish.. ;-))

                                  --- In TOS_thinkscript@yahoogroups.com, "Richard Houser" <rhouser@...> wrote:
                                  >
                                  > OK, the answer is yes you can create a "complex formula" Alert Study, and
                                  > yes you CAN use a plot statement in the complex formula. It will be more
                                  > efficient to break the alert into a goLong (BUY) and goShort (SELL) alerts,
                                  > here's the code. Unfortunately you can only have one event trigger in a
                                  > study alert, so choose the one you want to monitor, copy and paste into the
                                  > edit box (having deleted any code that previously appeared in the edit box),
                                  > set the trigger to "true" and create the alert. Repeat the process for the
                                  > other alert, notice I broke the code to include the appropriate test in the
                                  > terminal plot statement.
                                  >
                                  > You can use this code as a model for creating other alerts. Don't forget to
                                  > setup the global alert parameters using the "Alert Setup" in the "ALERT
                                  > ENTRY TOOLS" sub-frame.
                                  >
                                  > =====[ Begin goLONG Alert ]=====
                                  > input length = 14;
                                  > input alertOS = -100;
                                  > input alertOB = 100;
                                  > input over_sold = -100;
                                  > input over_bought = 100;
                                  >
                                  > def price = close + low + high;
                                  > def linDev = lindev(price, length);
                                  > def CCI = if linDev == 0 then 0 else (price - Average(price, length)) /
                                  > linDev / 0.015;
                                  > plot goLong = if CCI[1] < alertOS and CCI > alertOS then yes else no;
                                  > #=====[End of goLONG]=====
                                  >
                                  >
                                  > #=====[ Begin goSHORT Alert ]=====
                                  > input length = 14;
                                  > input alertOS = -100;
                                  > input alertOB = 100;
                                  > input over_sold = -100;
                                  > input over_bought = 100;
                                  >
                                  > def price = close + low + high;
                                  > def linDev = lindev(price, length);
                                  > def CCI = if linDev == 0 then 0 else (price - Average(price, length)) /
                                  > linDev / 0.015;
                                  > plot goShort = if CCI[1] > alertOB and CCI < alertOB then yes else no;
                                  > #=====[End of goSHORT]=====
                                  >
                                  >
                                  >
                                  >
                                  >
                                  >
                                  >
                                  >
                                  >
                                  > From: TOS_thinkscript@yahoogroups.com
                                  > [mailto:TOS_thinkscript@yahoogroups.com] On Behalf Of garuba_r
                                  > Sent: Friday, June 17, 2011 1:54 PM
                                  > To: TOS_thinkscript@yahoogroups.com
                                  > Subject: [TOS_thinkscript] Re: CCI Alert
                                  >
                                  >
                                  >
                                  >
                                  >
                                  > Richard,
                                  >
                                  > Wow.. not as simple as I thought.. A LOT I have to learn.. Any idea on how
                                  > to strip these down to a complex formula for a study alert so the alerts can
                                  > be emailed even if TOS is off?? So far it doesn't want "plot" commands or
                                  > any charting command. I am building my system around 4 Hour charts and
                                  > leaving TOS on not always an option.
                                  >
                                  > A million thank you's.. Really appreciated.
                                  >
                                  > --- In TOS_thinkscript@yahoogroups.com
                                  > <mailto:TOS_thinkscript%40yahoogroups.com> , "Richard Houser" <rhouser@>
                                  > wrote:
                                  > >
                                  > > While the changes you made to the inputs coerced the arrows to where you
                                  > > wanted, it did not create a proper logical condition for the alerts to
                                  > fire.
                                  > > Try this instead:
                                  > > declare lower;
                                  > >
                                  > > input length = 14;
                                  > > input alertOS = -100;
                                  > > input alertOB = 100;
                                  > > input over_sold = -100;
                                  > > input over_bought = 100;
                                  > >
                                  > > def price = close + low + high;
                                  > > def linDev = lindev(price, length);
                                  > >
                                  > > plot CCI = if linDev == 0
                                  > > then 0
                                  > > else (price - Average(price, length)) / linDev / 0.015;
                                  > > CCI.setDefaultColor(GetColor(9));
                                  > >
                                  > > plot OverBought = over_bought;
                                  > > OverBought.SetDefaultColor(GetColor(5));
                                  > > OverBought.HideBubble();
                                  > > OverBought.HideTitle();
                                  > >
                                  > > plot ZeroLine = 0;
                                  > > ZeroLine.SetDefaultColor(GetColor(5));
                                  > > ZeroLine.HideBubble();
                                  > > ZeroLine.HideTitle();
                                  > >
                                  > > plot OverSold = over_sold;
                                  > > OverSold.setDefaultColor(GetColor(5));
                                  > > OverSold.HideBubble();
                                  > > OverSold.HideTitle();
                                  > >
                                  > > plot goLong = if CCI[1] < alertOS and CCI > alertOS
                                  > > then alertOS
                                  > > else Double.NaN;
                                  > > goLong.SetPaintingStrategy( PaintingStrategy.ARROW_UP );
                                  > >
                                  > > goLong.SetDefaultColor( Color.UPTICK );
                                  > >
                                  > > goLong.HideBubble();
                                  > >
                                  > > goLong.HideTitle();
                                  > >
                                  > > plot goShort = if CCI[1] > alertOB and CCI < alertOB
                                  > > then alertOB
                                  > > else Double.NaN;
                                  > > goShort.SetPaintingStrategy( PaintingStrategy.ARROW_DOWN );
                                  > >
                                  > > goShort.SetDefaultColor( Color.DOWNTICK );
                                  > >
                                  > > goShort.HideBubble();
                                  > >
                                  > > goShort.HideTitle();
                                  > >
                                  > > alert( goLong, concat( "CCI signals a BUY: ", concat( CCI[1], concat( " ->
                                  > > ", CCI ))), Alert.ONCE, Sound.Ding );
                                  > >
                                  > > alert( goShort, concat( "CCI signals a SELL: ", concat( CCI[1], concat( "
                                  > ->
                                  > > ", CCI ))), Alert.ONCE, Sound.Bell );
                                  > >
                                  > >
                                  > >
                                  > >
                                  > >
                                  > >
                                  > >
                                  > > From: TOS_thinkscript@yahoogroups.com
                                  > <mailto:TOS_thinkscript%40yahoogroups.com>
                                  > > [mailto:TOS_thinkscript@yahoogroups.com
                                  > <mailto:TOS_thinkscript%40yahoogroups.com> ] On Behalf Of garuba_r
                                  > > Sent: Friday, June 17, 2011 10:29 AM
                                  > > To: TOS_thinkscript@yahoogroups.com
                                  > <mailto:TOS_thinkscript%40yahoogroups.com>
                                  > > Subject: [TOS_thinkscript] Re: CCI Alert
                                  > >
                                  > >
                                  > >
                                  > >
                                  > >
                                  > > Richard,
                                  > >
                                  > > Thanks For this... I made the following change so I can get alarms when
                                  > CCI
                                  > > crosses back into the -100 to 100 range but now I get no alarms.. ideas??
                                  > >
                                  > > declare lower;
                                  > >
                                  > > input length = 14;
                                  > > input alertOS = 100;
                                  > > input alertOB = -100;
                                  > > input over_sold = 100;
                                  > > input over_bought = -100;
                                  > >
                                  > > --- In TOS_thinkscript@yahoogroups.com
                                  > <mailto:TOS_thinkscript%40yahoogroups.com>
                                  > > <mailto:TOS_thinkscript%40yahoogroups.com> , "Richard Houser" <rhouser@>
                                  > > wrote:
                                  > > >
                                  > > > Try this. It's a little more involved than you requested, but I think
                                  > > you'll
                                  > > > find it more effective to use, if not strip out what you don't want.
                                  > > >
                                  > > > declare lower;
                                  > > >
                                  > > > input length = 14;
                                  > > > input alertOS = -100;
                                  > > > input alertOB = 100;
                                  > > > input over_sold = -100;
                                  > > > input over_bought = 100;
                                  > > >
                                  > > > def price = close + low + high;
                                  > > > def linDev = lindev(price, length);
                                  > > >
                                  > > > plot CCI = if linDev == 0 then 0 else (price - Average(price, length)) /
                                  > > > linDev / 0.015;
                                  > > > CCI.setDefaultColor(GetColor(9));
                                  > > >
                                  > > > plot OverBought = over_bought;
                                  > > > OverBought.SetDefaultColor(GetColor(5));
                                  > > > OverBought.HideBubble();
                                  > > > OverBought.HideTitle();
                                  > > >
                                  > > > plot ZeroLine = 0;
                                  > > > ZeroLine.SetDefaultColor(GetColor(5));
                                  > > > ZeroLine.HideBubble();
                                  > > > ZeroLine.HideTitle();
                                  > > >
                                  > > > plot OverSold = over_sold;
                                  > > > OverSold.setDefaultColor(GetColor(5));
                                  > > > OverSold.HideBubble();
                                  > > > OverSold.HideTitle();
                                  > > >
                                  > > > plot aOB = if CCI[1] < alertOB and CCI > alertOB then alertOB else
                                  > > > Double.NaN;
                                  > > > aOB.SetPaintingStrategy( PaintingStrategy.ARROW_UP );
                                  > > > aOB.SetDefaultColor( Color.UPTICK );
                                  > > > aOB.HideBubble();
                                  > > > aOB.HideTitle();
                                  > > >
                                  > > > plot aOS = if CCI[1] > alertOS and CCI < alertOS then alertOS else
                                  > > > Double.NaN;
                                  > > > aOS.SetPaintingStrategy( PaintingStrategy.ARROW_DOWN );
                                  > > > aOS.SetDefaultColor( Color.DOWNTICK );
                                  > > > aOS.HideBubble();
                                  > > > aOS.HideTitle();
                                  > > >
                                  > > > alert( aOB, concat( "CCI is OverBought: ", CCI ), Alert.ONCE, Sound.Ding
                                  > > );
                                  > > > alert( aOS, concat( "CCI is OverSold: ", CCI ), Alert.ONCE, Sound.Bell
                                  > );
                                  > > >
                                  > > >
                                  > > >
                                  > > >
                                  > > >
                                  > > > From: TOS_thinkscript@yahoogroups.com
                                  > <mailto:TOS_thinkscript%40yahoogroups.com>
                                  > > <mailto:TOS_thinkscript%40yahoogroups.com>
                                  > > > [mailto:TOS_thinkscript@yahoogroups.com
                                  > <mailto:TOS_thinkscript%40yahoogroups.com>
                                  > > <mailto:TOS_thinkscript%40yahoogroups.com> ] On Behalf Of Nathan Crude
                                  > > > Sent: Tuesday, May 03, 2011 7:39 AM
                                  > > > To: TOS_thinkscript@yahoogroups.com
                                  > <mailto:TOS_thinkscript%40yahoogroups.com>
                                  > > <mailto:TOS_thinkscript%40yahoogroups.com>
                                  > > > Subject: [TOS_thinkscript] CCI Alert
                                  > > >
                                  > > >
                                  > > >
                                  > > >
                                  > > >
                                  > > > Hi,
                                  > > >
                                  > > > I have the below code for CCI. What do I add to it to be able to set an
                                  > > > alert for a given level of CCI...
                                  > > >
                                  > > > For example, the below code sets levels at -100 and +100, this is fine,
                                  > > but
                                  > > > what if I want an audio alert on touching a given number outside of that
                                  > > > range, ie -150 or -180, what code would I add to add an alarm for a
                                  > given
                                  > > > level (able to change the alarm level in preferences though) ?
                                  > > >
                                  > > > So its like adding a second line really, with an audio alert on its
                                  > hit...
                                  > > >
                                  > > > I tried adding
                                  > > >
                                  > > > alert( over_bought or over_sold, Alert.ONCE, Sound.DING );
                                  > > >
                                  > > > But it says "incompatible parameter".
                                  > > >
                                  > > > declare lower;
                                  > > >
                                  > > > input length = 14;
                                  > > > input over_sold = -100;
                                  > > > input over_bought = 100;
                                  > > >
                                  > > > def price = close + low + high;
                                  > > > def linDev = lindev(price, length);
                                  > > > plot CCI = if linDev == 0 then 0 else (price - Average(price, length)) /
                                  > > > linDev / 0.015;
                                  > > > plot OverBought = over_bought;
                                  > > > plot ZeroLine = 0;
                                  > > > plot OverSold = over_sold;
                                  > > >
                                  > > > CCI.setDefaultColor(GetColor(9));
                                  > > > OverBought.setDefaultColor(GetColor(5));
                                  > > > ZeroLine.setDefaultColor(GetColor(5));
                                  > > > OverSold.setDefaultColor(GetColor(5));
                                  > > >
                                  > >
                                  >

                                • RPinSC
                                  THE UNDERSTATEMENT OF THE YEAR: ..... similar to many more limited than most.....
                                  Message 16 of 28 , Jun 18, 2011
                                  View Source
                                  • 0 Attachment
                                    THE UNDERSTATEMENT OF THE YEAR:

                                    ..... similar to many more limited than most.....

                                    On Sat, Jun 18, 2011 at 12:33 AM, Richard Houser <rhouser@...> wrote:
                                     

                                    I started programming in Oct. 1966 and have continued to program in a variety of languages since then. thinkscript is yet another programming language, similar to many more limited than most.

                                     

                                    From: TOS_thinkscript@yahoogroups.com [mailto:TOS_thinkscript@yahoogroups.com] On Behalf Of garuba_r
                                    Sent: Friday, June 17, 2011 10:08 PM


                                    To: TOS_thinkscript@yahoogroups.com
                                    Subject: [TOS_thinkscript] Re: CCI Alert

                                     

                                     

                                    Thanks Richard... How did you learn TOS scripting?... Man has to learn to fish.. ;-))

                                    --- In TOS_thinkscript@yahoogroups.com, "Richard Houser" <rhouser@...> wrote:
                                    >
                                    > OK, the answer is yes you can create a "complex formula" Alert Study, and
                                    > yes you CAN use a plot statement in the complex formula. It will be more
                                    > efficient to break the alert into a goLong (BUY) and goShort (SELL) alerts,
                                    > here's the code. Unfortunately you can only have one event trigger in a
                                    > study alert, so choose the one you want to monitor, copy and paste into the
                                    > edit box (having deleted any code that previously appeared in the edit box),
                                    > set the trigger to "true" and create the alert. Repeat the process for the
                                    > other alert, notice I broke the code to include the appropriate test in the
                                    > terminal plot statement.
                                    >
                                    > You can use this code as a model for creating other alerts. Don't forget to
                                    > setup the global alert parameters using the "Alert Setup" in the "ALERT
                                    > ENTRY TOOLS" sub-frame.
                                    >
                                    > =====[ Begin goLONG Alert ]=====
                                    > input length = 14;
                                    > input alertOS = -100;
                                    > input alertOB = 100;
                                    > input over_sold = -100;
                                    > input over_bought = 100;
                                    >
                                    > def price = close + low + high;
                                    > def linDev = lindev(price, length);
                                    > def CCI = if linDev == 0 then 0 else (price - Average(price, length)) /
                                    > linDev / 0.015;
                                    > plot goLong = if CCI[1] < alertOS and CCI > alertOS then yes else no;
                                    > #=====[End of goLONG]=====
                                    >
                                    >
                                    > #=====[ Begin goSHORT Alert ]=====
                                    > input length = 14;
                                    > input alertOS = -100;
                                    > input alertOB = 100;
                                    > input over_sold = -100;
                                    > input over_bought = 100;
                                    >
                                    > def price = close + low + high;
                                    > def linDev = lindev(price, length);
                                    > def CCI = if linDev == 0 then 0 else (price - Average(price, length)) /
                                    > linDev / 0.015;
                                    > plot goShort = if CCI[1] > alertOB and CCI < alertOB then yes else no;
                                    > #=====[End of goSHORT]=====
                                    >
                                    >
                                    >
                                    >
                                    >
                                    >
                                    >
                                    >
                                    >
                                    > From: TOS_thinkscript@yahoogroups.com
                                    > [mailto:TOS_thinkscript@yahoogroups.com] On Behalf Of garuba_r
                                    > Sent: Friday, June 17, 2011 1:54 PM
                                    > To: TOS_thinkscript@yahoogroups.com
                                    > Subject: [TOS_thinkscript] Re: CCI Alert
                                    >
                                    >
                                    >
                                    >
                                    >
                                    > Richard,
                                    >
                                    > Wow.. not as simple as I thought.. A LOT I have to learn.. Any idea on how
                                    > to strip these down to a complex formula for a study alert so the alerts can
                                    > be emailed even if TOS is off?? So far it doesn't want "plot" commands or
                                    > any charting command. I am building my system around 4 Hour charts and
                                    > leaving TOS on not always an option.
                                    >
                                    > A million thank you's.. Really appreciated.
                                    >
                                    > --- In TOS_thinkscript@yahoogroups.com
                                    > <mailto:TOS_thinkscript%40yahoogroups.com> , "Richard Houser" <rhouser@>
                                    > wrote:
                                    > >
                                    > > While the changes you made to the inputs coerced the arrows to where you
                                    > > wanted, it did not create a proper logical condition for the alerts to
                                    > fire.
                                    > > Try this instead:
                                    > > declare lower;
                                    > >
                                    > > input length = 14;
                                    > > input alertOS = -100;
                                    > > input alertOB = 100;
                                    > > input over_sold = -100;
                                    > > input over_bought = 100;
                                    > >
                                    > > def price = close + low + high;
                                    > > def linDev = lindev(price, length);
                                    > >
                                    > > plot CCI = if linDev == 0
                                    > > then 0
                                    > > else (price - Average(price, length)) / linDev / 0.015;
                                    > > CCI.setDefaultColor(GetColor(9));
                                    > >
                                    > > plot OverBought = over_bought;
                                    > > OverBought.SetDefaultColor(GetColor(5));
                                    > > OverBought.HideBubble();
                                    > > OverBought.HideTitle();
                                    > >
                                    > > plot ZeroLine = 0;
                                    > > ZeroLine.SetDefaultColor(GetColor(5));
                                    > > ZeroLine.HideBubble();
                                    > > ZeroLine.HideTitle();
                                    > >
                                    > > plot OverSold = over_sold;
                                    > > OverSold.setDefaultColor(GetColor(5));
                                    > > OverSold.HideBubble();
                                    > > OverSold.HideTitle();
                                    > >
                                    > > plot goLong = if CCI[1] < alertOS and CCI > alertOS
                                    > > then alertOS
                                    > > else Double.NaN;
                                    > > goLong.SetPaintingStrategy( PaintingStrategy.ARROW_UP );
                                    > >
                                    > > goLong.SetDefaultColor( Color.UPTICK );
                                    > >
                                    > > goLong.HideBubble();
                                    > >
                                    > > goLong.HideTitle();
                                    > >
                                    > > plot goShort = if CCI[1] > alertOB and CCI < alertOB
                                    > > then alertOB
                                    > > else Double.NaN;
                                    > > goShort.SetPaintingStrategy( PaintingStrategy.ARROW_DOWN );
                                    > >
                                    > > goShort.SetDefaultColor( Color.DOWNTICK );
                                    > >
                                    > > goShort.HideBubble();
                                    > >
                                    > > goShort.HideTitle();
                                    > >
                                    > > alert( goLong, concat( "CCI signals a BUY: ", concat( CCI[1], concat( " ->
                                    > > ", CCI ))), Alert.ONCE, Sound.Ding );
                                    > >
                                    > > alert( goShort, concat( "CCI signals a SELL: ", concat( CCI[1], concat( "
                                    > ->
                                    > > ", CCI ))), Alert.ONCE, Sound.Bell );
                                    > >
                                    > >
                                    > >
                                    > >
                                    > >
                                    > >
                                    > >
                                    > > From: TOS_thinkscript@yahoogroups.com
                                    > <mailto:TOS_thinkscript%40yahoogroups.com>
                                    > > [mailto:TOS_thinkscript@yahoogroups.com
                                    > <mailto:TOS_thinkscript%40yahoogroups.com> ] On Behalf Of garuba_r
                                    > > Sent: Friday, June 17, 2011 10:29 AM
                                    > > To: TOS_thinkscript@yahoogroups.com
                                    > <mailto:TOS_thinkscript%40yahoogroups.com>
                                    > > Subject: [TOS_thinkscript] Re: CCI Alert
                                    > >
                                    > >
                                    > >
                                    > >
                                    > >
                                    > > Richard,
                                    > >
                                    > > Thanks For this... I made the following change so I can get alarms when
                                    > CCI
                                    > > crosses back into the -100 to 100 range but now I get no alarms.. ideas??
                                    > >
                                    > > declare lower;
                                    > >
                                    > > input length = 14;
                                    > > input alertOS = 100;
                                    > > input alertOB = -100;
                                    > > input over_sold = 100;
                                    > > input over_bought = -100;
                                    > >
                                    > > --- In TOS_thinkscript@yahoogroups.com
                                    > <mailto:TOS_thinkscript%40yahoogroups.com>
                                    > > <mailto:TOS_thinkscript%40yahoogroups.com> , "Richard Houser" <rhouser@>
                                    > > wrote:
                                    > > >
                                    > > > Try this. It's a little more involved than you requested, but I think
                                    > > you'll
                                    > > > find it more effective to use, if not strip out what you don't want.
                                    > > >
                                    > > > declare lower;
                                    > > >
                                    > > > input length = 14;
                                    > > > input alertOS = -100;
                                    > > > input alertOB = 100;
                                    > > > input over_sold = -100;
                                    > > > input over_bought = 100;
                                    > > >
                                    > > > def price = close + low + high;
                                    > > > def linDev = lindev(price, length);
                                    > > >
                                    > > > plot CCI = if linDev == 0 then 0 else (price - Average(price, length)) /
                                    > > > linDev / 0.015;
                                    > > > CCI.setDefaultColor(GetColor(9));
                                    > > >
                                    > > > plot OverBought = over_bought;
                                    > > > OverBought.SetDefaultColor(GetColor(5));
                                    > > > OverBought.HideBubble();
                                    > > > OverBought.HideTitle();
                                    > > >
                                    > > > plot ZeroLine = 0;
                                    > > > ZeroLine.SetDefaultColor(GetColor(5));
                                    > > > ZeroLine.HideBubble();
                                    > > > ZeroLine.HideTitle();
                                    > > >
                                    > > > plot OverSold = over_sold;
                                    > > > OverSold.setDefaultColor(GetColor(5));
                                    > > > OverSold.HideBubble();
                                    > > > OverSold.HideTitle();
                                    > > >
                                    > > > plot aOB = if CCI[1] < alertOB and CCI > alertOB then alertOB else
                                    > > > Double.NaN;
                                    > > > aOB.SetPaintingStrategy( PaintingStrategy.ARROW_UP );
                                    > > > aOB.SetDefaultColor( Color.UPTICK );
                                    > > > aOB.HideBubble();
                                    > > > aOB.HideTitle();
                                    > > >
                                    > > > plot aOS = if CCI[1] > alertOS and CCI < alertOS then alertOS else
                                    > > > Double.NaN;
                                    > > > aOS.SetPaintingStrategy( PaintingStrategy.ARROW_DOWN );
                                    > > > aOS.SetDefaultColor( Color.DOWNTICK );
                                    > > > aOS.HideBubble();
                                    > > > aOS.HideTitle();
                                    > > >
                                    > > > alert( aOB, concat( "CCI is OverBought: ", CCI ), Alert.ONCE, Sound.Ding
                                    > > );
                                    > > > alert( aOS, concat( "CCI is OverSold: ", CCI ), Alert.ONCE, Sound.Bell
                                    > );
                                    > > >
                                    > > >
                                    > > >
                                    > > >
                                    > > >
                                    > > > From: TOS_thinkscript@yahoogroups.com
                                    > <mailto:TOS_thinkscript%40yahoogroups.com>
                                    > > <mailto:TOS_thinkscript%40yahoogroups.com>
                                    > > > [mailto:TOS_thinkscript@yahoogroups.com
                                    > <mailto:TOS_thinkscript%40yahoogroups.com>
                                    > > <mailto:TOS_thinkscript%40yahoogroups.com> ] On Behalf Of Nathan Crude
                                    > > > Sent: Tuesday, May 03, 2011 7:39 AM
                                    > > > To: TOS_thinkscript@yahoogroups.com
                                    > <mailto:TOS_thinkscript%40yahoogroups.com>
                                    > > <mailto:TOS_thinkscript%40yahoogroups.com>
                                    > > > Subject: [TOS_thinkscript] CCI Alert
                                    > > >
                                    > > >
                                    > > >
                                    > > >
                                    > > >
                                    > > > Hi,
                                    > > >
                                    > > > I have the below code for CCI. What do I add to it to be able to set an
                                    > > > alert for a given level of CCI...
                                    > > >
                                    > > > For example, the below code sets levels at -100 and +100, this is fine,
                                    > > but
                                    > > > what if I want an audio alert on touching a given number outside of that
                                    > > > range, ie -150 or -180, what code would I add to add an alarm for a
                                    > given
                                    > > > level (able to change the alarm level in preferences though) ?
                                    > > >
                                    > > > So its like adding a second line really, with an audio alert on its
                                    > hit...
                                    > > >
                                    > > > I tried adding
                                    > > >
                                    > > > alert( over_bought or over_sold, Alert.ONCE, Sound.DING );
                                    > > >
                                    > > > But it says "incompatible parameter".
                                    > > >
                                    > > > declare lower;
                                    > > >
                                    > > > input length = 14;
                                    > > > input over_sold = -100;
                                    > > > input over_bought = 100;
                                    > > >
                                    > > > def price = close + low + high;
                                    > > > def linDev = lindev(price, length);
                                    > > > plot CCI = if linDev == 0 then 0 else (price - Average(price, length)) /
                                    > > > linDev / 0.015;
                                    > > > plot OverBought = over_bought;
                                    > > > plot ZeroLine = 0;
                                    > > > plot OverSold = over_sold;
                                    > > >
                                    > > > CCI.setDefaultColor(GetColor(9));
                                    > > > OverBought.setDefaultColor(GetColor(5));
                                    > > > ZeroLine.setDefaultColor(GetColor(5));
                                    > > > OverSold.setDefaultColor(GetColor(5));
                                    > > >
                                    > >
                                    >


                                  • garuba_r
                                    i.e. you have some experience.. I was in diapers then..
                                    Message 17 of 28 , Jun 18, 2011
                                    View Source
                                    • 0 Attachment
                                      i.e. you have "some" experience.. I was in diapers then..

                                      --- In TOS_thinkscript@yahoogroups.com, "Richard Houser" <rhouser@...> wrote:
                                      >
                                      > I started programming in Oct. 1966 and have continued to program in a
                                      > variety of languages since then. thinkscript is yet another programming
                                      > language, similar to many more limited than most.
                                      >
                                      >
                                      >
                                      > From: TOS_thinkscript@yahoogroups.com
                                      > [mailto:TOS_thinkscript@yahoogroups.com] On Behalf Of garuba_r
                                      > Sent: Friday, June 17, 2011 10:08 PM
                                      > To: TOS_thinkscript@yahoogroups.com
                                      > Subject: [TOS_thinkscript] Re: CCI Alert
                                      >
                                      >
                                      >
                                      >
                                      >
                                      > Thanks Richard... How did you learn TOS scripting?... Man has to learn to
                                      > fish.. ;-))
                                      >
                                      > --- In TOS_thinkscript@yahoogroups.com
                                      > <mailto:TOS_thinkscript%40yahoogroups.com> , "Richard Houser" <rhouser@>
                                      > wrote:
                                      > >
                                      > > OK, the answer is yes you can create a "complex formula" Alert Study, and
                                      > > yes you CAN use a plot statement in the complex formula. It will be more
                                      > > efficient to break the alert into a goLong (BUY) and goShort (SELL)
                                      > alerts,
                                      > > here's the code. Unfortunately you can only have one event trigger in a
                                      > > study alert, so choose the one you want to monitor, copy and paste into
                                      > the
                                      > > edit box (having deleted any code that previously appeared in the edit
                                      > box),
                                      > > set the trigger to "true" and create the alert. Repeat the process for the
                                      > > other alert, notice I broke the code to include the appropriate test in
                                      > the
                                      > > terminal plot statement.
                                      > >
                                      > > You can use this code as a model for creating other alerts. Don't forget
                                      > to
                                      > > setup the global alert parameters using the "Alert Setup" in the "ALERT
                                      > > ENTRY TOOLS" sub-frame.
                                      > >
                                      > > =====[ Begin goLONG Alert ]=====
                                      > > input length = 14;
                                      > > input alertOS = -100;
                                      > > input alertOB = 100;
                                      > > input over_sold = -100;
                                      > > input over_bought = 100;
                                      > >
                                      > > def price = close + low + high;
                                      > > def linDev = lindev(price, length);
                                      > > def CCI = if linDev == 0 then 0 else (price - Average(price, length)) /
                                      > > linDev / 0.015;
                                      > > plot goLong = if CCI[1] < alertOS and CCI > alertOS then yes else no;
                                      > > #=====[End of goLONG]=====
                                      > >
                                      > >
                                      > > #=====[ Begin goSHORT Alert ]=====
                                      > > input length = 14;
                                      > > input alertOS = -100;
                                      > > input alertOB = 100;
                                      > > input over_sold = -100;
                                      > > input over_bought = 100;
                                      > >
                                      > > def price = close + low + high;
                                      > > def linDev = lindev(price, length);
                                      > > def CCI = if linDev == 0 then 0 else (price - Average(price, length)) /
                                      > > linDev / 0.015;
                                      > > plot goShort = if CCI[1] > alertOB and CCI < alertOB then yes else no;
                                      > > #=====[End of goSHORT]=====
                                      > >
                                      > >
                                      > >
                                      > >
                                      > >
                                      > >
                                      > >
                                      > >
                                      > >
                                      > > From: TOS_thinkscript@yahoogroups.com
                                      > <mailto:TOS_thinkscript%40yahoogroups.com>
                                      > > [mailto:TOS_thinkscript@yahoogroups.com
                                      > <mailto:TOS_thinkscript%40yahoogroups.com> ] On Behalf Of garuba_r
                                      > > Sent: Friday, June 17, 2011 1:54 PM
                                      > > To: TOS_thinkscript@yahoogroups.com
                                      > <mailto:TOS_thinkscript%40yahoogroups.com>
                                      > > Subject: [TOS_thinkscript] Re: CCI Alert
                                      > >
                                      > >
                                      > >
                                      > >
                                      > >
                                      > > Richard,
                                      > >
                                      > > Wow.. not as simple as I thought.. A LOT I have to learn.. Any idea on how
                                      > > to strip these down to a complex formula for a study alert so the alerts
                                      > can
                                      > > be emailed even if TOS is off?? So far it doesn't want "plot" commands or
                                      > > any charting command. I am building my system around 4 Hour charts and
                                      > > leaving TOS on not always an option.
                                      > >
                                      > > A million thank you's.. Really appreciated.
                                      > >
                                      > > --- In TOS_thinkscript@yahoogroups.com
                                      > <mailto:TOS_thinkscript%40yahoogroups.com>
                                      > > <mailto:TOS_thinkscript%40yahoogroups.com> , "Richard Houser" <rhouser@>
                                      > > wrote:
                                      > > >
                                      > > > While the changes you made to the inputs coerced the arrows to where you
                                      > > > wanted, it did not create a proper logical condition for the alerts to
                                      > > fire.
                                      > > > Try this instead:
                                      > > > declare lower;
                                      > > >
                                      > > > input length = 14;
                                      > > > input alertOS = -100;
                                      > > > input alertOB = 100;
                                      > > > input over_sold = -100;
                                      > > > input over_bought = 100;
                                      > > >
                                      > > > def price = close + low + high;
                                      > > > def linDev = lindev(price, length);
                                      > > >
                                      > > > plot CCI = if linDev == 0
                                      > > > then 0
                                      > > > else (price - Average(price, length)) / linDev / 0.015;
                                      > > > CCI.setDefaultColor(GetColor(9));
                                      > > >
                                      > > > plot OverBought = over_bought;
                                      > > > OverBought.SetDefaultColor(GetColor(5));
                                      > > > OverBought.HideBubble();
                                      > > > OverBought.HideTitle();
                                      > > >
                                      > > > plot ZeroLine = 0;
                                      > > > ZeroLine.SetDefaultColor(GetColor(5));
                                      > > > ZeroLine.HideBubble();
                                      > > > ZeroLine.HideTitle();
                                      > > >
                                      > > > plot OverSold = over_sold;
                                      > > > OverSold.setDefaultColor(GetColor(5));
                                      > > > OverSold.HideBubble();
                                      > > > OverSold.HideTitle();
                                      > > >
                                      > > > plot goLong = if CCI[1] < alertOS and CCI > alertOS
                                      > > > then alertOS
                                      > > > else Double.NaN;
                                      > > > goLong.SetPaintingStrategy( PaintingStrategy.ARROW_UP );
                                      > > >
                                      > > > goLong.SetDefaultColor( Color.UPTICK );
                                      > > >
                                      > > > goLong.HideBubble();
                                      > > >
                                      > > > goLong.HideTitle();
                                      > > >
                                      > > > plot goShort = if CCI[1] > alertOB and CCI < alertOB
                                      > > > then alertOB
                                      > > > else Double.NaN;
                                      > > > goShort.SetPaintingStrategy( PaintingStrategy.ARROW_DOWN );
                                      > > >
                                      > > > goShort.SetDefaultColor( Color.DOWNTICK );
                                      > > >
                                      > > > goShort.HideBubble();
                                      > > >
                                      > > > goShort.HideTitle();
                                      > > >
                                      > > > alert( goLong, concat( "CCI signals a BUY: ", concat( CCI[1], concat( "
                                      > ->
                                      > > > ", CCI ))), Alert.ONCE, Sound.Ding );
                                      > > >
                                      > > > alert( goShort, concat( "CCI signals a SELL: ", concat( CCI[1], concat(
                                      > "
                                      > > ->
                                      > > > ", CCI ))), Alert.ONCE, Sound.Bell );
                                      > > >
                                      > > >
                                      > > >
                                      > > >
                                      > > >
                                      > > >
                                      > > >
                                      > > > From: TOS_thinkscript@yahoogroups.com
                                      > <mailto:TOS_thinkscript%40yahoogroups.com>
                                      > > <mailto:TOS_thinkscript%40yahoogroups.com>
                                      > > > [mailto:TOS_thinkscript@yahoogroups.com
                                      > <mailto:TOS_thinkscript%40yahoogroups.com>
                                      > > <mailto:TOS_thinkscript%40yahoogroups.com> ] On Behalf Of garuba_r
                                      > > > Sent: Friday, June 17, 2011 10:29 AM
                                      > > > To: TOS_thinkscript@yahoogroups.com
                                      > <mailto:TOS_thinkscript%40yahoogroups.com>
                                      > > <mailto:TOS_thinkscript%40yahoogroups.com>
                                      > > > Subject: [TOS_thinkscript] Re: CCI Alert
                                      > > >
                                      > > >
                                      > > >
                                      > > >
                                      > > >
                                      > > > Richard,
                                      > > >
                                      > > > Thanks For this... I made the following change so I can get alarms when
                                      > > CCI
                                      > > > crosses back into the -100 to 100 range but now I get no alarms..
                                      > ideas??
                                      > > >
                                      > > > declare lower;
                                      > > >
                                      > > > input length = 14;
                                      > > > input alertOS = 100;
                                      > > > input alertOB = -100;
                                      > > > input over_sold = 100;
                                      > > > input over_bought = -100;
                                      > > >
                                      > > > --- In TOS_thinkscript@yahoogroups.com
                                      > <mailto:TOS_thinkscript%40yahoogroups.com>
                                      > > <mailto:TOS_thinkscript%40yahoogroups.com>
                                      > > > <mailto:TOS_thinkscript%40yahoogroups.com> , "Richard Houser" <rhouser@>
                                      > > > wrote:
                                      > > > >
                                      > > > > Try this. It's a little more involved than you requested, but I think
                                      > > > you'll
                                      > > > > find it more effective to use, if not strip out what you don't want.
                                      > > > >
                                      > > > > declare lower;
                                      > > > >
                                      > > > > input length = 14;
                                      > > > > input alertOS = -100;
                                      > > > > input alertOB = 100;
                                      > > > > input over_sold = -100;
                                      > > > > input over_bought = 100;
                                      > > > >
                                      > > > > def price = close + low + high;
                                      > > > > def linDev = lindev(price, length);
                                      > > > >
                                      > > > > plot CCI = if linDev == 0 then 0 else (price - Average(price, length))
                                      > /
                                      > > > > linDev / 0.015;
                                      > > > > CCI.setDefaultColor(GetColor(9));
                                      > > > >
                                      > > > > plot OverBought = over_bought;
                                      > > > > OverBought.SetDefaultColor(GetColor(5));
                                      > > > > OverBought.HideBubble();
                                      > > > > OverBought.HideTitle();
                                      > > > >
                                      > > > > plot ZeroLine = 0;
                                      > > > > ZeroLine.SetDefaultColor(GetColor(5));
                                      > > > > ZeroLine.HideBubble();
                                      > > > > ZeroLine.HideTitle();
                                      > > > >
                                      > > > > plot OverSold = over_sold;
                                      > > > > OverSold.setDefaultColor(GetColor(5));
                                      > > > > OverSold.HideBubble();
                                      > > > > OverSold.HideTitle();
                                      > > > >
                                      > > > > plot aOB = if CCI[1] < alertOB and CCI > alertOB then alertOB else
                                      > > > > Double.NaN;
                                      > > > > aOB.SetPaintingStrategy( PaintingStrategy.ARROW_UP );
                                      > > > > aOB.SetDefaultColor( Color.UPTICK );
                                      > > > > aOB.HideBubble();
                                      > > > > aOB.HideTitle();
                                      > > > >
                                      > > > > plot aOS = if CCI[1] > alertOS and CCI < alertOS then alertOS else
                                      > > > > Double.NaN;
                                      > > > > aOS.SetPaintingStrategy( PaintingStrategy.ARROW_DOWN );
                                      > > > > aOS.SetDefaultColor( Color.DOWNTICK );
                                      > > > > aOS.HideBubble();
                                      > > > > aOS.HideTitle();
                                      > > > >
                                      > > > > alert( aOB, concat( "CCI is OverBought: ", CCI ), Alert.ONCE,
                                      > Sound.Ding
                                      > > > );
                                      > > > > alert( aOS, concat( "CCI is OverSold: ", CCI ), Alert.ONCE, Sound.Bell
                                      > > );
                                      > > > >
                                      > > > >
                                      > > > >
                                      > > > >
                                      > > > >
                                      > > > > From: TOS_thinkscript@yahoogroups.com
                                      > <mailto:TOS_thinkscript%40yahoogroups.com>
                                      > > <mailto:TOS_thinkscript%40yahoogroups.com>
                                      > > > <mailto:TOS_thinkscript%40yahoogroups.com>
                                      > > > > [mailto:TOS_thinkscript@yahoogroups.com
                                      > <mailto:TOS_thinkscript%40yahoogroups.com>
                                      > > <mailto:TOS_thinkscript%40yahoogroups.com>
                                      > > > <mailto:TOS_thinkscript%40yahoogroups.com> ] On Behalf Of Nathan Crude
                                      > > > > Sent: Tuesday, May 03, 2011 7:39 AM
                                      > > > > To: TOS_thinkscript@yahoogroups.com
                                      > <mailto:TOS_thinkscript%40yahoogroups.com>
                                      > > <mailto:TOS_thinkscript%40yahoogroups.com>
                                      > > > <mailto:TOS_thinkscript%40yahoogroups.com>
                                      > > > > Subject: [TOS_thinkscript] CCI Alert
                                      > > > >
                                      > > > >
                                      > > > >
                                      > > > >
                                      > > > >
                                      > > > > Hi,
                                      > > > >
                                      > > > > I have the below code for CCI. What do I add to it to be able to set
                                      > an
                                      > > > > alert for a given level of CCI...
                                      > > > >
                                      > > > > For example, the below code sets levels at -100 and +100, this is
                                      > fine,
                                      > > > but
                                      > > > > what if I want an audio alert on touching a given number outside of
                                      > that
                                      > > > > range, ie -150 or -180, what code would I add to add an alarm for a
                                      > > given
                                      > > > > level (able to change the alarm level in preferences though) ?
                                      > > > >
                                      > > > > So its like adding a second line really, with an audio alert on its
                                      > > hit...
                                      > > > >
                                      > > > > I tried adding
                                      > > > >
                                      > > > > alert( over_bought or over_sold, Alert.ONCE, Sound.DING );
                                      > > > >
                                      > > > > But it says "incompatible parameter".
                                      > > > >
                                      > > > > declare lower;
                                      > > > >
                                      > > > > input length = 14;
                                      > > > > input over_sold = -100;
                                      > > > > input over_bought = 100;
                                      > > > >
                                      > > > > def price = close + low + high;
                                      > > > > def linDev = lindev(price, length);
                                      > > > > plot CCI = if linDev == 0 then 0 else (price - Average(price, length))
                                      > /
                                      > > > > linDev / 0.015;
                                      > > > > plot OverBought = over_bought;
                                      > > > > plot ZeroLine = 0;
                                      > > > > plot OverSold = over_sold;
                                      > > > >
                                      > > > > CCI.setDefaultColor(GetColor(9));
                                      > > > > OverBought.setDefaultColor(GetColor(5));
                                      > > > > ZeroLine.setDefaultColor(GetColor(5));
                                      > > > > OverSold.setDefaultColor(GetColor(5));
                                      > > > >
                                      > > >
                                      > >
                                      >
                                    • Raj Patel
                                      i was crawling butt naked as there was no diaper in my city where i grew up ... From: garuba_r Subject: [TOS_thinkscript] Re: CCI Alert
                                      Message 18 of 28 , Jun 20, 2011
                                      View Source
                                      • 0 Attachment
                                        i was crawling butt naked as there was no diaper in my city where i grew up

                                        --- On Sat, 6/18/11, garuba_r <garuba_r@...> wrote:

                                        From: garuba_r <garuba_r@...>
                                        Subject: [TOS_thinkscript] Re: CCI Alert
                                        To: TOS_thinkscript@yahoogroups.com
                                        Date: Saturday, June 18, 2011, 8:03 PM

                                         

                                        i.e. you have "some" experience.. I was in diapers then..

                                        --- In TOS_thinkscript@yahoogroups.com, "Richard Houser" <rhouser@...> wrote:
                                        >
                                        > I started programming in Oct. 1966 and have continued to program in a
                                        > variety of languages since then. thinkscript is yet another programming
                                        > language, similar to many more limited than most.
                                        >
                                        >
                                        >
                                        > From: TOS_thinkscript@yahoogroups.com
                                        > [mailto:TOS_thinkscript@yahoogroups.com] On Behalf Of garuba_r
                                        > Sent: Friday, June 17, 2011 10:08 PM
                                        > To: TOS_thinkscript@yahoogroups.com
                                        > Subject: [TOS_thinkscript] Re: CCI Alert
                                        >
                                        >
                                        >
                                        >
                                        >
                                        > Thanks Richard... How did you learn TOS scripting?... Man has to learn to
                                        > fish.. ;-))
                                        >
                                        > --- In TOS_thinkscript@yahoogroups.com
                                        > <mailto:TOS_thinkscript%40yahoogroups.com> , "Richard Houser" <rhouser@>
                                        > wrote:
                                        > >
                                        > > OK, the answer is yes you can create a "complex formula" Alert Study, and
                                        > > yes you CAN use a plot statement in the complex formula. It will be more
                                        > > efficient to break the alert into a goLong (BUY) and goShort (SELL)
                                        > alerts,
                                        > > here's the code. Unfortunately you can only have one event trigger in a
                                        > > study alert, so choose the one you want to monitor, copy and paste into
                                        > the
                                        > > edit box (having deleted any code that previously appeared in the edit
                                        > box),
                                        > > set the trigger to "true" and create the alert. Repeat the process for the
                                        > > other alert, notice I broke the code to include the appropriate test in
                                        > the
                                        > > terminal plot statement.
                                        > >
                                        > > You can use this code as a model for creating other alerts. Don't forget
                                        > to
                                        > > setup the global alert parameters using the "Alert Setup" in the "ALERT
                                        > > ENTRY TOOLS" sub-frame.
                                        > >
                                        > > =====[ Begin goLONG Alert ]=====
                                        > > input length = 14;
                                        > > input alertOS = -100;
                                        > > input alertOB = 100;
                                        > > input over_sold = -100;
                                        > > input over_bought = 100;
                                        > >
                                        > > def price = close + low + high;
                                        > > def linDev = lindev(price, length);
                                        > > def CCI = if linDev == 0 then 0 else (price - Average(price, length)) /
                                        > > linDev / 0.015;
                                        > > plot goLong = if CCI[1] < alertOS and CCI > alertOS then yes else no;
                                        > > #=====[End of goLONG]=====
                                        > >
                                        > >
                                        > > #=====[ Begin goSHORT Alert ]=====
                                        > > input length = 14;
                                        > > input alertOS = -100;
                                        > > input alertOB = 100;
                                        > > input over_sold = -100;
                                        > > input over_bought = 100;
                                        > >
                                        > > def price = close + low + high;
                                        > > def linDev = lindev(price, length);
                                        > > def CCI = if linDev == 0 then 0 else (price - Average(price, length)) /
                                        > > linDev / 0.015;
                                        > > plot goShort = if CCI[1] > alertOB and CCI < alertOB then yes else no;
                                        > > #=====[End of goSHORT]=====
                                        > >
                                        > >
                                        > >
                                        > >
                                        > >
                                        > >
                                        > >
                                        > >
                                        > >
                                        > > From: TOS_thinkscript@yahoogroups.com
                                        > <mailto:TOS_thinkscript%40yahoogroups.com>
                                        > > [mailto:TOS_thinkscript@yahoogroups.com
                                        > <mailto:TOS_thinkscript%40yahoogroups.com> ] On Behalf Of garuba_r
                                        > > Sent: Friday, June 17, 2011 1:54 PM
                                        > > To: TOS_thinkscript@yahoogroups.com
                                        > <mailto:TOS_thinkscript%40yahoogroups.com>
                                        > > Subject: [TOS_thinkscript] Re: CCI Alert
                                        > >
                                        > >
                                        > >
                                        > >
                                        > >
                                        > > Richard,
                                        > >
                                        > > Wow.. not as simple as I thought.. A LOT I have to learn.. Any idea on how
                                        > > to strip these down to a complex formula for a study alert so the alerts
                                        > can
                                        > > be emailed even if TOS is off?? So far it doesn't want "plot" commands or
                                        > > any charting command. I am building my system around 4 Hour charts and
                                        > > leaving TOS on not always an option.
                                        > >
                                        > > A million thank you's.. Really appreciated.
                                        > >
                                        > > --- In TOS_thinkscript@yahoogroups.com
                                        > <mailto:TOS_thinkscript%40yahoogroups.com>
                                        > > <mailto:TOS_thinkscript%40yahoogroups.com> , "Richard Houser" <rhouser@>
                                        > > wrote:
                                        > > >
                                        > > > While the changes you made to the inputs coerced the arrows to where you
                                        > > > wanted, it did not create a proper logical condition for the alerts to
                                        > > fire.
                                        > > > Try this instead:
                                        > > > declare lower;
                                        > > >
                                        > > > input length = 14;
                                        > > > input alertOS = -100;
                                        > > > input alertOB = 100;
                                        > > > input over_sold = -100;
                                        > > > input over_bought = 100;
                                        > > >
                                        > > > def price = close + low + high;
                                        > > > def linDev = lindev(price, length);
                                        > > >
                                        > > > plot CCI = if linDev == 0
                                        > > > then 0
                                        > > > else (price - Average(price, length)) / linDev / 0.015;
                                        > > > CCI.setDefaultColor(GetColor(9));
                                        > > >
                                        > > > plot OverBought = over_bought;
                                        > > > OverBought.SetDefaultColor(GetColor(5));
                                        > > > OverBought.HideBubble();
                                        > > > OverBought.HideTitle();
                                        > > >
                                        > > > plot ZeroLine = 0;
                                        > > > ZeroLine.SetDefaultColor(GetColor(5));
                                        > > > ZeroLine.HideBubble();
                                        > > > ZeroLine.HideTitle();
                                        > > >
                                        > > > plot OverSold = over_sold;
                                        > > > OverSold.setDefaultColor(GetColor(5));
                                        > > > OverSold.HideBubble();
                                        > > > OverSold.HideTitle();
                                        > > >
                                        > > > plot goLong = if CCI[1] < alertOS and CCI > alertOS
                                        > > > then alertOS
                                        > > > else Double.NaN;
                                        > > > goLong.SetPaintingStrategy( PaintingStrategy.ARROW_UP );
                                        > > >
                                        > > > goLong.SetDefaultColor( Color.UPTICK );
                                        > > >
                                        > > > goLong.HideBubble();
                                        > > >
                                        > > > goLong.HideTitle();
                                        > > >
                                        > > > plot goShort = if CCI[1] > alertOB and CCI < alertOB
                                        > > > then alertOB
                                        > > > else Double.NaN;
                                        > > > goShort.SetPaintingStrategy( PaintingStrategy.ARROW_DOWN );
                                        > > >
                                        > > > goShort.SetDefaultColor( Color.DOWNTICK );
                                        > > >
                                        > > > goShort.HideBubble();
                                        > > >
                                        > > > goShort.HideTitle();
                                        > > >
                                        > > > alert( goLong, concat( "CCI signals a BUY: ", concat( CCI[1], concat( "
                                        > ->
                                        > > > ", CCI ))), Alert.ONCE, Sound.Ding );
                                        > > >
                                        > > > alert( goShort, concat( "CCI signals a SELL: ", concat( CCI[1], concat(
                                        > "
                                        > > ->
                                        > > > ", CCI ))), Alert.ONCE, Sound.Bell );
                                        > > >
                                        > > >
                                        > > >
                                        > > >
                                        > > >
                                        > > >
                                        > > >
                                        > > > From: TOS_thinkscript@yahoogroups.com
                                        > <mailto:TOS_thinkscript%40yahoogroups.com>
                                        > > <mailto:TOS_thinkscript%40yahoogroups.com>
                                        > > > [mailto:TOS_thinkscript@yahoogroups.com
                                        > <mailto:TOS_thinkscript%40yahoogroups.com>
                                        > > <mailto:TOS_thinkscript%40yahoogroups.com> ] On Behalf Of garuba_r
                                        > > > Sent: Friday, June 17, 2011 10:29 AM
                                        > > > To: TOS_thinkscript@yahoogroups.com
                                        > <mailto:TOS_thinkscript%40yahoogroups.com>
                                        > > <mailto:TOS_thinkscript%40yahoogroups.com>
                                        > > > Subject: [TOS_thinkscript] Re: CCI Alert
                                        > > >
                                        > > >
                                        > > >
                                        > > >
                                        > > >
                                        > > > Richard,
                                        > > >
                                        > > > Thanks For this... I made the following change so I can get alarms when
                                        > > CCI
                                        > > > crosses back into the -100 to 100 range but now I get no alarms..
                                        > ideas??
                                        > > >
                                        > > > declare lower;
                                        > > >
                                        > > > input length = 14;
                                        > > > input alertOS = 100;
                                        > > > input alertOB = -100;
                                        > > > input over_sold = 100;
                                        > > > input over_bought = -100;
                                        > > >
                                        > > > --- In TOS_thinkscript@yahoogroups.com
                                        > <mailto:TOS_thinkscript%40yahoogroups.com>
                                        > > <mailto:TOS_thinkscript%40yahoogroups.com>
                                        > > > <mailto:TOS_thinkscript%40yahoogroups.com> , "Richard Houser" <rhouser@>
                                        > > > wrote:
                                        > > > >
                                        > > > > Try this. It's a little more involved than you requested, but I think
                                        > > > you'll
                                        > > > > find it more effective to use, if not strip out what you don't want.
                                        > > > >
                                        > > > > declare lower;
                                        > > > >
                                        > > > > input length = 14;
                                        > > > > input alertOS = -100;
                                        > > > > input alertOB = 100;
                                        > > > > input over_sold = -100;
                                        > > > > input over_bought = 100;
                                        > > > >
                                        > > > > def price = close + low + high;
                                        > > > > def linDev = lindev(price, length);
                                        > > > >
                                        > > > > plot CCI = if linDev == 0 then 0 else (price - Average(price, length))
                                        > /
                                        > > > > linDev / 0.015;
                                        > > > > CCI.setDefaultColor(GetColor(9));
                                        > > > >
                                        > > > > plot OverBought = over_bought;
                                        > > > > OverBought.SetDefaultColor(GetColor(5));
                                        > > > > OverBought.HideBubble();
                                        > > > > OverBought.HideTitle();
                                        > > > >
                                        > > > > plot ZeroLine = 0;
                                        > > > > ZeroLine.SetDefaultColor(GetColor(5));
                                        > > > > ZeroLine.HideBubble();
                                        > > > > ZeroLine.HideTitle();
                                        > > > >
                                        > > > > plot OverSold = over_sold;
                                        > > > > OverSold.setDefaultColor(GetColor(5));
                                        > > > > OverSold.HideBubble();
                                        > > > > OverSold.HideTitle();
                                        > > > >
                                        > > > > plot aOB = if CCI[1] < alertOB and CCI > alertOB then alertOB else
                                        > > > > Double.NaN;
                                        > > > > aOB.SetPaintingStrategy( PaintingStrategy.ARROW_UP );
                                        > > > > aOB.SetDefaultColor( Color.UPTICK );
                                        > > > > aOB.HideBubble();
                                        > > > > aOB.HideTitle();
                                        > > > >
                                        > > > > plot aOS = if CCI[1] > alertOS and CCI < alertOS then alertOS else
                                        > > > > Double.NaN;
                                        > > > > aOS.SetPaintingStrategy( PaintingStrategy.ARROW_DOWN );
                                        > > > > aOS.SetDefaultColor( Color.DOWNTICK );
                                        > > > > aOS.HideBubble();
                                        > > > > aOS.HideTitle();
                                        > > > >
                                        > > > > alert( aOB, concat( "CCI is OverBought: ", CCI ), Alert.ONCE,
                                        > Sound.Ding
                                        > > > );
                                        > > > > alert( aOS, concat( "CCI is OverSold: ", CCI ), Alert.ONCE, Sound.Bell
                                        > > );
                                        > > > >
                                        > > > >
                                        > > > >
                                        > > > >
                                        > > > >
                                        > > > > From: TOS_thinkscript@yahoogroups.com
                                        > <mailto:TOS_thinkscript%40yahoogroups.com>
                                        > > <mailto:TOS_thinkscript%40yahoogroups.com>
                                        > > > <mailto:TOS_thinkscript%40yahoogroups.com>
                                        > > > > [mailto:TOS_thinkscript@yahoogroups.com
                                        > <mailto:TOS_thinkscript%40yahoogroups.com>
                                        > > <mailto:TOS_thinkscript%40yahoogroups.com>
                                        > > > <mailto:TOS_thinkscript%40yahoogroups.com> ] On Behalf Of Nathan Crude
                                        > > > > Sent: Tuesday, May 03, 2011 7:39 AM
                                        > > > > To: TOS_thinkscript@yahoogroups.com
                                        > <mailto:TOS_thinkscript%40yahoogroups.com>
                                        > > <mailto:TOS_thinkscript%40yahoogroups.com>
                                        > > > <mailto:TOS_thinkscript%40yahoogroups.com>
                                        > > > > Subject: [TOS_thinkscript] CCI Alert
                                        > > > >
                                        > > > >
                                        > > > >
                                        > > > >
                                        > > > >
                                        > > > > Hi,
                                        > > > >
                                        > > > > I have the below code for CCI. What do I add to it to be able to set
                                        > an
                                        > > > > alert for a given level of CCI...
                                        > > > >
                                        > > > > For example, the below code sets levels at -100 and +100, this is
                                        > fine,
                                        > > > but
                                        > > > > what if I want an audio alert on touching a given number outside of
                                        > that
                                        > > > > range, ie -150 or -180, what code would I add to add an alarm for a
                                        > > given
                                        > > > > level (able to change the alarm level in preferences though) ?
                                        > > > >
                                        > > > > So its like adding a second line really, with an audio alert on its
                                        > > hit...
                                        > > > >
                                        > > > > I tried adding
                                        > > > >
                                        > > > > alert( over_bought or over_sold, Alert.ONCE, Sound.DING );
                                        > > > >
                                        > > > > But it says "incompatible parameter".
                                        > > > >
                                        > > > > declare lower;
                                        > > > >
                                        > > > > input length = 14;
                                        > > > > input over_sold = -100;
                                        > > > > input over_bought = 100;
                                        > > > >
                                        > > > > def price = close + low + high;
                                        > > > > def linDev = lindev(price, length);
                                        > > > > plot CCI = if linDev == 0 then 0 else (price - Average(price, length))
                                        > /
                                        > > > > linDev / 0.015;
                                        > > > > plot OverBought = over_bought;
                                        > > > > plot ZeroLine = 0;
                                        > > > > plot OverSold = over_sold;
                                        > > > >
                                        > > > > CCI.setDefaultColor(GetColor(9));
                                        > > > > OverBought.setDefaultColor(GetColor(5));
                                        > > > > ZeroLine.setDefaultColor(GetColor(5));
                                        > > > > OverSold.setDefaultColor(GetColor(5));
                                        > > > >
                                        > > >
                                        > >
                                        >

                                      • balancesolution
                                        Hi Folks I m trying my hand at another alert. I would like to create an alert that signals as the CCI 11 crosses up and over the 100 line. I just can not
                                        Message 19 of 28 , Jun 30, 2011
                                        View Source
                                        • 0 Attachment
                                          Hi Folks I'm trying my hand at another alert.

                                          I would like to create an alert that signals as the CCI 11 crosses up and over the 100 line.

                                          I just can not figure out the format for defining the CCI.

                                          Any direction is appreciated -
                                          ~thanks - Mike
                                        • Richard Houser
                                          Here s the most efficient way, it found 2118 stocks: cci(11).cci crosses above 100 Here s the another way, oddly it also found 2118 stocks ;-): def myCCI =
                                          Message 20 of 28 , Jun 30, 2011
                                          View Source
                                          • 0 Attachment

                                            Here's the most efficient way, it found 2118 stocks:

                                            cci(11).cci crosses above 100

                                            Here's the another way, oddly it also found 2118 stocks ;-):

                                            def myCCI = cci(11).cci;
                                            plot cciScan = myCCI [1] < 100 and myCCI > 100;

                                             

                                            From: TOS_thinkscript@yahoogroups.com [mailto:TOS_thinkscript@yahoogroups.com] On Behalf Of balancesolution
                                            Sent: Thursday, June 30, 2011 2:58 PM
                                            To: TOS_thinkscript@yahoogroups.com
                                            Subject: [TOS_thinkscript] CCI Alert

                                             

                                             

                                            Hi Folks I'm trying my hand at another alert.

                                            I would like to create an alert that signals as the CCI 11 crosses up and over the 100 line.

                                            I just can not figure out the format for defining the CCI.

                                            Any direction is appreciated -
                                            ~thanks - Mike

                                          • Mike ILO
                                            Richard - You are the man! Realy I owe you - and I ll follow through on that! Thanks - and have a great weekend ~Mike
                                            Message 21 of 28 , Jul 1, 2011
                                            View Source
                                            • 0 Attachment
                                              Richard - You are the man!
                                               
                                              Realy I owe you - and I'll follow through on that!
                                               
                                              Thanks - and have a great weekend
                                              ~Mike

                                              On Fri, Jul 1, 2011 at 1:30 AM, Richard Houser <rhouser@...> wrote:
                                               

                                              Here's the most efficient way, it found 2118 stocks:

                                              cci(11).cci crosses above 100

                                              Here's the another way, oddly it also found 2118 stocks ;-):

                                              def myCCI = cci(11).cci;
                                              plot cciScan = myCCI [1] < 100 and myCCI > 100;

                                               

                                              From: TOS_thinkscript@yahoogroups.com [mailto:TOS_thinkscript@yahoogroups.com] On Behalf Of balancesolution
                                              Sent: Thursday, June 30, 2011 2:58 PM
                                              To: TOS_thinkscript@yahoogroups.com
                                              Subject: [TOS_thinkscript] CCI Alert

                                               

                                               

                                              Hi Folks I'm trying my hand at another alert.

                                              I would like to create an alert that signals as the CCI 11 crosses up and over the 100 line.

                                              I just can not figure out the format for defining the CCI.

                                              Any direction is appreciated -
                                              ~thanks - Mike


                                            Your message has been successfully submitted and would be delivered to recipients shortly.