Scan, Exploration Back Test

I wanted to know what are the uses of Scan, Exploration, BackTesting

When to use each of the above.

please provide any link to information on this…

Use and abuse the following concept:

1 Like

Hello @phb, as I understand it

  • Scan is used to find entry and exit conditions, in your code.
  • Exploration is used to find, explore and display many elements of data one wishes to “Explore”.
  • Backtest is the process of taking one’s trading ideas and testing them historically. Based on the assumptions you choose, ie starting equity, time period, time interval (intraday, daily, weekly, etc), data, etc.

I highly recommend searching the Amibroker site. A search for, “Scan”, found the following link in the Knowledge Base about the differences between Scan and Exploration.

http://www.amibroker.com/kb/2014/10/03/how-to-setup-perodic-scans/

This is a good starting point.
Cheers,
Jim

4 Likes

Hi

Thank you for your answer. I searched here and could not find comparison like you gave.

I am testing a piece of AFL code in all the three Scan, Explore and Back Test, but they are producing difference outputs of signals. So I wanted to understand is there any different approach in their working, that is why I posted the original question. still try to figure out the reason for that.

Thank you very much.

@phb,
The only difference between Exploration and Scan is that Exploration can be used for all the same things that you can do in Scan. But Scan can not do same things you can do with Exploration.

So in short...
Exploration is advanced Scan. That's the only difference between those two ones. Exploration being (much) more powerful than Scan feature.

Scan is mainly used for output of (raw) signals.
Scan always expects Buy, Sell, Short, Cover variables for output of results in result list.
But Scan can also be used for things like creating Composites or for backfilling data, or export of data to csv file etc. But again all these things can be done via Exploration too.

So basic scan would for example

Buy = Cross( C, MA( C, 200 ) );
Sell = Cross( MA( C, 200 ), C );

On the other hand via Exploration you can additionally output any advanced tables you have in mind on any data (it can be symbol's data or data being stored in matrix). Actually you can output any table in same format as you could output in Excel. So basically Exploration is similar to spread sheet output program.

Examples?

Correlation tables
http://www.amibroker.com/kb/index.php?s=correlation
Check for more on exploration
http://www.amibroker.com/kb/index.php?s=exploration

Or simply OHLC data output

if ( Status( "action" ) == actionExplore )
{
    format    = 1.2;
    width     = 70;
    Colfont   = colorLightGrey;
    Colcell   = colorDarkGrey;

    SetOption( "NoDefaultColumns", True );
    SetSortColumns( 2 );

    AddTextColumn( Name(), "Ticker", 1.0, Colfont, Colcell, width );
    AddColumn( DateTime(), "Date/Time", formatDateTime, Colfont, Colcell, 120 );
    AddColumn( O, "Open", format, Colfont, Colcell, width );
    AddColumn( H, "High", format, Colfont, Colcell, width );
    AddColumn( L, "Low", format, Colfont, Colcell, width );
    AddColumn( C, "Close", format, Colfont, Colcell, width );
    AddColumn( V, "Vol", 1, Colfont, Colcell, width );

    AddSummaryRows( 63, format );

    Filter = 1; // Status( "lastbarinrange" ); etc...
}

or outputting signals

Buy = Cross( C, MA( C, 200 ) );
Sell = Cross( MA( C, 200 ), C );

if ( Status( "action" ) == actionExplore )
{    
    AddColumn( C, "Close", format = 1.2 );
    AddColumn( Buy, "Buy", 1 );
    AddColumn( Sell, "Sell", 1 );
   
    Filter = 1; // Status( "lastbarinrange" ); etc...
}

As been posted already you can output non symbol related data also.
So for example: Pivot tables
Here in AmiBroker
GfORSFU

And here same output in Excel
I1HC4Qv

Also another feature of Exploration is XYChart... one. There you can plot Scatter (dot), Histograms, Line, Line/Dot.
https://www.amibroker.com/guide/afl/xychartaddpoint.html
https://www.amibroker.com/guide/afl/xychartsetaxis.html

So for example here is one outputting efficient frontier data and plotting it in Exploration
JbXBvLJ
LAaQPyD

Or distribution output.
1
1

And the list goes on and on... endless possibilities and once again only imagination is the limit.

45 Likes

Wow. that is excellent. Thanks you very much for your time.

will go through the same.

Bumping this to say what an informative fine post it is. Very helpful.

4 Likes

Whenever I see reply from fxshart.... My mind say legend came and now the real answer will come.