hi MM,

the symbol in your active chart can be put in a string using:

activeSymbol = Name();

you can extract the first few characters from this string using StrMid()  (see 
help file).

So:

subActiveSymbol = StrMid(activeSymbol,0,3);

rgds, Ed




  ----- Original Message ----- 
  From: marketmonk777 
  To: [email protected] 
  Sent: Friday, September 05, 2008 5:05 AM
  Subject: [amibroker] Conditionally changing the Foreign Symbol to be plotted.


  Hi,

  I create a number of ATCs for the general market, the Nasdaq, S&P 500,
  and the Russell.

  In my window I have two charts. The top chart is a line plot of my ATC
  that I have selected. The bottom chart is a foreign plot of either
  SP500, RUT, NDX, INDU or whatever I select in the parameters window.

  What I would like to do is have some code to recognize which type of
  ATC I have selected and plot the appropriate market for it in the
  bottom pane.

  For example all of my NDX ATCs start with ~NDX. And all of my SP500
  ATCs start with ~SP5.

  Is there a way I can extract the first 3 or 4 characters of the
  selected symbol and run it through a CASE or IF - THEN branch?

  Regards,

  MM



   

Reply via email to