Announcement

Collapse
No announcement yet.

EFS code "time based point stamp"

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

  • EFS code "time based point stamp"

    Dear All,

    I am still finding that I am creating to many losing trades when the market is directionless/sideways this is because there are many crossovers of the fast ema above and below the slow ema.

    Brad placed something in my code that prohibited more than one trade per bar which helped. But he also said that he could insert a time based point stamp in that when the stock breaks out of say a 0.25 range and trades resume.

    Can someone therefore change the code to close the current position on an ema crossover and wait for either 0.15$c breakout above or below the position close before making a new trade on the next bars.

    Or close position and wait 10 minutes/2 bars on any crossover then resume trading on 1000 contracts. At the moment on crossovers 2000 contracts are bought or sold changing position and leaving just 1000 contracts to minimise trades, this order system may need changing for closes.

    If anyone has any other code that could prevent the above problem please could they insert into my code for testing.

    I am willing to pay someone to code for Dynaorder as soon as all testing finished and I have my final code. Brad I don't mind paying you for help with this you have been great so far, I just feel bad I don't give you anything in return for helping me.

    Regards
    Spam
    Attached Files

  • #2
    I've had the same problem of "time-stamp" for an IB system and I would believe that there is no real solution. The efs coding is way too difficult for the little problem.
    Furthermore, the eSignal staff is in no hurry to give a real -and working- example beside some broad and empty outline despite numerous demands.

    I suggest you look at Dynaorder (try them and buy through eBay) which permits to quickly get a system running till some data vendor/on-linebroker gives what one really need.
    eSignal does not.

    Cheers and good luck.

    Andrei

    Comment


    • #3
      Hi Andrei,

      Have you asked Brad's help on this one? I think he should be able to help you.

      I think the "time stamp range breakout" is the ultimate solution when a crossover occurs, with a stop if it goes against you.

      Other than that why not restrict trades on sma or ema crossovers. Say close position on a crossover then wait 10 minutes or 2 bars before taking a new trade, if the crossover reoccurs again wait another 10. Its correct to say you may miss reversals but maybe its better than over trading and you will get some of the bigger moves.

      Other than that I thought about linking this code in with a MACD histogram, i.e. if MACD between -0.1 and 0.1 no position to be taken if above or below allow trades does anyone know if this is possible?

      AUTOMATED TRADE ENEMY No. 1 DIRECTIONLESS MARKETS! HELP WANTED

      Regards
      Spam

      Comment


      • #4
        Monsieur Brad is a real gentleman to help many but he is not part of eSignal.

        It is up to eSignal to support us... and, in this case for some reason, they do not.

        Do a search on time stamp or equivalent and you'll see that the same minimalistic explanations were given a number of times.

        I am stuck at about your level and I do still hope eSignal will give a usable example of "time-stapping".

        Try this efs which is just an example but you'll see the same problem of TS...

        Cheers

        Andrei
        Attached Files

        Comment


        • #5
          This is Bull S*** today for example AMAT today,

          1st trade of the day short-------- +$750 - 9.50 pm to 12.20pm
          2nd trade on crossover -$40---12.20pm amat =$23.79
          3rd trade on crossover -$10 --12.33pm amat =$23.75
          4th trade on crossover -$30 ---12.35 pm =$23.73
          5th trade on crossover -$20 etc.
          6th trade on crossover -$25 etc.
          7th trade on crossover -$25---- 12.55pm =$23.74

          To many trades over 35 minutes in a very narrow range, I need something that will resume trading after a say a $0.12 movement breakout. Its not fool proof but it will help, there are times of the day when its better to stay out and flat markets are just that.

          Yesterday I was down $450 (on paper) becuause of this narrow band stuff

          Anyone got any code ideas for breakouts/time ideas particularly after an ema cross anyone ??? I sound like an old record, yawn.

          Regards
          Spam

          Comment


          • #6
            I believe that the problem is not one of efs coding or the responsibilities of eSignal. Before anyone can help you code an efs you must first clearly define, in very specific quantitative terms, what constitutes a "directionless market".

            Comment


            • #7
              My example was not about trading strategy but about the problem of time-stamping.

              If you run that efs, at some point it will bleed...

              Except from that fact, there is no trading value in that efs.

              Cheers

              Andrei

              Comment


              • #8
                Focus.....

                I was gone most of the afternoon (and evening) yesterday. Let me try to work up a solution for everyone (or at least try).

                Bleeding of data is typically not a problem with EFS using time-stamps. Now, if you are saying "bleeding" in terms of taking losses, then that is a result of the trading system, not the time-stamps.

                Time stamps are simply a component of a trading system. They accomplish a specific task and have nothing to do with your entry triggers. They just limit the number of times these entry triggers can be triggered. The fault is within the entry triggers (or the filtering of the entry triggers).

                The next solution is to find some examples of this "bleeding" and evaluate them for ways to improve the results of the system. Anyone care to post any images with examples??

                B
                Brad Matheny
                eSignal Solution Provider since 2000

                Comment


                • #9
                  Hi Brad,

                  Ok check this, this is the trade history for amat from a few days ago. Basically on an ema crossover following a trend often the faster ema crosses over the slower ema many times when the stock is flat or there is no momentum, this causes many small losses + many trades in a tight range. I need a stamp that when a crossover occurs all positions are closed untill the stock moves above or below by say .12$. At the moment I am always in the market with this code, I must be out at some times untill a breakout. Please note trade history from yesterday.

                  Also I sent an email to you via your site did you receive?

                  Regards
                  Spam
                  Attached Files

                  Comment


                  • #10
                    What you really need...

                    Spam,

                    What you really need is more advanced logic in your code..

                    Your system does (potentially) need this additional filter, but it then also needs more advanced exit conditions (to handle potentially open trades).

                    Let's discuss what you want...

                    1. you want to limit entry conditions to "when market price is < or > .25 away from last traded price" or "when your EMA "change" is < or > 0.25" - correct?

                    2. You want to allow for EXIT TRADES is a reversal signal occurs when the above conditions are NOT met. - correct??

                    Is this about it..

                    B
                    Brad Matheny
                    eSignal Solution Provider since 2000

                    Comment


                    • #11
                      How about this for a solution...

                      Spam,

                      Let's try this (which is a little easier to code).....

                      I'll make a change to the code so that ENTRY TRIGGERS will NOT go off is the current market price is within nn.nn of the last ENTRY TRIGGER (avg price).

                      This way, if you set the variable to 0.25, then the market would have to move at least 0.25 pts away from the LAST ENTRY TRIGGER before any new entry triggers will be allowed to trigger.

                      I'll also set the code to RESET each day, so the first trade of the day will go off at 6:30 AM PST. After that, my new logic will kick in.

                      Brad
                      Brad Matheny
                      eSignal Solution Provider since 2000

                      Comment


                      • #12
                        Brad,

                        ANSWER to your 1st reply

                        1) yes this is correct
                        2) basically on every crossover I want the position to close and wait for a < Or > 0.25 move before allowing a fresh entry trigger/new position. I understand this may require new coding and maybe a lot of time, therefore:

                        ANSWER to 2nd reply

                        Yes sounds good, otherwise I think you would totaly have to redo the order entry management.

                        But will it exit when the ema's cross over or will it have to be >0.25 from initial entry to trigger a exit/close??

                        Also the chart is in UK GMT time 2.30 which is 9.30 EST USA,

                        Did you get the email via your site???

                        Regards
                        Spam

                        Comment


                        • #13
                          For those interested in time-stamp, here is some interesting explanations:

                          "
                          Developing RT code is much different. You have to work out the logic issues for you code to operate properly. There are a few tricks to this as well.

                          1. Use Time-Stamps for certain actions. Record the time of the bar that an action took place, then you can prevent a similar action from acting on the same bar..

                          nEntryTime = 0;


                          // Allow a test for new entry signals
                          if ( (time to buy) && (nEntryTime != getValue("rawtime",0)) ){
                          // Record the bar time for our entry
                          nEntryTime = getValue("rawtime",0);
                          GO Long!

                          }

                          if ( (time to sell) && (nEntryTime != getValue("rawtime",0)) ){
                          // Record the bar time for our entry
                          nEntryTime = getValue("rawtime",0);
                          GO Short!

                          }

                          Using this type of time stamping will prevent your system from "flipping" back and forth on the same bar.

                          There are many others, but this is one of the most important processes in developing RT code.

                          Brad
                          "
                          and
                          "
                          I have a bunch of experience with both.

                          There are some minor tricks to accomplishing what you want. Like code structure....

                          You should probably go to my fileshare group (Matheny Enterprises) and download the chat session (the only one there) that discusses Strategy functions and uses. Also, in my fileshare section is a "guide to building Strategy code". Both of these would be a big help to you.

                          Here are some simple answers to your questions..

                          Using Strategy.MARKET, the esignal system assumes you enter on the OPEN of the next bar (or open(1). So, when you enter a LONG trade using this option, you can record the open price of the next bar as your entry price..

                          Strategy.doLong("Long Entry", Strategy.MARKET, Stragegy.THISBAR, Strategy.DEFAULT);
                          nEntryPrice = open(1);

                          This will then allow you to place your stop orders based on the entry price.

                          Now, if you are using a LIMIT or STOP order to place your entry trades, then you have to pass it a price value. So, if you know the price value you are entering at, then you should be able to place stop loss orders also.

                          I like to check (within my code) to see if the order could be executed at the proper price. This way I know when/where the market entered the order and can place additional orders as necessary.

                          Another way to do this is to check Strategy.isLong() and Strategy.isShort(). When these become true, you are in a trade and thus can place your stop loss and profit target levels.

                          If you need more help, please let me know.

                          Brad

                          __________________
                          Brad Matheny
                          ** Code Pusher **

                          "
                          Keep searching, he said...

                          Cheers

                          Andrei

                          __________________
                          Brad Matheny
                          ** Code Pusher **

                          Comment

                          Working...
                          X