hi, i wonder what is the best way to do an exploration over a list of symbols when you need information from a chart that is "symbol linked". So to illustrate I have the charts below:
the second pane on the right side of the image is calculated using the top left (floating) chart. This floating chart is in the "tick" timeframe and calculates the so-called "volume delta" or "delta volume". The chart on the right side I have in the 5Min timeframe and is "symbol linked" to the floating top left chart which is in the "tick" timeframe. In the tick timeframe chart the "delta volume" is calculated and saved inside a static variable which is then called inside the 5min timeframe.
Now if I want to do an explore over a list it will need to get information from the tick dataframe of all the symbols in the list.
Currently I solved it like this. I do an explore in the 5min timeframe over a list of symbols and then I make an attempt to activate each symbol in the chart so that the "delta volume" array is calculated in the tick chart. This "delta volume" array is then saved to a static variable and is called inside the 5min chart and then can be used during the explore.
if( Status( "action" ) == actionExplore )
{
if( status( "stocknum" ) == 0 )
{
Say( "explore" );
#include "C:\Program Files\AmiBroker\MyFormulas\misc\loopthroughlist.afl"
}
//Filter = ( Buy2 OR Sell1 OR Buy1 OR Buy3 OR Sell2 OR Sell3 OR Buy0 OR Sell0 );
Filter = ( Buy2 OR Sell1 OR Buy0 OR Sell0 );
//AddColumn( Buy1, "Buy1 (Regular)", 1.2, colorBlack, IIf( Buy1, colorBullishRegular, colorWhite ) );
AddColumn( Buy2, "Buy2 (Hidden)", 1.2, colorBlack, IIf( Buy2, colorBullishHidden, colorWhite ) );
//AddColumn( Buy3, "Buy3 (Affirmative)", 1.2, colorBlack, IIf( Buy3, colorBullishAffirmative, colorWhite ) );
AddColumn( Sell1, "Sell1 (Regular)", 1.2, colorBlack, IIf( Sell1, colorBearishRegular, colorWhite ) );
//AddColumn( Sell2, "Sell2 (Hidden)", 1.2, colorBlack, IIf( Sell2, colorBearishHidden, colorWhite ) );
//AddColumn( Sell3, "Sell3 (Affirmative)", 1.2, colorBlack, IIf( Sell3, colorBearishAffirmative, colorWhite ) );
AddColumn( Buy0, "Buy0 (ATR)", 1.2, colorBlack, IIf( Buy0, colorBrightGreen, colorWhite ) );
AddColumn( Sell0, "Sell0 (ATR)", 1.2, colorBlack, IIf( Sell0, colorRed, colorWhite ) );
}
where the code in the include file is:
SymList = "QCL#,QNG#,QPL#,QSI#,QGC#,QHG#,@NQ#,@ES#,@YM#,@RTY#"; // any comma separated list can be result of CategoryGetSymbols for example
AB = CreateObject( "Broker.Application" );
ABDocs = AB.Documents;
if( ABDocs.Count > 0 )
{
AD = ABDocs.Item( 0 );
ADWindows = AD.Windows;
if( ADWindows.Count > 0 )
{
AW = ADWindows.Item( 0 );
AW.Activate;
for( i = 0; ( sym = StrExtract( SymList, i ) ) != ""; i++ )
{
AD.Name = sym;
AW.SelectedTab = 2;
_TRACE( "Symbol is: " + sym );
}
}
}
so this seems to work but not very reliable. What would be the correct way to do this?