tradestation question

Discussion in 'Trading Software' started by bundlemaker, Jun 12, 2003.

  1. I'm trying to use the CountIf function to do historical statistical tests. Very simple stuff. For example, to count how many bars have up closes. I know how to define the conditions.

    I don't know how to output the value that CountIf creates. I don't want an indicator or the like, I want the raw number. Maybe even do several conditions and create a report. Any ideas? I think I just need a hint or 2 to get me on the right track.

  2. bundle, here's an example... this will count the number of inside days that occurred over the past 10 bars.


    InsideDays = CountIF(Low > Low[1] and High < High[1], Length);
  3. Poundtherock,

    Thanks for your response. I understand that part of it. What I need to know is how I can get that value out on to the chart, or printed or to a report, etc.

  4. Plot1(InsideDays,"IDs");
  5. If I use this code, all that happens is I get a line of red dots at bottom of chart, and price chart is all scrunched up at top. I'm doing this with a ShowMe. Should it be something else?

    Thanks for helping me out on this, it's driving me crazy.
  6. bundlemaker,

    do it is an indicator instead, this will plot a line in a subgraph keeping a tally of inside days (or whatever criteria you are looking for). A show me is generally used to point out conditions that occur around a certain bar (doji, hammer, etc.). The indicator will hopefully do the trick.

  7. bundle, if you want to get the values on the chart, you can just use the text routines to write the number directly on the chart (above or below the bar). If you need to get the numbers into a report, just use the print statement to print to a file and then import into Excel or something. Let me know the specifics and I can give you some code, e.g.,

    Value1 = Text_New(Date, Time, High + (0.3 * Range), NumToStr(InsideDays));

  8. ah, that did the trick. Thanks to all (especially for saving me the $25 minimum charge that TS has for EL support :)