Announcement

Collapse
No announcement yet.

Adding time as a factor

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

  • #16
    ubo,

    You said, "This means if our 5-DMA is
    above our 13-DMA we will only accept long signals, and if the 5-DMA is below the 13-DMA we will accept only short plays"
    I don't think I said this (certainly not on this thread). Maybe Alex did, or maybe this is from another thread?

    G
    Garth

    Comment


    • #17


      In a ta lesson on stochastics from 8/2000

      Ill try your new script later, tx a ton.

      Comment


      • #18
        Wow, what a blast from the past. I had forgotten about doing those serries of lessons. Amazing that you remembered my name from way back then...

        G
        Garth

        Comment


        • #19
          not sure what happened but i justran a fast backtest. # of trades dbled, % was cut in half, and the loses dbled - ill look at what you did later.
          ubo

          ps i did a search under ur name and found that article, then read it a few days ago for the 1st time
          Last edited by uboinc; 06-13-2003, 09:17 PM.

          Comment


          • #20
            You will have to change the:

            var nCloseHour = 13; // Change to reflect your TZ

            line again. I set it to be correct for my tz...

            Garth


            PS: Just goes to show you to be careful with the words you let into the internet - they might remain there for a LONG time.
            Garth

            Comment


            • #21
              im coming to edit my reply, that i didnt correct the tz to est, and change the sma to ema, and i see your note

              so i made the changes, cut the trades from 380 to 319, win % basically the same, but the average win $ wise is lower by $200 or 12% approx, and teh average loser is $100 more or 10% more.

              So it didnt have the desired results


              oy oy oy

              its still holding trades overnight, just realized it

              Comment


              • #22
                When I run it here, there are no overnight trades (10 minute ES chart and 20 min IBM).

                What symbol,interval and time template are you using? I will test against that...

                Garth
                Garth

                Comment


                • #23
                  tx garth.

                  running it against "NQ #F" 10 minute candles.

                  time template i created, 60 days, 10 minute, data from 8.15 to 16.15 est

                  Comment


                  • #24
                    I'm looking over the code and one thing I have a question on. Alex set up the code so that you will not enter positions between 11:00 and 14:00 hours. I can understand that (dead zone, choppy period). But he also has it so that it will not exit UNLESS it is between 11:00 and 14:00...which doesn't make sense to me. I suspect that you either want:

                    1) To take exit signals whenever they are generated or
                    2) Ignore exit signals between 11:00 and 14:00.

                    All the above ignores the 7 point exception rule. So could you clarify on the above, and then if you do want to ignore exit signals between 11:00-14:00 (as it is now), then does the 7 point rule effect this?

                    Garth
                    Garth

                    Comment


                    • #25
                      Re: Reply to post 'Adding time as a factor'

                      Garth
                      You may not want to rely too much (if at all) on my original code.
                      At the time all I did was correct uboinc's first draft by making sure the following conditions were applied:
                      - the system was always taking trades outside of 11-14 hours and always in a trade either long or short.
                      - during the 11-14 hours however if a reversal signal occurred the system would only Close the trade but not Reverse it.
                      I did not make any provisions for the 20 minute/7 point range that uboinc wanted as a condition to close a trade inside the 11-14 hours.
                      Alex
                      Last edited by ACM; 06-14-2003, 12:39 PM.

                      Comment


                      • #26
                        Alex,

                        What I may not want to do is post anything before my morning coffee. You code is 100% right. After I finished my Latte and was out working in the garden it came to me that this is a 100% in system with no exits except for the 11:00 to 14:00 period and EOD exits. Therefore your code was correct.

                        Now what I don't understand is why my code exits at close 90% of the time, but not the other 10% (% are made up, but I suspect close to correct). Maybe I need to go plant a few more things and it will all become clear ;-).

                        Garth
                        Garth

                        Comment


                        • #27
                          uboinc

                          its still holding trades overnight, just realized it

                          With the interval and Time Template you are using it seems to me that it would hold overnight.
                          If I understand Garth's code correctly he sets the nCloseMinute as >=15 which never happens on a 10 minute chart ending at 16:15. In fact if you change var nCloseMinute = 15; to var nCloseMinute = 10; then the system exits at the end of session.

                          Garth

                          What is the Time Template and interval you are using?
                          FYI I just ran your code on ES #F, 10 min, 24hr TT and in over 30 days it exits all the time at 16:20 which would be correct.

                          Alex

                          Comment


                          • #28
                            Alex,

                            I was wondering if it was the TT. Thanks for checking it out before I could. I think changing the exit minutes is the right way of doing it rather than changing the TT as that would reflect more accurately how a trader would trade it I would think.

                            To make the minutes correct, I guess I should alway check for
                            nCloseMinutes%nInterval to always be zero. If it isn't then we will never get the EOD exits.

                            Garth
                            Garth

                            Comment


                            • #29
                              Just FYI,

                              I changed the nCloseMinute to 10 and ran it again on a TT of 6:30 to 13:15 and it exited correctly at 13:10 everytime. If I then modifed the TT to 5:15 to 13:15 it doesn't exit correctly all the time. So the TT you pick is very important when this is run.

                              Now the question is, is there a better way to code the EOD close out or does eSignal need to provide a flag to the backtester that specifies "Please close out my trades at this time, even if it is intrabar".

                              Garth
                              Garth

                              Comment


                              • #30
                                garth,

                                figure the reason the trades dont close at 4.15 is the mkt closes at 4.15. most days there r no trades at the exact last minute. fridays last was 4:14:59 the next trade is 4:45, in the no trade zone. lets make it easy and close all positions at 4:05pm est, never will have a problem that way.

                                as far as the rest of ur questions; what i want is for the period from 11am to 2pm est to be a time zone where only trades will be exited no matter what the range, on any exit signal, and only new trades entered if the range the prior 20 minutes was >7pts

                                i think i covered it all, il be on all night working so ill answer any ?s u have and thanks a ton.

                                UBOInc

                                ps tx alex

                                Comment

                                Working...
                                X