I am trying to develop a simple strategy with the view of further modifying the code as I move forward. But it is becoming very frustrating learning this Amibroker programming.

Firstly, I would like to seek some advice on how I can learn this with some structure ? I know some kind of a library exists, but I am struggling.

At least I am hoping to learn by asking questions around.

Basically the strategy is simple.

If a bullish inside bar is formed, I want to go long on the break of that bar high with a stoploss at the low of the bullish inside bar. Profit target is the same distance as the stoploss distance from the entry point.

I don't have problem using codes such as..

cond1 = ref(h,-1) > h;
cond2 = ref(l,-1) < l;
cond3 = c-o>0;
// which i am guessing defines a bullish inside bar.

I know the buy signal could be

buy = cond1 and cond2 and cond3;

but I am not entirely sure from here how I can define - buy at the break of high in the next bar.

And also, I understand I have to use a variation of ApplyStop function to define the stoploss and profit target.


If you can spare some more time, I would also be interested to know how I can define setting to trade only x% of capital. I managed to import my own fx data but have no idea setting up the tick value, etc ? So it seems all my back testing is done by entering 100% of capital each time :horror;

Thank you.