Announcement

Collapse
No announcement yet.

Efficient use of built-in studies

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

  • Efficient use of built-in studies

    Which of the following approaches is a more efficient use of resources?

    (1)
    var bb = new BollingerStudy(20, "Close", 2.0);

    function main() {
    var ub = bb.getValue("BollingerStudy.UPPER);
    var db = bb.getValue("BollingerStudy.LOWER);
    ...
    }

    or,
    (2)
    function main() {
    var ub = upperBB(20,2.0);
    var db = lowerBB(20,2.0);
    ...
    }

    and why? Thanks,

    ++Ayman

  • #2
    Ayman,

    Here is a post which I believe puts your question in the proper perspective. As far as running a test using the performance monitor to determine efficiency, you can run this as follows.
    [list=1][*]Ensure that both efs's you are comparing will provide the same functionality.[*]Download about two days of a stock or future using the Tick Downloader[*]Open an advanced chart and open the file you downloaded with Tick Replay.[*]Load the first efs that you want to test.[*]Open the performance monitor and reset the values. Ensure it is enabled.[*]Start playing back the tick file, increasing the playback speed being careful your pc can take the load.[*]Once the file is complete, record the values from the performance monitor, remove the efs from the chart and reset Tick Replay. [*]Then load the second efs. [*]Reset the values in the performance monitor. [*]Start playing back the tick file again with the second efs, increasing the playback speed being careful your pc can take the load.[*]Once the file is complete, record the values from the performance monitor. You can now compare how much time each of the efs's take over the played back time period. Differences need to be evaluated based on the overall time it takes for each. Remember that 1000 miliseconds is equal to 1 second.[/list=1]

    This should not take you more than a couple hours to run the test. My experience is similar to Alex's in the link I posted. Provided the efs's are written with similar functionality, they are performing a similar number of calculations, and therefore take up the same number of resources. If you would, please post the efs's and the resultant timing data, I would be interested in what you come up with.

    Comment

    Working...
    X