Announcement

Collapse
No announcement yet.

Formula conversion

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

  • Formula conversion

    I am trying to implement a formula into esignal. I have been able to do it in CQG. Here is the formula (I want to make it a bar chart or a tic chart):

    (((YM*1)+(AB*1)+(MC*1)+(NQ*1))/4)

    I also want to be able to change the multiplier (ie.1 to 1.768, etc)
    I can be contacted via email or at 312-638-3515

  • #2
    jmdalyr
    You don't necessarily need a formula to do that. You can use the Spread Symbol Settings (available under Tools in the main menu) to create the composite symbol.
    Alex



    Comment


    • #3
      charting net change of spread

      Hi Alex,

      I just read your last post on the spread tool. That looks great, I think this may help me greatly. But, Im having one problem, Im trying to chart the 'net change' of a spread. For example, (1.5*msft)-dell based upon there net changes. So if MSFT is up lets say +.20 and dell is +.15, Id like to (plot)chart +.15
      (1.5*.20) = .30 - (.+15--dell).

      The only way Ive been able to come up with a formula would be this: [(1.5 * msft) - (msft prior day close)] - [(dell)-(dell prior day close)]

      So I guess my question is, do you see my only solution is having to manual update the closing price daily into the spread formula for the prior day close on msft & dell?

      Thanks
      stockodds

      Comment


      • #4
        stockodds
        Calculate the net change for each symbol based on the daily values and then perform your math on those.
        See the example below to calculate the net change
        Alex

        PHP Code:
        var netChangeYourSymbol close(0,sym(" yoursymbol,d")) - close(-1,sym("yoursymbol,d")); 

        Comment


        • #5
          LOL... yah, Im a newbee. You kind of lost me there. So do I need to add that script somewhere? Apologies for my ignorance

          Comment


          • #6
            stockodds
            You need an efs that will perform these computations. Following is a basic example

            PHP Code:
            function main(){
                
                var 
            netChangeMSFT close(0,sym("msft,d")) - close(-1,sym("msft,d"));
                var 
            netChangeYourSymbol close(0,sym("yoursymbol,d")) - close(-1,sym("yoursymbol,d"));
                var 
            netChangeSpread = (1.5*netChangeMSFT)-netChangeYourSymbol;

                return 
            netChangeSpread;

            In the script add the desired symbol in place of the yoursymbol parameter using the line above as an example.
            For information on EFS I would suggest going through some of the Help Guides available in the EFS KnowledgeBase.
            If on the other hand you are not interested in learning about EFS and only need some programming done then you may want to read through the FAQ How can I get my custom study built? post in the EFS Studies Forum
            Alex

            Comment


            • #7
              OK, thanks.

              Comment

              Working...
              X