Announcement

Collapse
No announcement yet.

EFS code help please! automated paper trade

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

  • EFS code help please! automated paper trade

    Hi All,

    Brad kindly did some work on my EFS last night and most of the probs were ironed out. Genneraly I'm happy with the strategy at the moment, but it would not go short automatically on the paper trade without the chart or study being refreshed. At the end of the day I hit the 5 min button again on the chart and the short order was triggered.

    Can Brad or someone take a look for me I'm happy with the 1 trade per bar though that B put in. Thanks all for being so helpful.

    ((f < s) ---- does this on line 28 need an = like ((f >= s) on line 22???

    Also could there be a conflict between the chart bar default coloring i.e black line 11 and then red/green lines 38, 40????

    regards
    Spam
    Attached Files

  • #2
    Try This...

    I converted the Strategy.??? logic to variable logic within the code.

    As far as I can see, there is nothing that should be preventing it from going short (at any time when f < s and it is not already SHORT).

    Someone else asked a question a while back (might have been you) about "bleeding data". This is the same solution I suggested for him. It is a matter of creating control variables to control the actions of your system.

    Glad things are working out for you. Your code is rather simple (which is a good thing). And this working through issues will prepare your for larger projects.

    I'm still working out issues for a client with a file that is about 1200 lines of code. Not the biggest I've created, but still large enough to create "handling problems".

    Best of luck.

    Brad
    Attached Files
    Brad Matheny
    eSignal Solution Provider since 2000

    Comment


    • #3
      Cheers Brad, yes I can't wait to start programming Java once my beginners book arrives. 1200 lines oh my word think of all the issues with that, I hope for you and your clients sake its worth it!

      I always thought simple stratagies are the best for trading,
      i'm not a big believer of fancy technical studies.

      I was listening to CNBC the other day and they were saying most trading these days is done by programmed trading not reliant on traders. How much money would someone like Goldman Sachs put into an automated trading program and how big would it be????

      Thanks for all your help
      Spam

      Comment


      • #4
        Hi Brad,

        I'm sure your efs doesn't go through every single line every time its called, but can you tell me if you have experienced any problems with a long program during fast markets?
        For example, if a efs program takes too much time to execute, the next tick might come in before the previous call is finished. I was wondering what would happen in that case: the next call is executed right away (and the unfinished efs not executed), or the next call waits until the previous call is finished (which may delay the whole system including chart updating when using very long programs), or hopefully, the efs is fast enough and no problem would occur. How many 'actually executed' lines do you think it can handle during 1 tick on a Pentium4 2.4MHz, for example?

        Thanks in advance,

        Yuji

        Comment


        • #5
          EFS execution...

          This is a question for the tech support department at esignal.

          I'm running a 2.4 Ghz system myself and can tell you that I have yet to experience any problems.

          You are correct though. I try to create my code so that only a portion of the code (the portion that is required) gets executed at the time it is needed. So, I'm not running a bunch of garbage code in my applications.

          But, I have yet to experience any problems - and this includes code with lots of graphics. I think the programmers at esignal have done a great job with this application and speed. Granted, there is always room for enhancements and new features. But I would state that I have had running (and am running right now)...

          8 Adv Charts.
          18 EFS Studies
          2 quote windows
          3 portfolio windows
          36 EFS Editor Windows
          1 Debug Window
          1 Alert Screen
          IB TWS
          Ninja Trader V3

          with no problems so far. Plus this does not contain the other applications I'm running...

          MSN IM
          Outlook
          4 IEs
          Excel
          Word
          Code Editors
          EFS Help File
          Explorer

          What I've found slows the the operation of an EFS (at least historically) is having a bunch of days of historical data in a chart. I run most of my charts with 2~3 days of historical data.

          Hope this helps.

          Brad
          Brad Matheny
          eSignal Solution Provider since 2000

          Comment


          • #6
            Problem

            mmmm ok if long 1000 shares, and crossover occurs below slow 9min EMA the 1000 shares are covered by a short 1000 shares.

            But a fresh short position is not taken on the next bar (providing fast ema is below slow) as I'd like.

            Therefore another short will only occur if chart/strategy refreshed in this instance.

            Can Brad or someone help me with the code if possible. Thanks

            Spam
            Attached Files

            Comment


            • #7
              Oops...

              Should have caught that minor issue.

              Here you go.

              Brad
              Attached Files
              Brad Matheny
              eSignal Solution Provider since 2000

              Comment


              • #8
                Haha,

                I think I see what you did, you multiplied the number of contracts by 2 if a short from a long position?

                However I think the same will result if crossing from a short to a long i.e. you will need a refresh.

                If i'm short 1000 and then we get a crossover 1000 long then
                all positions will be closed won't I also need to multiply the long contracts by 2 also??

                But then won't we be 2000 contracts x 2000 contracts and be back at where we started?????

                Again thanks for your help Brad

                Regards
                Spam

                Comment


                • #9
                  You are correct...

                  This is where (sometimes) additional thinking is required.

                  As I've been trying to help you, I've been basically "parting" together your application. You are correct in your thoughts that we need to control the "logic" more effectively.

                  To do this, I have created an additional control variable (StrategyisInTrade). This now allows your system to control "Start-up" trades and "Reversal" trades.

                  Here you go.

                  Brad
                  Attached Files
                  Brad Matheny
                  eSignal Solution Provider since 2000

                  Comment


                  • #10
                    Jason once gave a broad outline of these control variables but it seemed to be lifted from one of your efs: MENT-MASystem.

                    Having hit a wall with those control variables, I wish to understand the logic of that efs.

                    I have two questions:
                    Why do you, in order, initialize/control the system, compute the stops, get the technical indicator values, calculate the various buy/sell only only then execute the trades? It seems counter-intuitive.

                    Why didn't you just get the current technical indic values instead of your:
                    /*-------------------------------------------------------------
                    Set the "last" values to the current values. These "last" values
                    will be passed onto the next bar on the chart
                    ---------------------------------------------------------------*/

                    Thank you.

                    Cheers.

                    Andrei

                    Comment


                    • #11
                      Conclusion...

                      In my experience, every RT system is a little different. Yes, they do include many of the same features and functions (stops, entries, targets, exits), but they execute differently depending on the necessities of the system.

                      Given this fact, and the fact that "code structure" dictates the actions of the system, then we have to assume that certain actions are taken in order to accomplish specific tasks.

                      Now, that MA system was created about a year ago and I have revised some of my coding structures (gotten better with Java/EFS). This means I'm able to do more with less code (in some cases).

                      Your assumtion (passing current variable settings to the next bar) is inherent in EFS (unless you reset these variables). Thus, this action is taking place in all EFS code (to some degree).

                      How I create the RT EFS file is dependant on the needs of the system. Most of the time, I "compartmentalize" the code into necessary structures. That way it is easier for me to manage and update.

                      I hope this helps. Basically, the answer to your question is...

                      "there is more than one way to skin a cat". Thus, there is more than one proper way to develop RT EFS code.

                      Brad
                      Brad Matheny
                      eSignal Solution Provider since 2000

                      Comment


                      • #12
                        Hey Brad thanks for looking after me as usual.

                        I will run this all day tommorow to test thanks for helping me make such good progress, I have only had esignal for 6 days.

                        Regards
                        Spam

                        Comment


                        • #13
                          I begin to doubt that anyone managed to successfully write a complete RT system for IB!

                          Considering that AT is really what many want, eSignal could quickly lose its lead as more and more such easy to use tools are given as a marketing tool by brokers (i.e. Strategy Runner).

                          The lack of support from eSignal is utterly disappointing.

                          ...back to that old 3-wheel car: do.

                          Cheers.

                          Andrei

                          Comment


                          • #14
                            Brad, thank you for you reply.

                            Regards
                            Yuji

                            Comment


                            • #15
                              Automated trading..

                              Andrei,

                              From my experience, these tools (StrategyRunner, NinjaTrader, DynaOrder and others) are simply vehicles to deploy trading strategies (multiple profit targets, and stops/trailing levels).

                              They have nothing to do with entry triggers. Most of the work I do (for AT) is in regard to entry triggers. After that has been developed (to a degree of success), then we concentrate on Money Management.

                              There are somethings these utilties (like NinjaTrader) provide that make Money Management a little easier. But developing more advanced Money Management strategies is easier to accomplish with EFS and DynaOrder.

                              I can tell you that I know at lease 5 people with completely automated trading systems (turn them on in the morning and let them go) - most of these are clients of mine. Was the process simple or easy - probably not considering the exploration and development time/costs.

                              Can anyone do this - sure. Does it take time and energy - yes. Is it easy - no. I tell my clients "if it was easy to create a profitable automated trading system, everyone would do it and everyone would be profiting from the markets - we'd all be zillionaires".

                              eSignal will not loose clients because of any automated trading issues (in my opinion). In fact, I believe eSignal provides one of the best applications for develop automated trading systems. Their language is robust and their tools are clean. They are making improvements all the time. In fact, in over a year of developing code for clients, there have only been a 3 or 4 items that simply "could not be accomplished" because of specific requests from clients. Most of these were due to "graphics issues" - such as being able to draw something between bars (ie : at index 2.53).

                              Now, I have started something to help people like you (people who want to start, but may not know where to start). I don't feel right about mentioning it on this board, but you can visit my web site and see it. If you have any questions, feel free to let me know.

                              Best regards,

                              Brad
                              Brad Matheny
                              eSignal Solution Provider since 2000

                              Comment

                              Working...
                              X