Announcement

Collapse
No announcement yet.

Is This Procedure safe?

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

  • Is This Procedure safe?

    I am working on a catch-all to release all handles when my program closes. Is the for loop below safe?


    Long lHandle=0;

    for(lHandle=0; lHandle<999; lHandle++){
    Hooks1->ReleaseHistory(lHandle);
    Hooks1->ReleaseTimeSales(lHandle);
    }

  • #2
    You shouldn't need to release handles in a for loop manner.

    When your program exits, you can call ReleaseAllHistory and ReleaseAllTimeSales once.

    As for history handle, you can call ReleaseHistory for each OnBarsReceived event after you have processed all bars for a particular event. You can see ProcessHistory in our VB sample for detail.

    Comment

    Working...
    X