How to execute shell after exploration finished

Hi All,

Nice to meet you. I am new to AFL.

Recently I want to execute something by a shell after finishing exploration, however, the shell
pops up even before the exploration has finished. (In my version of amibroker there is no batch schdeuler). Is there any way to solve this such as by OLE, etc. and how?

Moderator comment: you must use CODE TAGS
We have added them but next time you need to use them yourself

//exploration loop via all files first

for ( i = 0; ( sym = StrExtract( symlist, i ) ) != ""; i++ )
    // calculate correlation over 252 bars
    Corr = Correlation( C, Foreign( sym, "C" ), 252 );

    // set color dynamically based on correlation values
    // and display the output in exploration column
    Clr = 32 + SelectedValue( Corr ) * 32;
    AddColumn( Corr, sym, 1.2,
               ColorHSB( 128 + Clr, 255, 255 ),
               ColorHSB( Clr, 255, 255 ) );

SetSortColumns( 1 )

//how to execute the below shell only after all exploration finished?

ShellExecute("C:\\whenfinishedexport.bat","","", showcmd = 0);



That is NOT how you do things. Just DO NOT call ShellExecute from exploration.
Exploration runs in multiple threads. There is NO WAY you can know which thread finishes last.

Instead you should use BATCH where you can sequence exploration and run batch after it is finished in safe way.

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.