[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] AmiBroker, ^NDX, and TRIN



PureBytes Links

Trading Reference Links

Hmmm... sometimes i appear to completely miss the point; as if i am living
on the wrong planet. I thought Pastis was an Indicator....

herman.
  -----Original Message-----
  From: dingo [mailto:dingo@xxxxxxxxxxx]
  Sent: Monday, August 02, 2004 12:32 PM
  To: amibroker@xxxxxxxxxxxxxxx
  Subject: RE: [amibroker] average of top ranked tickers in a given
watchlist


  Pastis:

  "Pastis consists of alcohol, star anise, both black and white pepper
corns,
  cardamom, sage, nutmeg, cloves, cinnamon, licorice and a little sugar.
Each
  distillery has its own secret recipe and variation. When you order pastis
  the waiter (always a waiter in Provence) will, pending on his mood, will
  serve you a generous portion (at least two ounces generally more) along
with
  a beaded carafe of water.

  Pastis becomes milky white and cloudy as you mix it with water (1:5
ratio).
  There is a sharp, sweet smell of aniseed and it is called, rightly I
think,
  the milk of Provence, that felicituous corner of France where vegetables
  taste great, herbs are potent, garlic abundant, and olive oil
indispensable
  in cooking.

  Pastis must never be enjoyed in a hurry. It demands the correct ambience.
  There is a distinct difference between anis and pastis - the latter
  resembles the former but happens to be less distinct in anis and more
potent
  (by law pastis may be distilled out up to 45 ABV*). Both happen to have an
  unmistakable resemblance to absinthe that has been banned in France, and
  many other European countries, but not in Spain or the Czech Republic or
  England. Absinthe contains wormwood, a hallucinogenic that is said to have
  driven many to insanity. For beginners, absinthe contained 68 ABV and
  tujone, the hallucinogen said to have driven van Gogh to insanity and
caused
  Verlaine to shoot Rimbaud. It gave its name to a particular disease -
  absinthism - of which the victim dies. In France absinthe was declared
  illegal in 1915. "



    _____

  From: Stephane Carrasset [mailto:s.carrasset@xxxxxxxxxxx]
  Sent: Sunday, August 01, 2004 2:06 PM
  To: amibroker@xxxxxxxxxxxxxxx
  Subject: Re: [amibroker] average of top ranked tickers in a given
watchlist


  Hermann,
  What a Nice code... respect !!
  of course I'll check it,
  But right Now time to  Pastis and others pleasures.

  Stephane
    ----- Original Message -----
    From: Herman van den Bergen
    To: amibroker@xxxxxxxxxxxxxxx
    Sent: Sunday, August 01, 2004 1:29 PM
    Subject: RE: [amibroker] average of top ranked tickers in a given
  watchlist


    Hello Stephane,

    I think your code needs to sort the tickers according to Rank...Here is
a
  snip of my code, since it is a cut/adjusted to your needs pleae verify the
  result. Since the results are on the screen that should be easy. Note that
  as-is the text displays the top stocks at the cursor position!

    herman

  --------------------------------------------------------------------------
--
  --

    function GetScore( )
     {
     return CCIa(C,14); // Substitute your function
     }

    function padString( InString, Length )
     {
     SpaceFill = "          ";
     SL = StrLen(InString);
     NS=StrLeft(SpaceFill, Length-SL);
     return NS+Instring;
     }

    procedure getPositionScores( WatchList, BarNum, NumTickers )
     {
     TickerList= GetCategorySymbols( categoryWatchlist, WatchList);
     CurrentTicker = Name();
     TickerScoreList = "";

     // Create Scores array
     for( n=0; (Ticker=StrExtract( TickerList, n)) != ""; n++)
      {
      SetForeign(Ticker);
      TickerScores[n] = LastValue(ValueWhen(BarIndex() == BarNum,
  SelectedValue(GetScore())));
      TickerIndex[n] = n;
      }

     TickerCount= n;

     // Sort Tickers by rank
     for(i = n; i>=0; i--)
      {
      for (j = 1; j <= i; j++)
       {
       if (TickerScores[j-1] > TickerScores[j])
        {
        temp = TickerScores[j-1]; TickerScores[j-1] = TickerScores[j];
  TickerScores[j] = temp;
        temp = TickerIndex[j-1]; TickerIndex[j-1] = TickerIndex[j];
  TickerIndex[j] = temp;
        }
       }
      }

     TopTickerList  = TopTickerNum = TopTickerScore = "";
     i=0; P=10; TopComposite = 0;
     if( NumTickers > TickerCount ) NumTickers = TickerCount;

     // Format Top numTickers and create composite
     for(n=TickerCount; n>=TickerCount-NumTickers; n--)
      {
      T5[i++] = TickerIndex[n];
      TopTickerList = TopTickerList +
  PadString(StrExtract(Tickerlist,T5[i-1]),P)+",";
      TopTickerScore = TopTickerScore +
  PadString(NumToStr(TickerScores[n],1.3),P)+",";
      TopTickerNum = TopTickerNum +
  PadString(NumToStr(TickerIndex[n],1.0),P)+",";
      TopComposite = TopComposite + getScore();
      }

     VarSet("TopComposite",TopComposite/numtickers);
     StaticVarSetText("TopTickerList",TopTickerList);
     StaticVarSetText("TopTickerScore ",TopTickerScore );
     StaticVarSetText("TopTickerNum ",TopTickerNum );
     }

    WatchList = Param("WatchList",0,0,1,1);
    BarNum = SelectedValue(BarIndex());
    NthScore = Param("Nth TickerDown",5,0,100,1);
    getPositionScores( WatchList, BarNum, NthScore );
    TopTickerScore =StaticVarGet("TopTickerScore ");
    TopTickerList=StaticVarGet("TopTickerList");
    TopTickerNum =StaticVarGet("TopTickerNum ");
    Plot(VarGet("TopComposite") ,"",4,1);

    Title =
    TopTickerList + "\n"+
    TopTickerScore + "\n"+
    TopTickerNum + "\n"+
    "Number "+NumToStr(NthScore+1,1.0)+" from the Top:
  "+StrExtract(TopTickerList ,NthScore);

  --------------------------------------------------------------------------
--
  --


      -----Original Message-----
      From: Stephane Carrasset [mailto:s.carrasset@xxxxxxxxxxx]
      Sent: Sunday, August 01, 2004 5:33 AM
      To: amibroker@xxxxxxxxxxxxxxx
      Subject: [amibroker] average of top ranked tickers in a given
watchlist





      Hello,

      I would like to know if the code below is correct .

      the purpose is to create the average of top ranked tickers in a given
  watchlist

      Stephane





      listNum=0 ;//enter watchlist number

      list = GetCategorySymbols( categoryWatchlist, listnum );

      Rank=0;

      MyInd=CCIa(C,14);

      for( i = 0; ( sym = StrExtract( list, i ) ) != ""; i++ )

      {

      Rank = Rank + IIf(MyInd<=CCIa(Foreign( sym, "C", False ) , 14),1,0);

      VarSet("Ranked"+i,Rank);

      }

      average=0;

      Top=5;

      for( j = 0; ( sym = StrExtract( list, j ) ) != ""; j++ )

      {

      average=IIf(VarGet("Ranked"+j)< Top ,CCIa(Foreign( sym, "C", False ) ,
  14),0) + average;

      }

      Plot(average,"",6,1);

      GraphXSpace=10;



      Check AmiBroker web page at:
      http://www.amibroker.com/

      Check group FAQ at:
  http://groups.yahoo.com/group/amibroker/files/groupfaq.html




      Check AmiBroker web page at:
      http://www.amibroker.com/

      Check group FAQ at:
  http://groups.yahoo.com/group/amibroker/files/groupfaq.html


            Yahoo! Groups Sponsor
                  ADVERTISEMENT





  --------------------------------------------------------------------------
--
      Yahoo! Groups Links

        a.. To visit your group on the web, go to:
        http://groups.yahoo.com/group/amibroker/

        b.. To unsubscribe from this group, send an email to:
        amibroker-unsubscribe@xxxxxxxxxxxxxxx

        c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of
  Service.



      __________ NOD32 1.829 (20040801) Information __________

      This message was checked by NOD32 antivirus system.
      http://www.nod32.com


  [Non-text portions of this message have been removed]



  Check AmiBroker web page at:
  http://www.amibroker.com/

  Check group FAQ at:
  http://groups.yahoo.com/group/amibroker/files/groupfaq.html



  Yahoo! Groups Sponsor

  ADVERTISEMENT


<http://us.ard.yahoo.com/SIG=1297mgv52/M=295196.4901138.6071305.3001176/D=gr

oups/S=1705632198:HM/EXP=1091549869/A=2128215/R=0/SIG=10se96mf6/*http://comp
  anion.yahoo.com> click here


<http://us.adserver.yahoo.com/l?M=295196.4901138.6071305.3001176/D=groups/S=
  :HM/A=2128215/rand=804731050>


    _____

  Yahoo! Groups Links


  *      To visit your group on the web, go to:
  http://groups.yahoo.com/group/amibroker/


  *      To unsubscribe from this group, send an email to:
  amibroker-unsubscribe@xxxxxxxxxxxxxxx
  <mailto:amibroker-unsubscribe@xxxxxxxxxxxxxxx?subject=Unsubscribe>


  *      Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
  <http://docs.yahoo.com/info/terms/> .




  [Non-text portions of this message have been removed]



  Check AmiBroker web page at:
  http://www.amibroker.com/

  Check group FAQ at:
http://groups.yahoo.com/group/amibroker/files/groupfaq.html


        Yahoo! Groups Sponsor
              ADVERTISEMENT





----------------------------------------------------------------------------
--
  Yahoo! Groups Links

    a.. To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

    b.. To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

    c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/