MA Price Cross Touch Strategy.Avignon

Strategies are published here.

Moderator: admin

MA Price Cross Touch Strategy.Avignon

Postby Apprentice » Tue Nov 06, 2018 7:11 am

1.png

2.png

Opening and close the trade when the price touches or crosses the shortest moving average
but only if the longest moving average confirms the trend.
MA Price Cross Touch Strategy.Avignon.lua
(27.2 KiB) Downloaded 779 times
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: MA Price Cross Touch Strategy.Avignon

Postby Avignon » Tue Nov 06, 2018 12:21 pm

The closing of the trade was not done.

Capture du 2018-11-06 15-47-31.png
Avignon
FXCodeBase: Graduate
 
Posts: 287
Joined: Mon Nov 17, 2014 3:54 am

Re: MA Price Cross Touch Strategy.Avignon

Postby Avignon » Tue Nov 06, 2018 1:21 pm

Or it's a bug, or there must be something to optimize under the conditions in lines of code because it worked.

Capture du 2018-11-06 17-14-57.png
Avignon
FXCodeBase: Graduate
 
Posts: 287
Joined: Mon Nov 17, 2014 3:54 am

Re: MA Price Cross Touch Strategy.Avignon

Postby Jyuken » Wed Jan 23, 2019 8:52 am

Hey apprentice !

Thank you so much for this strategy, I love it and have some good result with it. However I though about a way to improve it and saw some flaws in the positions taken sometimes.

For example here :
the first position was good : buying when short MA > long MA and price cross from the bottom the short MA
the second position was good : selling when short MA < long MA and price cross from the top the short MA
However the third one bothers me : buying because price cross short MA from the bottom despite of the fact that long MA > short MA

So maybe I misunderstood but what do you mean by "if the longest moving average confirms the trend" ?

Moreover I thought about a filter that would improve this strategy : if there is less than n pips separating the two moving average then we do not open a trade. Would it be possible to add that to this strategy ?

Thank you so much for your work, have a wonderful day !
Attachments
probleme strat.PNG
Example illustrated
Jyuken
 
Posts: 1
Joined: Wed Jan 23, 2019 8:30 am

Re: MA Price Cross Touch Strategy.Avignon

Postby faboris » Mon Jul 26, 2021 4:25 am

Hi All,

When the cross strategy is sending a BUY/SELL signal, is it possible to code another condition as below :

- When it is a BUY, price is closed above the MA. Wait the next candle and the next candle closing price has to be above the MA as well. If the closing price of the next candle is below the MA, it is not a BUY

- Same strategy for a SELL Signal

Many thanks

Boris
Attachments
Capture10.PNG
faboris
 
Posts: 7
Joined: Thu Jul 15, 2021 2:30 am

Re: MA Price Cross Touch Strategy.Avignon

Postby Apprentice » Tue Jul 27, 2021 2:58 am

Your request is added to the development list.
Development reference 683.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia


Re: MA Price Cross Touch Strategy.Avignon

Postby faboris » Fri Jul 30, 2021 9:06 am

That's great. Many Thanks

Can I ask you 1 last request ?

The signal is great but the price is not. Is it possible to code as the example below (in RED)

-When the buy signal is confirmed, the price entry should be at the low level of the Period-1
-Same logic for a SELL Signal

Thanks in advance

Boris
Attachments
Capture.PNG
faboris
 
Posts: 7
Joined: Thu Jul 15, 2021 2:30 am

Re: MA Price Cross Touch Strategy.Avignon

Postby Apprentice » Fri Jul 30, 2021 2:14 pm

Your request is added to the development list.
Development reference 705.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia


Next

Return to Custom Strategies

Who is online

Users browsing this forum: Majestic-12 [Bot] and 21 guests