Announcement

Collapse
No announcement yet.

Cross Referencing

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

  • Cross Referencing

    Hi

    Id like to create a script that can cross reference other symbols
    i see you can do with bars, Id like to do this with Indicators MA's, CCI, MACD etc

    Any samples would be great

    Thank you in advance

  • #2
    Solution..

    There are two ways to accomplish this..

    Number 1.

    set and use GLOBAL VARIABLES... These work in real-time and can be used to as many indicators as you like. They will not work for back-testing.

    setGlobalValue( "mycounter", vValue );

    vValue = getGlobalValue( "mycounter" );

    Number 2. Record the information into a file, then use the file to reload the indicator information for your use (either in RT or BT mode).

    There is a forum where I created an example of this type of code..

    Review this thread

    Let me know if this helps.
    Brad Matheny
    eSignal Solution Provider since 2000

    Comment


    • #3
      Re: Solution..

      Thanks for you reply doji

      Being a total novice, Ive looked everywhere and cant seem to work out where this goes

      could you please edit the attached sample script so it executes your number one option. I have commented in the script which part i would like to reference another symbol

      Thanks.
      Attached Files

      Comment


      • #4
        potential resolution..

        Bob,

        A couple of words of advice....

        Always try to place "( )" around all of your boolean "if" conditions.. Like...

        if ( (a=b) && (c=d) && (e=f) ) {
        ...
        }

        This better controls the logic of the system. Also, when you build "concatenated IFs" use the same type of logic control...

        if ( (a=b) || ((c=d) && (e=f)) ) {
        ...
        }

        The other thing is the proper way to pull data from another symbol is with "getValue". I have fixed your code so it should work for you. I have not tested it, but this should work and you can use it as an example for pulling other chart data.

        Brad
        Attached Files
        Brad Matheny
        eSignal Solution Provider since 2000

        Comment


        • #5
          Indicator from another symbol

          Hi Doji

          Thanks for that, I used the Wizard to create that chart and did not edit.

          I will do the () in future

          However what i would like to do, is

          on line 32
          Can the MACD actually get the value from another specified symbol, for this example it would be es z3.

          This script would be active on symbol eg ym z3, and line 32 and line 33, would get values from es z3 within the same IF statement.

          In your earlier post you mentioned that the global variables would help to achieve this. SO could you apply that to this script s a example.

          Comment


          • #6
            Code..

            Biz,

            My code should be doing what you want. I corrected the issue with the () and corrected the issue with pulling data from another chart source.

            Your EFS is rather simple. so you don't need to use GLOBAL VARIABLES. Just pull the data from the other chart with "getValue".

            Look at my code, you'll see what I've done.

            B
            Brad Matheny
            eSignal Solution Provider since 2000

            Comment


            • #7
              Brad

              Hi Brad

              AS suggested im using getvalue, could you have a look at this script to see whats wrong, i think it maybe the macd part

              thanks

              bob
              Attached Files

              Comment

              Working...
              X