AFL needed - difficult?

#1
Hi there,

Can anyone help me to programm the following rules in Amibroker?

I would like system to give only one signal a day. No more signals until end of day. Candles - 15 minutes. I presume it MUST be a loop but I have absolutely no idea how to code it.

Thanks in advance
 
#2
Hi there,

Can anyone help me to programm the following rules in Amibroker?

I would like system to give only one signal a day. No more signals until end of day. Candles - 15 minutes. I presume it MUST be a loop but I have absolutely no idea how to code it.

Thanks in advance

Hey, what's the condition for that single signal??? tht must be provided for coding...
regards
 

jagankris

Well-Known Member
#4
If the price is higher then HHV of one hour after market opens.
Prostitutos,

Can you explain in detail ?

AFL needed - difficult - is your heading.

If price is higher - Higher than what ?
1hr HHV - Highest value of the first one hour.

You want a buy signal if the price breaches the 1hr candle ?
Then where comes the 15 minutes candle TF ?

What if the price after crossing the high falls below ?

With out clear explanation of the rules you want no one can help.
 
#5
Prostitutos,

Can you explain in detail ?

AFL needed - difficult - is your heading.

If price is higher - Higher than what ?
1hr HHV - Highest value of the first one hour.

You want a buy signal if the price breaches the 1hr candle ?
Then where comes the 15 minutes candle TF ?

What if the price after crossing the high falls below ?

With out clear explanation of the rules you want no one can help.
Alright then.

It is very simple. The system checks HHV and LLV of the first one hour after market opening (let's say from 8.30 to 9.30 ). Then the Buy signal is given while next HIGH (means first high after first hour) is crossing HHV of first one hour (8.30-9.30). If the price after crossing the HHV falls below - it does not matter - the signal was given and the system has to live with that. With SELL signal is simlar - next LOW (after 8.30-89.30 period) crosses LLV of first hour.

In the real life, while fluctuation is really high, the system can give few signals, f.e. BUY then after 2 hours SELL, then after next time BUY again, etc. What I would like to have is the rule which allows the system to give only one (first) signal a day. After first signal system refuses all next signals until end of this day. The system works on 15minutes candles.

Hope it is more clear now?

Regards,
Marcin
 

ksesha

Active Member
#6
If this is exactly what you want, then do you really need an AFL?

Just check the price at 10.15AM( i.e. 1 hr after market opening, or 9.30AM in your example) and simply place two stop loss orders one for Buy, 1 tick above the high and another for Sell, 1 tick below the low and you are done.




Alright then.

It is very simple. The system checks HHV and LLV of the first one hour after market opening (let's say from 8.30 to 9.30 ). Then the Buy signal is given while next HIGH (means first high after first hour) is crossing HHV of first one hour (8.30-9.30). If the price after crossing the HHV falls below - it does not matter - the signal was given and the system has to live with that. With SELL signal is simlar - next LOW (after 8.30-89.30 period) crosses LLV of first hour.

In the real life, while fluctuation is really high, the system can give few signals, f.e. BUY then after 2 hours SELL, then after next time BUY again, etc. What I would like to have is the rule which allows the system to give only one (first) signal a day. After first signal system refuses all next signals until end of this day. The system works on 15minutes candles.

Hope it is more clear now?

Regards,
Marcin
 

jagankris

Well-Known Member
#7
Marcin,

Veluri has written a better post.Just check out for range trading.
Take the first hour candle.Draw the high and low.
Then move to the 5 minutes charts.

For long
-----------
Wait for the 5 minute candle to close above the high of the first one hour.
Then go long keeping the low of the 5 minutes bar as stop.

For Short
-----------
Wait for the 5 minute candle to close below the low of the first one hour.
Then go short keeping the low of the 5 minutes bar as stop.

No Trade
-----------
When price remains in a range between High and low.


Alright then.

It is very simple. The system checks HHV and LLV of the first one hour after market opening (let's say from 8.30 to 9.30 ). Then the Buy signal is given while next HIGH (means first high after first hour) is crossing HHV of first one hour (8.30-9.30). If the price after crossing the HHV falls below - it does not matter - the signal was given and the system has to live with that. With SELL signal is simlar - next LOW (after 8.30-89.30 period) crosses LLV of first hour.

In the real life, while fluctuation is really high, the system can give few signals, f.e. BUY then after 2 hours SELL, then after next time BUY again, etc. What I would like to have is the rule which allows the system to give only one (first) signal a day. After first signal system refuses all next signals until end of this day. The system works on 15minutes candles.

Hope it is more clear now?

Regards,
Marcin
 
#8
Thank you All for explanation. But the problem is I need to code it in Amibroker for backtesting. I can imagine it should be a sort of the loop but I absolutely have no idea how to code it.

Thanks, Marcin

Marcin,

Veluri has written a better post.Just check out for range trading.
Take the first hour candle.Draw the high and low.
Then move to the 5 minutes charts.

For long
-----------
Wait for the 5 minute candle to close above the high of the first one hour.
Then go long keeping the low of the 5 minutes bar as stop.

For Short
-----------
Wait for the 5 minute candle to close below the low of the first one hour.
Then go short keeping the low of the 5 minutes bar as stop.

No Trade
-----------
When price remains in a range between High and low.
 

Similar threads