tick by tick backtesting/ look inside the bar /bar magnifier feature in amibroker

#11
Timeframe examples are in the help file already!

And if you enter/exit on close/ open you don't need to look inside bar.
It is rather useful i.e. if you exit via stops as seen in this picture to overcome problem of what extreme came first ... High or Low:

first of all ,thnx for responding !
i have read "how to use multiple timeframe " article on amibroker site. and also read those functions help file. but i m not able to use these functions in backtesting (look inside the bar).

i will try again to explain my problem. suppose i m using a very simple macd cross over system in daily TF.
Buy = Cross( MACD(), Signal() );
Short = Cross( Signal(), MACD() );
sell = 0;
cover =0;

in real time i will get an alert as soon as any of these condition is satisfied. and i'll execute the order but some time these signal disappear after few minutes.now amibroker backtesting do not consider this situation in backtesting result. as it does not look inside the bar. it only considers o,h,l,c.
so i want to code an afl that can use 1minute data to look inside the bar while backtesting on daily tf so that i can get a realistic picture of the performance of system. where the intrabar false siganal will also be considered in backtested result. in this way i will get true performance of the system.
hope i m able to clarify what i m looking for?
pls if possible modify above code as per my requirement.
thnx
 
#13
Set option backtest- check stop immediately- or look at help file applystop and take attention to scenarios, is not very easy to set this features but is present; also for control correctness of results according to your strategy make some tests and control manually inside bars in historical data
 
Last edited:
#14
I also have a lot of difficulty in spite of the scenarios, in the set of this blessed control tick by tick, you have news? i don't understand the scenarios, and the explanations are not very detailed, I did a session in realtime with IB and practically out of 5 trades I have only taken one right calculated in backtesting.. is incredible how difficult is setting correctly the backtester, and is also one of the most important issues in my opinion, I'm constantly setting different values ​​but backtest is very far from reality, especially I can not find the correct values​​, if a blessed trade entry at OPEN seems that AMI is reluctant to check the stop correctly intrabar,take values he wants..where he wants aahahah eheheheh, is incredible ..
 

trash

Well-Known Member
#17
Then prove it, depp, so that it can be resolved. So far there is just gibberish as in 99.9% of described cases. Send a project file and other details in proper English to T.J. Chances are you can't.
 
#18
Before leaving AmiBroker I kindly ask someone to tell me how to fix, AmiBroker 5.7 timeframe 15 minutes, open trade at close on 10am bar at 19425 and trailing immediately to 25 points, instead of going out correctly to 10:00:03 at 19400, It get 8 minutes ???

MFIBSP,20141031,09:59,19425.00,19425.00,19420.00,19425.00,6
MFIBSP,20141031,10:00,19420.00,19420.00,19420.00,19420.00,1
MFIBSP,20141031,10:00,19425.00,19425.00,19425.00,19425.00,1
MFIBSP,20141031,10:00,19420.00,19420.00,19420.00,19420.00,2
MFIBSP,20141031,10:00,19420.00,19420.00,19420.00,19420.00,6
MFIBSP,20141031,10:00,19415.00,19420.00,19415.00,19420.00,3
MFIBSP,20141031,10:00,19420.00,19420.00,19420.00,19420.00,1
MFIBSP,20141031,10:00,19415.00,19415.00,19415.00,19415.00,4
MFIBSP,20141031,10:00,19415.00,19415.00,19415.00,19415.00,2
MFIBSP,20141031,10:00,19405.00,19405.00,19400.00,19400.00,2 ???? why don't exit here in trailing ????
MFIBSP,20141031,10:00,19405.00,19405.00,19405.00,19405.00,1
MFIBSP,20141031,10:00,19410.00,19410.00,19410.00,19410.00,4
MFIBSP,20141031,10:00,19405.00,19405.00,19405.00,19405.00,2
MFIBSP,20141031,10:00,19410.00,19410.00,19410.00,19410.00,2
MFIBSP,20141031,10:00,19410.00,19410.00,19410.00,19410.00,1
MFIBSP,20141031,10:00,19410.00,19410.00,19410.00,19410.00,1
MFIBSP,20141031,10:00,19415.00,19415.00,19415.00,19415.00,1
MFIBSP,20141031,10:00,19410.00,19410.00,19410.00,19410.00,3
MFIBSP,20141031,10:00,19410.00,19410.00,19410.00,19410.00,2
MFIBSP,20141031,10:01,19415.00,19415.00,19415.00,19415.00,1
MFIBSP,20141031,10:01,19420.00,19420.00,19420.00,19420.00,3
MFIBSP,20141031,10:01,19420.00,19420.00,19420.00,19420.00,1
MFIBSP,20141031,10:01,19420.00,19420.00,19415.00,19415.00,2
MFIBSP,20141031,10:01,19415.00,19415.00,19415.00,19415.00,8
MFIBSP,20141031,10:01,19420.00,19420.00,19420.00,19420.00,2
MFIBSP,20141031,10:01,19420.00,19420.00,19420.00,19420.00,1
MFIBSP,20141031,10:01,19425.00,19425.00,19420.00,19420.00,5
MFIBSP,20141031,10:01,19425.00,19425.00,19425.00,19425.00,1
MFIBSP,20141031,10:02,19425.00,19425.00,19425.00,19425.00,1
MFIBSP,20141031,10:02,19430.00,19430.00,19430.00,19430.00,4
MFIBSP,20141031,10:02,19425.00,19430.00,19425.00,19430.00,2
MFIBSP,20141031,10:02,19435.00,19435.00,19435.00,19435.00,8
MFIBSP,20141031,10:02,19435.00,19435.00,19435.00,19435.00,1
MFIBSP,20141031,10:02,19440.00,19440.00,19440.00,19440.00,6
MFIBSP,20141031,10:02,19440.00,19440.00,19440.00,19440.00,3
MFIBSP,20141031,10:02,19445.00,19445.00,19445.00,19445.00,2
MFIBSP,20141031,10:02,19445.00,19445.00,19445.00,19445.00,1
MFIBSP,20141031,10:02,19435.00,19435.00,19435.00,19435.00,2
MFIBSP,20141031,10:02,19435.00,19435.00,19435.00,19435.00,2
MFIBSP,20141031,10:02,19440.00,19440.00,19440.00,19440.00,1
MFIBSP,20141031,10:02,19440.00,19440.00,19440.00,19440.00,2
MFIBSP,20141031,10:02,19435.00,19435.00,19435.00,19435.00,3
MFIBSP,20141031,10:02,19435.00,19435.00,19430.00,19430.00,5
MFIBSP,20141031,10:02,19430.00,19435.00,19430.00,19435.00,10
MFIBSP,20141031,10:02,19435.00,19435.00,19435.00,19435.00,1
MFIBSP,20141031,10:03,19440.00,19440.00,19440.00,19440.00,4
MFIBSP,20141031,10:03,19440.00,19440.00,19440.00,19440.00,10
MFIBSP,20141031,10:03,19440.00,19440.00,19440.00,19440.00,1
MFIBSP,20141031,10:03,19445.00,19445.00,19445.00,19445.00,1
MFIBSP,20141031,10:03,19450.00,19450.00,19450.00,19450.00,1
MFIBSP,20141031,10:03,19450.00,19450.00,19450.00,19450.00,1
MFIBSP,20141031,10:03,19445.00,19445.00,19445.00,19445.00,1
MFIBSP,20141031,10:03,19440.00,19440.00,19440.00,19440.00,2
MFIBSP,20141031,10:03,19445.00,19445.00,19445.00,19445.00,1
MFIBSP,20141031,10:03,19440.00,19440.00,19440.00,19440.00,2
MFIBSP,20141031,10:03,19445.00,19445.00,19445.00,19445.00,1
MFIBSP,20141031,10:03,19440.00,19440.00,19440.00,19440.00,1
MFIBSP,20141031,10:03,19435.00,19435.00,19435.00,19435.00,2
MFIBSP,20141031,10:03,19430.00,19430.00,19430.00,19430.00,1
MFIBSP,20141031,10:03,19425.00,19435.00,19425.00,19435.00,2
MFIBSP,20141031,10:03,19435.00,19435.00,19435.00,19435.00,1
MFIBSP,20141031,10:03,19430.00,19430.00,19430.00,19430.00,1
MFIBSP,20141031,10:04,19425.00,19425.00,19425.00,19425.00,2
MFIBSP,20141031,10:04,19425.00,19425.00,19425.00,19425.00,2
MFIBSP,20141031,10:04,19425.00,19425.00,19425.00,19425.00,1
MFIBSP,20141031,10:04,19425.00,19425.00,19425.00,19425.00,2
MFIBSP,20141031,10:04,19430.00,19430.00,19430.00,19430.00,3
MFIBSP,20141031,10:04,19425.00,19425.00,19425.00,19425.00,1
MFIBSP,20141031,10:04,19435.00,19435.00,19435.00,19435.00,2
MFIBSP,20141031,10:04,19435.00,19435.00,19435.00,19435.00,1
MFIBSP,20141031,10:04,19435.00,19435.00,19435.00,19435.00,3
MFIBSP,20141031,10:04,19435.00,19435.00,19435.00,19435.00,1
MFIBSP,20141031,10:05,19430.00,19430.00,19430.00,19430.00,3
MFIBSP,20141031,10:05,19435.00,19435.00,19435.00,19435.00,1
MFIBSP,20141031,10:05,19430.00,19430.00,19430.00,19430.00,1
MFIBSP,20141031,10:05,19435.00,19435.00,19435.00,19435.00,1
MFIBSP,20141031,10:05,19435.00,19435.00,19430.00,19430.00,7
MFIBSP,20141031,10:05,19425.00,19425.00,19425.00,19425.00,1
MFIBSP,20141031,10:05,19420.00,19425.00,19420.00,19425.00,9
MFIBSP,20141031,10:05,19430.00,19430.00,19430.00,19430.00,3
MFIBSP,20141031,10:06,19425.00,19425.00,19425.00,19425.00,1
MFIBSP,20141031,10:06,19425.00,19425.00,19425.00,19425.00,4
MFIBSP,20141031,10:06,19425.00,19425.00,19425.00,19425.00,1
MFIBSP,20141031,10:06,19425.00,19425.00,19425.00,19425.00,1
MFIBSP,20141031,10:06,19430.00,19430.00,19430.00,19430.00,2
MFIBSP,20141031,10:06,19430.00,19430.00,19430.00,19430.00,1
MFIBSP,20141031,10:06,19425.00,19425.00,19425.00,19425.00,1
MFIBSP,20141031,10:07,19435.00,19435.00,19435.00,19435.00,3
MFIBSP,20141031,10:07,19430.00,19430.00,19430.00,19430.00,1
MFIBSP,20141031,10:07,19435.00,19435.00,19435.00,19435.00,2
MFIBSP,20141031,10:07,19430.00,19430.00,19430.00,19430.00,1
MFIBSP,20141031,10:07,19430.00,19430.00,19430.00,19430.00,1
MFIBSP,20141031,10:07,19425.00,19425.00,19425.00,19425.00,1
MFIBSP,20141031,10:07,19425.00,19425.00,19425.00,19425.00,6
MFIBSP,20141031,10:08,19420.00,19420.00,19420.00,19420.00,1
MFIBSP,20141031,10:08,19425.00,19425.00,19425.00,19425.00,1
MFIBSP,20141031,10:08,19430.00,19430.00,19430.00,19430.00,1
MFIBSP,20141031,10:08,19430.00,19430.00,19430.00,19430.00,1
MFIBSP,20141031,10:08,19420.00,19420.00,19420.00,19420.00,2
MFIBSP,20141031,10:08,19415.00,19415.00,19415.00,19415.00,2
MFIBSP,20141031,10:08,19415.00,19415.00,19415.00,19415.00,1
MFIBSP,20141031,10:08,19420.00,19420.00,19420.00,19420.00,1
MFIBSP,20141031,10:08,19420.00,19420.00,19420.00,19420.00,1 exit here:confused::confused:
 

rmike

Well-Known Member
#19
@ashish1271
i want to code an afl that can use 1minute data to look inside the bar while backtesting on daily tf so that i can get a realistic picture of the performance of system. where the intrabar false siganal will also be considered in backtested result.
When running the backtest on daily tf (data considered by the process in ami would be the daily bar) it is not possible for the process to consider lower tf data from a higher tf.

For your desired analysis, the correct way to run the backtest would be to expand the required higher tf condition in the requisite lower tf and run the process. In your case you have to run the backtest on 1 min tf with the signal of the daily MACD.

Regards,

P.S - As Trash rightly remarked, read the help files. It's all there.
 

trash

Well-Known Member
#20
Before leaving AmiBroker I kindly ask someone to tell me how to fix, AmiBroker 5.7 timeframe 15 minutes, open trade at close on 10am bar at 19425 and trailing immediately to 25 points, instead of going out correctly to 10:00:03 at 19400, It get 8 minutes ???
Most probably because your code sucks (as it is the case most of the time).