Announcement

Collapse
No announcement yet.

EFS Behavior Deifferent in Bar Replay Mode

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

  • EFS Behavior Deifferent in Bar Replay Mode

    I have a main EFS but I have 2 versions of it -- one for LIVE trading and one for NON-LIVE trading (Bar Replay Mode). The only difference is really the trigger conditions. In live trading close(0) is a tick value wheras in non-live trading (backtesting) close(0) is the close of the bar, which for a big bar can be a big difference in triggger points. I Bar Relay mode I rig the trigger conditions to try to simulate live trading as closely as possible, but exact match is impossible.

    In implementating your suggestions of saving the data inputs for all live signals, I have added code in my EFS to do this. Of course, to keep the 2 EFS as closesly identical as possible, I also include this code for the non-live version of the EFS, which is really not needed, since in non-live trading I do not have live signals.

    But I figure it would be harmless to do that, and it was better for me to main as identical a file as possible between the two verisons.

    But when I added this code to the non-live version, my non-live version was not working and was totally screwed up. It took me hours to figure out what was wrong. I noticed that nothing was being written to the History file (that kept the data inputs for signals) -- it was always 0 bytes. Ans then all code from this point on just did not work properly.

    Below is a portion of my code:
    PHP Code:
    // ACCELERATED BUY
        
    if (  !bNowLongAcc && vBUYAccelerationLine != null && vLow <= vBUYAccelerationLine && vHigh >= vBUYAccelerationLine   ) {    // use for NONLIVE trading
    //    if (  !bNowLongAcc && (vBUYAccelerationLine != null) && (vClose > vMainMA) && (vClose < vBUYAccelerationLine)    ) {    // use for LIVE trading
                  
    if(!bIsTRLongAcc) {
                
    bIsTRLongAcc true;
                
    bIsTRShortAcc false;
                if (!
    bLIVE) {            
                    
    vAccEntry vBUYAccelerationLine;        // use for NONLIVE trading!!
                
    }
                if (
    bLIVE) {            
                    
    vAccEntry vClose;        // use for LIVE trading!!
                
    }
                
    vTRADECounter vTRADECounter 1;
                
    vPrevBuyLevel vLiveBuyLevel;
                
    vLastSF vTRADECounter;
                
    drawImageRelative(0vAccEntry"SystemExclamationBlue"nullImage.RIGHT Image.ONTOP"SF" vTRADECounter);
                if (
    bSAVEIT) {
                    var 
    = new File(vHistoryFile ".txt");  //the file will be created in:  eSignal/FormulaOutput/
                        
    a.open("at+"); // Opens and overwrites the file
                    
    if(!a.isOpen()) {
    //                        debugPrintln("Could not open file!");
                    

                    else {
    //                    a.writeln(rawtime(0) + "|" + "SystemExclamationBlue" + "|" + vAccEntry.getValue(0));
                        
    a.writeln(rawtime(0) + "|" "SystemExclamationBlue" "|" vAccEntry);
                    }
                    
    a.close();
                }
                
    Alert.playSound(vSFACCBuy);
    etc,. etc. ..... 
    Notice the line which is remarked out:

    //a.writeln(rawtime(0) + "|" + "SystemExclamationBlue" + "|" + vAccEntry.getValue(0));

    This was the problem. To get my non-live trading EFS to work properly I had to use this instead

    a.writeln(rawtime(0) + "|" + "SystemExclamationBlue" + "|" + vAccEntry);

    The ".getValue(0)" was messing this up in non-live, that is, Bar Replay Mode. Yet in live trading, it is needed.

    Do you understand why this is the case?
    Last edited by alexmihh; 03-08-2006, 08:42 PM.

  • #2
    Hello Alex,

    I believe the answer lies in whether or not vAccEntry is a series or just a value.

    PHP Code:
    //
                
    if (!bLIVE) {            
                    
    vAccEntry vBUYAccelerationLine;        // use for NONLIVE trading!!
                
    }
                if (
    bLIVE) {            
                    
    vAccEntry vClose;        // use for LIVE trading!!
                

    In order for vAccEntry.getValue(0) to work, vAccEntry must be a Series Object. You can verify this with debugPrintln(vAccEntry). If it is a series you will see "[Object Series]" in the output window. Your vBUYAccelerationLine variable is probably storing just a value and not a series object.
    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


    • #3
      I am not sure I follow your reply. The SAME EFS is used but if the LIVE flag is set, thenvAccEntry is a live tick close(0) value just past a certain price level. if I am not using the EFS in life trading, (that is, SetComputeonClose is set to true) then vAccEntry is also a value which **is** the certain price level mentioned above. In both caes the "certain price level" is the same thing.

      The only thing that is different then is vClose (which is nothing other than close(0)) vs. a predetermined price value.

      Will close(0) return something different in property than a predetermined price value? Isn''t close(0) just a price level at an **instant in time,** whereas a horizontal line on a price chart is a price level in **all ticks** of time.

      What you must be saying is that the peoperties of these two "things" are different. Is that correct?

      Comment


      • #4
        Hello Alex,

        Originally posted by alexmihh
        I am not sure I follow your reply. The SAME EFS is used but if the LIVE flag is set, thenvAccEntry is a live tick close(0) value just past a certain price level. if I am not using the EFS in life trading, (that is, SetComputeonClose is set to true) then vAccEntry is also a value which **is** the certain price level mentioned above. In both caes the "certain price level" is the same thing.

        The only thing that is different then is vClose (which is nothing other than close(0)) vs. a predetermined price value.

        Will close(0) return something different in property than a predetermined price value? Isn''t close(0) just a price level at an **instant in time,** whereas a horizontal line on a price chart is a price level in **all ticks** of time.

        What you must be saying is that the peoperties of these two "things" are different. Is that correct?
        Because you did not post the entire formula, I could not tell what assignment vBUYAccelerationLine was receiving. You mentioned that your writeln() statement was working in live mode but not non-live mode so I had to assume that in non-live mode vAccEntry was not being assigned to a Series object. The vAccEntry.getValue(0) would only work if vAccEntry was in the form of a Series object.

        If vClose was being assigned to close(), then vAccEntry.getValue(0) would work because vClose would be a Series object of close(). If you were to assign vClose to close(0) (with a bar index reference of 0) then it would not work because vClose would have been storing a value and not a Series.

        The only way for me to pin point the exact reason why your writeln() call was not working in non-live mode would be to see your complete formula code.
        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

        Working...
        X