Running backtest continuously every 1 minute

I am interested in running backtest continuously every 1 minute. The only way i can think of currently is through python. I am looking for some way inside Amibroker itself ?

Wrong.
Simply use auto-repeat of analysis

416

BTW, have you ever read AB manual?

1 Like

I am talking about running backtest , not scan/explore.

Then use Batch and AB task scheduler and add 60 times separated by 1 minute and set Repeat interval to "Every hour".

050

859

2 Likes

As an alternative to that tedious edit job, you might consider the following -

Create a small AFL/APX that simply invokes the hook in ShellExecute and set that AFL Exploration to auto-repeat every minute. Then, the batch can be set up to load and execute a backtest APX.

ShellExecute( "runbatch", "Test.ABB", "" );

The backtest batch has a minumum of two steps. One to load the backtest APX, and a second one to run the backtest.

8 Likes

Thanks for the wonderful idea @abbruiser !

One thing i don't want to close my already open project file. I want batch to keep using already open project file, since i am using live data and everytime project file reopens it takes a lot of time to get data from my data vendor.
So i basically i want it to be opened once and keep using the same project file.

@akshay.gupta55

Could kindly share a practical scenario of running a backtest every 1m is prospective?

You can check out OLE automation, I'm using it for a variety of stuff.
Load the backtest once and call it when desired through AnalysisDoc described here:
https://www.amibroker.com/guide/objects.html

that way you wont have to load project repeatedly.

Ofc, this isn't from within AB but since you mention py, you seem to have a bigger setup.

Yeah,a practical scenario would be driving autotrading through CBT framework. So i implemented autotrading through CBT instead of exploration.

https://forum.amibroker.com/t/running-live-strategies-on-basket-of-200-stocks-using-exploration-window/6933/10