Announcement

Collapse
No announcement yet.

String Parsing Question

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

  • String Parsing Question

    var symbol=getSymbol();

    might return

    "NQ Z2=2"

    How can I get "NQ Z2=2" to turn into "NQ" ?

  • #2
    Try symbol.substring(0,2). This will return the first two chars of the symbol string.

    Comment


    • #3
      Hi David,

      If your chart is NQ2=2, do you really want to use just NQ for your study?

      In any case, Java Script does have all KINDS of string manipulation look HERE for some of them.

      You could use slice() if you know that the symbol stays a fixed format (or even scan for a pattern, and then let that determine the paramters to slice().

      You could also use split().

      For that matterm you could great a loop from zero to string.length
      and copy from the ParseString[i] to the TargetString[i] up to the point you see your separator.

      Just a few ideas...
      Garth

      Comment


      • #4
        Re: Reply to post 'String Parsing Question'

        >>If your chart is NQ2=2, do you really want to use just NQ for your study?

        NQ is needed for the order entry strings I am developing.

        ----- Original Message -----
        From: "eSignal Bulletin Board Mailer" <[email protected]>
        To: <[email protected]>
        Sent: Monday, November 18, 2002 2:27 PM
        Subject: Reply to post 'String Parsing Question'


        > Hello dloomis,
        >
        > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        >

        Comment


        • #5
          Re: Reply to post 'String Parsing Question'

          tyvm

          function main()
          {
          var symbol=getSymbol();
          var sym=symbol.substring(0,2);
          debugPrintln (sym);
          return;
          }

          worked like a champ


          ----- Original Message -----
          From: "eSignal Bulletin Board Mailer" <[email protected]>
          To: <[email protected]>
          Sent: Monday, November 18, 2002 2:21 PM
          Subject: Reply to post 'String Parsing Question'


          > Hello dloomis,
          >
          > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          >

          Comment


          • #6
            NQ is needed for the order entry strings I am developing.
            Cool. If you have a few seconds and are willing to share - what is it you are trying to do with broker order entry (ie: autofire orders, populate an order entry window, intergrate to some 3rd party tool).

            G
            Garth

            Comment


            • #7
              Re: Reply to post 'String Parsing Question'

              right now I have system that generates signals and I am using Dynaorder to
              auto fire the buy and sell orders to IB.

              if I don't pull my hair out first.

              ----- Original Message -----
              From: "eSignal Bulletin Board Mailer" <[email protected]>
              To: <[email protected]>
              Sent: Monday, November 18, 2002 2:49 PM
              Subject: Reply to post 'String Parsing Question'


              > Hello dloomis,
              >
              > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              >

              Comment


              • #8
                dloomis,

                We're about to publish several EFS functions tonight that help to convert eSignal names into one needed by Dynaorder's Order Execution functions.

                So you'll be able to do this:

                var symbolName;
                var symbolType;
                var symbolExpiry;

                symbolName = doGetName(getSymbol()); // will return "ES" for "ES Z2"

                symbolType = doGetType(getSymbol()); // will return "FUT" for "ES Z2" and "STK" for "MSFT"

                symbolExpiry = doGetExpiry(getSymbol()); // wil return "200212" for ES Z2 and "" for MSFT.

                Check our Web for the functions source code tonight.

                DB

                Comment


                • #9
                  DB,

                  Where are your new efs studies posted?
                  Be the diner, not the dinner.

                  Comment


                  • #10
                    They not ready yet.
                    They should be ready by tomorrow (Friday) morning at this page:
                    http://www.dynaorder.com/efs-examples.asp

                    Sorry for the delay,
                    DB

                    Comment


                    • #11
                      OK, the EFS and explanation are here:

                      http://www.dynaorder.com/esExamples/doConvert.asp

                      DB

                      Comment


                      • #12
                        auto trading paper trading

                        gspiker

                        I just uploaded my papertrader efs file. This script requires reloading to work.

                        The purpose is to issue an order, wait for the fill, then issue two stop limit orders.

                        Right now the order fires, fills and then about 30 secs later the stop loss order fires away. Sometimes it doesnt fire at all.

                        Any suggestions welcome.

                        Try not to make fun of my programming skills, I am trying to learn.

                        Comment


                        • #13
                          Hey dloomis,

                          Not sure if I am the perfect person for this since I don't use dynaloader, but I will take a peek at it. I did a search (using the very nice new search ability) in the fileshare for this and couldn't find it. Mind giving me the URL to where you uploaded it?
                          Garth

                          Comment


                          • #14
                            Re: Reply to post 'String Parsing Question'

                            http://share.esignal.com/download.js...der&file=paper
                            test.efs

                            but this will get bent out of shape before it reaches you, so it is in Auto
                            Trading under DynaOrder
                            ----- Original Message -----
                            From: "eSignal Bulletin Board Mailer" <[email protected]>
                            To: <[email protected]>
                            Sent: Friday, November 22, 2002 5:02 PM
                            Subject: Reply to post 'String Parsing Question'


                            > Hello dloomis,
                            >
                            > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                            >

                            Comment


                            • #15
                              Hi,

                              I looked at it, and all looks fine. I read up on the Dynaloader papertrader and also looked at other posted examples, and nothing in your code leapt out at me.

                              Perhaps the good people at Dynaloader could comment.

                              BTW, the Dynaloader stuff look very cool, and failry full featured. Glad I was given an excuse to read up on it.
                              Garth

                              Comment

                              Working...
                              X