I gave your AFL a shot and I'm horrible at interpreting AFL most the time so not quite sure what you we're exactly doing but from my understanding of your goal, here's a simple snippet of entering on an gap up.
I'm not familiar with the use of GapUp() because from my reading of the function, it refers to it in days so not sure if it's intended for bars? Also I know from a previous experience that it is kind of a forward bias as it references the bars low and previous bars high so you need to have a entry delay if using it.
//Periodicity set to 15 minute in settings
UpGap = TimeFrameGetPrice("H",inDaily,-1) < ValueWhen(Day()!=Ref(Day(),-1),L);
// Second half of statement means low of first candle of day is greater then previous days high,
// could also use Open as a value so open of candle is greater then previous days high.
// identifies the high and low of the first candle of the day
HighOfFirstBar=valuewhen(day()!=ref(day(),-1),H);
LowOfFirstBar=valuewhen(day()!=ref(day(),-1),L);
TimeOfDayOkay= TimeNum() < 120000;// Event happens before noon
Buy = Cross(H,HighofFirstBar) AND TimeOfDayOkay AND UpGAP;
Sell = TimeNum() == 154459;//selling at closing
BuyPrice = Max(HighOfFirstBar,O);// entry price is high of first bar or open of current candle(which ever is higher)
SellPrice = Close;//sell price is close of last candle
I could be way off from your goal and this is just a snippet off a the GapUp side, if its on track you should be able to fill in the rest of your system.
Posted by: brandon.richard03@yahoo.com
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (3) |
This group is for the discussion between users only.
This is *NOT* technical support channel.
TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com
TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
EmoticonEmoticon