Close price breakout with EMA

If you need an Indicator or Signal developed or translated from other language, please post all Indicator development REQUESTS to this section here.

Moderator: admin

Close price breakout with EMA

Postby doanthedung » Wed Nov 23, 2016 9:42 pm

Hi Apprentice,

May you creat Alert breakout with condition below:

peak = ref(C,-2) if ref(C,-2) = max C during 5 day
trough = ref(c,-2) if ref(C,-2) = min C during 5 day
n=20

Alert when:
C cross peak and C >= EMA(n)
trough cross C and C <= EMA(n)

Thank you!
doanthedung
 
Posts: 23
Joined: Tue Jul 21, 2015 12:17 am


Re: Close price breakout with EMA

Postby doanthedung » Thu Nov 24, 2016 9:07 am

Thanks Apprentice, but when i use this indicator, its not right.
i describe condition like that:

peak, trough the same Fractal but replace H,L in Fractal by C.
use only one EMA.
alert buy when (C cross peak and C>EMA)
alert sell when (trough cross C and C<EMA)

In indicator you post, it have two EMA, and i dont know about "MA cross period" in tab "Caculation" how to use.

Can you repair it a bit?

Thanks you!
doanthedung
 
Posts: 23
Joined: Tue Jul 21, 2015 12:17 am

Re: Close price breakout with EMA

Postby Apprentice » Fri Nov 25, 2016 7:04 am

Try Close price breakout modification.lua
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36420
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Close price breakout with EMA

Postby doanthedung » Fri Nov 25, 2016 9:50 am

I think its still not right. Maybe i describle not clearly. So i write Amibroker code:

FractalUp = ValueWhen(Ref(C,-2)==HHV(C,5) ,Ref(C,-2) ,1);
FractalDown=ValueWhen(Ref(C,-2)==LLV(C,5), Ref(C,-2), 1);

Buy = Cross(C,fractalup) AND C>=EMA(C,20);
Sell = Cross(fractaldown,C) AND C<=EMA(C,20);

/*
ValueWhen(EXPRESSION, ARRAY, n = 1): Returns the value of the ARRAY when the EXPRESSION was true on the n -th most recent occurrence. Note: this function allows also 0 and negative values for n - this enables referencing future
HHV( ARRAY, periods ): example the formula "hhv( close, 4)" returns the highest closing price over the preceding four periods; "hhv( high, 8)" returns the highest high price over the preceding eight periods.
LLV( ARRAY, periods ): example the formula "LLV( close, 14 )" returns the lowest closing price over the preceding 14 periods.
*/

Can you repair the code again?

Many thanks!

Image
doanthedung
 
Posts: 23
Joined: Tue Jul 21, 2015 12:17 am

Re: Close price breakout with EMA

Postby Apprentice » Sat Nov 26, 2016 9:03 am

Try updated Close price breakout modification.lua
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36420
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Close price breakout with EMA

Postby doanthedung » Sun Nov 27, 2016 11:11 pm

Very nice!

I find the link you develope Fratal viewtopic.php?f=29&t=984&p=99069&hilit=fractal#p99069

Can you add condition:
Buy / Sell Alert when market (break through last Up / Down fractal and close>EMA/ close<EMA)

Add alert by email too.

Many thanks!
doanthedung
 
Posts: 23
Joined: Tue Jul 21, 2015 12:17 am

Re: Close price breakout with EMA

Postby Apprentice » Mon Nov 28, 2016 6:06 am

Your request is added to the development list, Under Id Number 3681
If someone is interested to do this task, please contact me.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36420
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Close price breakout with EMA

Postby Alexander.Gettinger » Thu Nov 16, 2017 1:52 pm

doanthedung wrote:Very nice!

I find the link you develope Fratal http://www.fxcodebase.com/code/viewtopi ... tal#p99069

Can you add condition:
Buy / Sell Alert when market (break through last Up / Down fractal and close>EMA/ close<EMA)

Add alert by email too.

Many thanks!


Please, try this signal indicator:
Close_Price_And_Fractal_Breakout.lua
(4.21 KiB) Downloaded 556 times
Alexander.Gettinger
FXCodeBase: Confirmed User
 
Posts: 3785
Joined: Wed Mar 31, 2010 9:40 pm
Location: Russia, Omsk


Return to Indicator and Signal Requests

Who is online

Users browsing this forum: No registered users and 11 guests