Announcement

Collapse
No announcement yet.

Stable database management

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

  • Stable database management

    Dear all

    Recently I have designed a strategy to trade two securities at the same time according to the movement to the same indicator. However, I had a very serious problem that the two securities were not traded at exactly the same times, and they have different total number of trades in the same back testing period as well. From my observations, the indicators are perfectly identical, and the conditions of the triggers are also exactly the same for the two. I wonder possible reasons why this problem happens. By the way I use strategy.do...() functions to execute my trades in the scripts. Expecting your help...Thank you~~
    Last edited by teresali; 08-30-2010, 07:10 AM.

  • #2
    Teresa,

    I would have to see your code to offer any help. One thing I might suggest is to run a 2 or 3 day time template and run simple base tests to determine if your scripts are doing exactly the same thing on both symbols.

    Also, make sure you are issuing the same types of orders for the entry/exit of the trades. If not, this could be why you are seeing a one bar difference in some cases.

    Additionally, as the two symbols are probably generating different indicator results (even though they look similar), I would suggest you use the DATA EXPORT feature to verify the data of the indicator against the logic of your efs script to see if there is anything that could cause this type of error.

    Wish I could help more, but without seeing the scripts and actually testing them for you, all I can offer is debug the heck out of it with a small data set.

    Best regards,

    B
    Brad Matheny
    eSignal Solution Provider since 2000

    Comment


    • #3
      Thank you very much for your help. My sripts are attached (one is for futures and another one is for currency). And today I just realised that after following your advice to export those data to compare them with each other, the indicators are in different decimal places. Maybe it would be at least one of the reasons why they do not trade together. But actually I did not make any settings about the decimal places for my outputs in the scripts. What do you think I can do to solve this problem? Would like to hear from you. Thank you!
      Attached Files

      Comment


      • #4
        currency script

        Here is the script attached to the post for the currency.
        Attached Files

        Comment


        • #5
          I've looked at your code and the only advice I can offer is to verify the pricing of all entries and exits using the Strategy function.

          If you don't pass a valid price, the function call is ignored. That means you are not entering on thee bar you want at the price eyou want.

          So use DebugPrintln statements to verify price and other actions in your code.

          Add something like.

          debugPrintln(getHour()+":"+getMinute()+" "+nEntryPrice+" : "+Strategy.isLong()+" "+Strategy.isShort());

          AFTER your Strategy.do???() function calls to test the results of the functions.

          This should tell you if you are properly executing the Strategy functions. If not, there is your problem.

          Give this a try.
          Brad Matheny
          eSignal Solution Provider since 2000

          Comment


          • #6
            Thank you for your advice, Doji. Actually after I have rounded the indicator on the currency chart to 2 decimal places, my problem has been already done properly most of the time, which means there are much less different entries and exit for the pair. But by following your earlier advice, to export the data from each chart and compare, I realized that the database for these two charts are actually slightly different in the sense of some missing data on one side or another. It is true, and for all those are not missing, the indicators on each chart are exactly the same. So maybe I have got to set the specific time to enter or exit and pass it to another security to ensure exactly the same trades on both sides. How do you find it?
            Last edited by teresali; 09-02-2010, 07:08 PM.

            Comment

            Working...
            X