Australian (ASX) Stock Market Forum

Amibroker - Simple Big Problem

Joined
19 July 2013
Posts
1
Reactions
0
Hey all!
I'm having problems with my new trade system and although it looks like a really simple thing, I canot find the answer. I've been looking through the internet for hours now and nothing...
All I want is something like this:
(1-minute candles, for example)
Buy=cross(close,ma(close,5));

But then I want the order not to go on this bar (which crossed the MA), I want it to go on the next bar AND I want the buy price to be the bar before the cross' close plus 0.50 (for example).
So it would be like this:
bar at 13:05:59 closes at 50.43
bar at 13:06:59 closes at 51.03 (this one crossing the MA)
Just after this closing, I want it to send an order to buy at 50.93 (50.43+0.50).
If the low at bar 13:07:59 is higher than 50.93 I wouldn't be able to enter the trade.

I tried:
buyprice=ref(close,-2)+0.50
Buy=cross(close,ma(close,5)) AND low<buyprice;

tried as well:
buyprice=ref(close,-2)+0.50
Buy=cross(close,ma(close,5)) AND low<buyprice;
entryprice=valuewhen(buy,buyprice)

But none worked. In both cases Amibroker gives me the bar at 13:07:59's close as the entry price. I don't want it to buy at close, open, high or low. I want it to buy at a specific price.

Is it possible? Please, can someone help me???
Thanks in advance!
 
Top