AmiBroker for manual backtesting

#1
Hallo everybody,
I'm new AmiBroker user, and I would like to do manual backtesting,
to verify some trading ideas
(you know, initially I prefer to test idea only virtually, to avoid money losses...)

Note: I'm NOT interested to simulate Automatic/Script Trading,
but only manual Buy/Sell order

Now, I've seen the menu Tools / Bar Replay
which allow to repeat the past price candlestick graphs evolution

OK

but now, to make simulation, I need a command to apply the virtual Buy/Sell manual orders on past prices,
and to resume the simulation results

I've seen the menu File / New / Account, but it doesn't allow to simulate trading on past dates

Do you know how to proceed ?
It is necessary to use an external tool, or does AmiBroker have all the necessary stuff?


Any suggestion is welcome :)

Thanks

Best Regards

Roby
 
#2
Hi,

You have to first add some code (logic) to your chart so that whenever that conditions occurs (is true) on any candle, AmiBroker will show you Buy/Sell signals. To illustrate, add this simple EMA cross code to your chart. To add the code below, simply right click on chart>>Edit Formula and paste code below at the end of your chart.


_SECTION_BEGIN("Sample Trading System");
Buy = Cross(EMA(C,5), EMA(C,12));
Sell = Cross(EMA(C,12),EMA(C,5));

Buy = ExRem(Buy,Sell);
Sell= ExRem(Sell,Buy);

Filter = Buy or Sell;
AddColumn(C, "Possible Candidate for Buy/Sell");

PlotShapes(IIf(Buy,shapeUpArrow,shapeNone), colorBrightGreen, 0, Low, Offset=-15);
PlotShapes(IIf(Sell, shapeDownArrow,shapeNone), colorRed, 0, High, Offset=-15);
_SECTION_END();

Now you can also backtest this code from Analysis>>Automatic Analysis in AmiBroker on any / many symbols at once.

Important Note : This is a sample trading system to show you how things work in AmiBroker - DO NOT trade on the signals shown.

Hope this helps,

Thanks,
CA



Hallo everybody,
I'm new AmiBroker user, and I would like to do manual backtesting,
to verify some trading ideas
(you know, initially I prefer to test idea only virtually, to avoid money losses...)

Note: I'm NOT interested to simulate Automatic/Script Trading,
but only manual Buy/Sell order

Now, I've seen the menu Tools / Bar Replay
which allow to repeat the past price candlestick graphs evolution

OK

but now, to make simulation, I need a command to apply the virtual Buy/Sell manual orders on past prices,
and to resume the simulation results

I've seen the menu File / New / Account, but it doesn't allow to simulate trading on past dates

Do you know how to proceed ?
It is necessary to use an external tool, or does AmiBroker have all the necessary stuff?


Any suggestion is welcome :)

Thanks

Best Regards

Roby
 
#3
Hi,

You have to first add some code (logic) to your chart so that whenever that conditions occurs (is true) on any candle, AmiBroker will show you Buy/Sell signals. To illustrate, add this simple EMA cross code to your chart. To add the code below, simply right click on chart>>Edit Formula and paste code below at the end of your chart.


_SECTION_BEGIN("Sample Trading System");
Buy = Cross(EMA(C,5), EMA(C,12));
Sell = Cross(EMA(C,12),EMA(C,5));

Buy = ExRem(Buy,Sell);
Sell= ExRem(Sell,Buy);

Filter = Buy or Sell;
AddColumn(C, "Possible Candidate for Buy/Sell");

PlotShapes(IIf(Buy,shapeUpArrow,shapeNone), colorBrightGreen, 0, Low, Offset=-15);
PlotShapes(IIf(Sell, shapeDownArrow,shapeNone), colorRed, 0, High, Offset=-15);
_SECTION_END();

Now you can also backtest this code from Analysis>>Automatic Analysis in AmiBroker on any / many symbols at once.

Important Note : This is a sample trading system to show you how things work in AmiBroker - DO NOT trade on the signals shown.

Hope this helps,

Thanks,
CA


Many Thanks ChartAnalyst for suggestion !

so I have to code my trading ideas, in order to be able to back-test them

unfortunately I am not very skilled with AFL shynthax,
but anyway I will start learning from your useful example


Best Regards

Roby
 
#4
dear senior members,
i am trying wright afl for algorithimic trading with a foloing conitions:-
Buy=Cross( EMA(C,12), EMA(C,66));
Sell=Cross( EMA(C,66), EMA(C,12));
cover=Cross( EMA(C,13), EMA(C,60));
short =Cross( EMA(C,60), EMA(C,13));
but main probelum is that i want when
a. buy 10 quantitiy then sell 20 so that i am going to shrot side.
b. sell 10 quantitiy then buy 20 so that i am going to long side.
due to this we enjoy both side of trade profit.
so kindely reques to all please help me for wright this condition.
buy 10 then short 20 balance -10
cover 20 then sell 20 balance +10
thank you
with regards




Hallo everybody,
I'm new AmiBroker user, and I would like to do manual backtesting,
to verify some trading ideas
(you know, initially I prefer to test idea only virtually, to avoid money losses...)

Note: I'm NOT interested to simulate Automatic/Script Trading,
but only manual Buy/Sell order

Now, I've seen the menu Tools / Bar Replay
which allow to repeat the past price candlestick graphs evolution

OK

but now, to make simulation, I need a command to apply the virtual Buy/Sell manual orders on past prices,
and to resume the simulation results

I've seen the menu File / New / Account, but it doesn't allow to simulate trading on past dates

Do you know how to proceed ?
It is necessary to use an external tool, or does AmiBroker have all the necessary stuff?


Any suggestion is welcome :)

Thanks

Best Regards

Roby
 

Similar threads