Announcement

Collapse
No announcement yet.

Question about how eSignal processes..

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

  • Question about how eSignal processes..

    Here's part of my code:

    PHP Code:

    debugPrint
    "1 PrevDynamic_S:      " + ( Dynamic_S ) + "\n" );

    PrevDynamic_R Dynamic_R ;
    PrevDynamic_S Dynamic_S ;


    debugPrint"2 PrevDynamic_S:      " + ( Dynamic_S ) + "\n" );


    var 
    xHH highestiPeriods high() ) ;  // dynamic Resistance
    var xLL lowestiPeriods low() ) ;  // dynamic Suport

    Dynamic_R =   formatPriceNumber(xHH)*;  // dynamic Resistance 
    Dynamic_S =   formatPriceNumber(xLL)*1  // dynamic Suport


       
    if ( Dynamic_R != high(0) && Dynamic_R PrevDynamic_R ) {
         if ( 
    PrevDynamic_R != ) {
            
    Dynamic_R PrevDynamic_R;
             }
    }
        

    if ( 
    Dynamic_S != low(0) && Dynamic_S PrevDynamic_S ) {        
        if ( 
    PrevDynamic_S != ) {
            
    Dynamic_S PrevDynamic_S;
            }
    }


    debugPrint"PrevDynamic_S:      " + ( Dynamic_S ) + "\n" ); 

    The way I am used to things, the value of PrevDynamic_S from the last debug statement should equal the value of the first debug statement on the next bar BUT IT DOESN'T!

    Can someone please explain what's going on or where my "mistake" is?

    Thanks:


    See below:
    Attached Files
    Last edited by buzzhorton; 07-29-2006, 06:53 PM.

  • #2
    Here are some useful links:

    from Knowledge Base
    http://kb.esignalcentral.com/display...d=1051&n=2&s=1

    I believe JasonK explains what you need , maybe more
    covers if you are using setComputeOnClose()
    http://forum.esignalcentral.com/show...ghlight=newbar


    Alexis has good code sample here
    http://forum.esignalcentral.com/show...ghlight=newbar

    special attention to:
    if(getBarState() == BARSTATE_NEWBAR){
    if(vMA1.getValue(MAStudy.MA,-1) > vMA2.getValue(MAStudy.MA,-1)){

    NOTE ( -1) , specifies which bar value is being used in the comparison

    =====

    My thoughts FWIW, looking at your code:

    In main() , your variables will change every TICK( I believe this is true for Daily bars also).
    if(getBarState()==BARSTATE_NEWBAR){
    ' PARTS of your code '
    }
    --
    Dynamic_S = formatPriceNumber(xLL)*1
    Normally I calculate a value, then if it meets my criteria I save it to my REAL(different) variable to use/save( in the conditional IF)
    --

    the IF conditions for Dynamic_S & R are ABSOLUTE High/Low values - ignoring the iPeriods value

    Dynamic_S can ONLY get larger , is this really what you are wanting, not the iPeriod LOW
    Dynamic_R can only get smaller, not iPeriod HIGH

    NOT sure of your logic here. Current value = previous value ?
    --

    hope this helps, Keep up your work , I like your studies.

    Comment


    • #3
      Thanks David.

      The script is working as intended so I am not sure of your questions.

      Comment


      • #4
        Re: Question about how eSignal processes..

        Hello Avery,

        All of your debug statements are printing the value of Dynamic_S. You're not printing the value of PrevDynamic_S. Therefore, when a new low occurs, your last debug statement will print the new value, which will be different than the first debug statement. If Dynamic_S is a global variable, then it is retaining the last value of the lowest() study from the previous bar. Does this help?


        Originally posted by buzzhorton
        Here's part of my code:

        PHP Code:

        debugPrint
        "1 PrevDynamic_S:      " + ( Dynamic_S ) + "\n" );

        PrevDynamic_R Dynamic_R ;
        PrevDynamic_S Dynamic_S ;


        debugPrint"2 PrevDynamic_S:      " + ( Dynamic_S ) + "\n" );


        var 
        xHH highestiPeriods high() ) ;  // dynamic Resistance
        var xLL lowestiPeriods low() ) ;  // dynamic Suport

        Dynamic_R =   formatPriceNumber(xHH)*;  // dynamic Resistance 
        Dynamic_S =   formatPriceNumber(xLL)*1  // dynamic Suport


           
        if ( Dynamic_R != high(0) && Dynamic_R PrevDynamic_R ) {
             if ( 
        PrevDynamic_R != ) {
                
        Dynamic_R PrevDynamic_R;
                 }
        }
            

        if ( 
        Dynamic_S != low(0) && Dynamic_S PrevDynamic_S ) {        
            if ( 
        PrevDynamic_S != ) {
                
        Dynamic_S PrevDynamic_S;
                }
        }


        debugPrint"PrevDynamic_S:      " + ( Dynamic_S ) + "\n" ); 

        The way I am used to things, the value of PrevDynamic_S from the last debug statement should equal the value of the first debug statement on the next bar BUT IT DOESN'T!

        Can someone please explain what's going on or where my "mistake" is?

        Thanks:


        See below:
        Jason K.
        Project Manager
        eSignal - an Interactive Data company

        EFS KnowledgeBase
        JavaScript for EFS Video Series
        EFS Beginner Tutorial Series
        EFS Glossary
        Custom EFS Development Policy

        New User Orientation

        Comment


        • #5
          Yes, thanks, that makes it a little clearer.

          Comment

          Working...
          X