Tradestation calculation bug?

Discussion in 'Trading Software' started by wizardx, Feb 24, 2006.

  1. wizardx


    I am using TS2000i. There appears to be a bug in the maximum drawdown calculation. Using one stop strategy, the number and location is calculated correctly. Using another stop strategy, the calculation and location is incorrect. I can't seem to isolate the problem. The difference is not simply the commissions and slippage assumption.

    The "Analysis" tab shows the date and amount of the max drawdown. When I try to find this date and amount in the "Trades" tab, the numbers don't match.

    Has anyone else cross checked this? It seems strange that not a lot of people are talking about this. I only found 1 link in Google where another person brought up the same problem. Do I have an incorrect setting somewhere?
  2. there are a number of bugs in TS2000i. We are using it, but only in a discretionary manner. (basically only for charting with custom indicators)

    Problems observed:

    - calculation error and a crash when using enhanced precision checking (turned on by default). This can be turned off by opening any study in easylanguage and then go to view => options => untick "enhanced precision checking" Then shut down EL, TS and restart, should be working fine then.

    - NthHighestBar function: there is an typo in the code, look at the NthLowestBar function for the location and error
    (Value1 = BarNumArray[value1]; This should be Value3 = BarNumArray[value1];) , discovered it while coding the Aroon and then noticing it was different from metastock

    - wrong assumptions about fills with market orders: it takes half the time a fill at the bid and the other half of the time a fill at the offfer while in practise it will always be a worst case scenario

    - when having a signal at close of the bar it waits until the first tick of the next bar has arrived....

    however we like using TS2000i and am not interested moving away from it.

  3. maxpi


    I found another bug: never divide, about 20 instances out of a thousand it will give an erroneous answer. Invert and multiply solves it. When I finish writing some EL I do a search and mark all of the "/" instances and change them to inversion and multiply.

    Also the order of math operations is non-standard, always use () to force EL to do things in the order you want, especially if you are using same code between TS2k and TS6-8.
  4. wizardx


    Here's another bug.

    Say you have 1 minute data in an ASCII file and you want to plot 10 minute bars. Set the session end time earlier so that the remaining data for the day is not plotted. Make sure that the session end time still falls on a 10 minute increment though.

    The last bar of the day plots 11 minutes! Every other bar of the day plots 10 minutes.

    Attached is some sample data from 900 to 2000 for a day. I plot 10 minute bars from 900 to 1730. The last bar for the plot at 1730 plots 11 minutes of data to 1731! This is clear when you look at the data from the ASCII file compared to the chart.

    Can someone test this on their tradestation and confirm the same problem? Thanks.
  5. I thought tradestation time stamps were the end time of the bar. So the first bar of the day should be 901, not 900
  6. wizardx


    yes the time stamps are at the end of the bar. however, i'm saying that even though the time stamp for the last 10 minute bar says 1730, it actually plots 1731's data too.

    the 1730 10 minute bar should plot 10 minutes of data from 1721 to 1730, but instead it plots 11 minutes of data from 1721 to 1731.

    all the previous bars for the day are correct. only the last bar as described in my example is incorrect.
  7. Well, before you call something a "bug" you should at least try to understand things better.

    Say I have a timestamp like 20060224, 9:39:59 (last price here)
    In tradestation that will go on any bar ending in 9:40 am

    If I have a timestamp like 20060224, 9:40:00 (last price here)
    This tick will now go on any bar AFTER 9:40 am even though it ends in "00"

    Also, ts plots your 10min bars from the time you say trading begins. It's not going to plot 10 minute bars at 9:10, 9:20, 9:30 if you tell the program that trading begins at 8:55 or 9:05

    If you tell ts that trading begins at 9:05 for example and tell it to plot 10min bars then the bar times will be as follows:



    You're all confused, bud. Go study time again.

  8. wizardx


    i'm not confused. the ASCII file isn't raw tick data. it's 1 minute bars. tradestation takes 1 minute bars and then converts the 1 minute bars to 10 minute bars. so every time stamp in the ascii file is exactly on the the minute. there aren't any intra minute bars.

    in my example, for the 1730 10 minute bar, it will plot 11 minutes of data(1 minute bars from 1721 to 1731). any other bar earlier in the day will correctly plot 10 minutes of data (10 1 minute bars).
  9. Shit, you still don't get it. Try changing the beginning time to 9:05 instead of 9:00

    Maybe that might give you a clue on how it's supposed to work!

    Are you telling me that when your clock says it's 12:00:00 (midnight) it's not the beginning of a new day yet???

    Even if seconds were omitted, (00:00) it's a new day, get it?!

    Basic time!

  10. wizardx


    i get it. do you? have you tried with ts2ki?

    plot the same data with ts 8.1 (as someone showed me) and you get different charts. the difference is that last bar.
    #10     Feb 27, 2006