Announcement

Collapse
No announcement yet.

efs super slow...was crashing eSignal

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

  • efs super slow...was crashing eSignal

    It was taking 10mins for my charts to load on startup, so I reduced Page to one chart with one efs. Still 10mins. So I removed eSignal and did a fresh install. Still 10mins.

    Then I did a syntax check on the efs. Crash. Sent in Crash Report. No reply yet. Looking at the code I wondered if my changing my newFunction titles had any effect (this thought because I noted that in Edit Studies my default settings were not showing any values).

    So I changed:
    var vTrailStop = new FunctionParameter ("TrailStop", .....);
    back to:
    var vTrailStop = new FunctionParameter ("vTrailStop", .....);
    Passed syntax check and no longer crashed eSignal when I removed and reloaded efs to chart.

    Still 10mins to load on startup however. Removed the efs, set interval to 5min with User Defined time template of 2 days. Chart loaded instantly.

    Changed interval to 90t with time template User Defined T 2 days. Chart loaded with data in 10 seconds.

    Added efs to chart; chart load 10mins on startup of eSignal.

    The efs is not all all complicated and only 400 lines of code. I run 2000 lines of code from other efs studies without any delay at all.
    I am running XP w 1.7ghz processor and 384megs RAM. While I realize from running Diagnostics that 512megs is preferred, I am only running one chart with one efs study....and other efs files are not delayed. Plus, a week ago, my efs was not delayed.

    My efs has no external efs calls or anything remotely like that. It has 9 user defined settings in funciton main(...) and only checks for long/short conditions, sets some flags, colors some bars, prints some text and that is it. Could not be more simple in my opinion. Obviously I have made a coding error which does not show up in syntax check. It should not take 10mins to load the chart initially. Also I note that when I revise the efs and reload it to the chart, there is only a delay of 15secs.

    Ideas?

    Thanks in advance.

  • #2
    ratherBgolfing
    Without seeing the script or having more details it is not possible to determine what could be causing this delay.
    If you can't do either then you may want to review the process outlined by Jason in this post
    Alex

    Comment


    • #3
      more detail....

      when I call up an old Page, it loads instantly with 5 charts using 2 efs studies (one of which has 2000 lines of code)....so it is not my processor speed, RAM, etc.

      When I switch back to my Page running the one chart and one efs, eSignal crashes.

      ......

      Thanks Alexis. I will try commenting out code until I find the error.

      Comment


      • #4
        problem was generic broker functions

        The problem turned out to be the generic broker functions I am using. On long/short conditions I am using the following functions to make trades in the eSignal Paper Broker:

        where vTicker = getSymbol() and vLotsIn = 3 on an AB H6 futures chart:

        sellShortMarket (vTicker, vLotsIn);
        buyMarket (vTicker, vLotsIn);
        cancelOrder (vTicker);
        closePosition (vTicker);

        They do not work and delay the chart loading as mentioned. Although they make some trades I have not been able to get the trades in the papertrader to match the trades which I print on the screen and are correct.

        Is there a sample efs that specifically deals with using the generic broker functions to make trades in the eSignal Paper Broker?

        Comment


        • #5
          Possible Solution..

          Golfing (and I would RATHER be too),

          More than likely this has to do with the way your EFS is scripted and the amount of data in your charts..

          If you coded the EFS properly - it should only be firing these live (paper trader) orders when..

          if (getCurrentBarIndex() == 0)

          This will prevent it from firing orders on older historical data.

          The other thing is you might choose to create a 3~5 day time template. This will prevent your efs from running on a huge amount of historical data that is not really needed.

          When I create a script for someone (for RT trading actions), I typically instruct the user to include 1 or 2 extra days of data than what is needed to calculate all of their indicators. In other words, keep your time template short enough to calc all of your indicators and include a few extra bars (1~2 days worth).

          This may help - but as Alex stated, without seeing the EFS - it's just a guess.

          B
          Brad Matheny
          eSignal Solution Provider since 2000

          Comment


          • #6
            Thanks Brad.

            I am entering new positions based on the first tick in each new bar using:

            if ( nState == BARSTATE_NEWBAR )

            Then I exit any time during any bar if I breach a trailing stop limit or reach a profit target, similar to your coding in the efs guides that you wrote.

            (Thanks for those by the way. They have been very helpful. In fact I would really like to read the one you referred to in the Graphics guide but I could not find it ["This code has been developed for use on "Historical data" and would need to be modified to develop a real-time trading system. We'll get into that in the next guide - the "Guide to Developing Real-Time Trading Strategies in eSignal". There are subtle changes that need to be made to the code in order for it to operate properly in a tick-by-tick environment."] Could you please tell me where it is?

            I will add the "if (getCurrentBarIndex() == 0)"
            statement for all my orders and see what that does.

            I am using 2 day tick templates already, 3 day when I need an extra day, like on the weekend. So, my data is limited. I am certain that the 6 minutes it takes to initially load the one chart is due to my code looking to execute the generic functions and not being able to.

            Will advise on new results. Thanks again.

            Comment


            • #7
              Ok Brad.

              That fixed the loading on startup delay. It used to be 6 minutes to load a 2 day tick.

              I put "if ( nState == BARSTATE_NEWBAR )" in front of every Buy, Sell and ClosePosition statement and it loads the one chart 2 day tick in 15 seconds and the 3 day tick in 30 seconds, from startup.

              Thanks. Big improvement.

              Now, when I "Attach Order Ticket" and run Bar Replay or Tick Replay, it freezes eSignal (i.e. "not responding")

              I assume there is not a special format to direct trades to the Paper Broker? i.e. the Generic Broker functions default to the Paper Broker if you do not specify routing?

              Any ideas why Bar Replay will not run? The code runs perfectly on my chart with the generic broker functions commented out...i.e. the chart prints every trade entry and exit perfectly. So I was wondering if my format is correct for accessing the Paper Broker.

              Comment


              • #8
                While I was typing my last post, Bar Replay started working...after approx 5 min delay.

                Tested it again and it seems to be functioning properly, without delay....although it is erasing some of my prints.....

                It appears I need to add some more order statements to get the proper outstanding orders and position.

                Comment


                • #9
                  Tick Replay working now also....

                  Thanks Brad, only change I needed to make was adding the if(getCurrentBarIndex == 0) statement in front of all the generic broker functions (my typo in earlier post saying I added the NEWBAR function...).

                  Comment


                  • #10
                    Super..

                    Let me know if you need any additional help..

                    B
                    Brad Matheny
                    eSignal Solution Provider since 2000

                    Comment

                    Working...
                    X