Experts: Crossing of two iMA - page 6

 
Shara1:
Thanks, I'll try it tomorrow.
But don't forget that the indicator must be downloaded and compiled. And the indicator must be located in the data folder]\MQL5\Indicators\.
 
Good afternoon, is it possible to add the price type of moving averages to the customisable parameters of the Expert Advisor?
 
GRS:
Good afternoon, is it possible to add moving average price type to the customisable parameters of the Expert Advisor?

Meaning:

ENUM_APPLIED_PRICE

Identifier

Description

PRICE_CLOSE

Close price

PRICE_OPEN

Open price

PRICE_HIGH

Maximum price for the period

PRICE_LOW

Minimum price for the period

PRICE_MEDIAN

Median price, (high+low)/2

PRICE_TYPICAL

Typical price, (high+low+close)/3

PRICE_WEIGHTED

Weighted average price, (high+low+close+close)/4

?

 
Vladimir Karputov:

Meaning:

ENUM_APPLIED_PRICE

Identifier

Description

PRICE_CLOSE

Closing price

PRICE_OPEN

Open price

PRICE_HIGH

Maximum price for the period

PRICE_LOW

Minimum price for the period

PRICE_MEDIAN

Median price, (high+low)/2

PRICE_TYPICAL

Typical price, (high+low+close)/3

PRICE_WEIGHTED

Weighted average price, (high+low+close+close)/4

?

Yes, that's exactly what it is.

 

Hello Sir,


Many thanks for this great work Vladimir, you are amazing. I started coding and I hope to reach such a level in the near future.


Regarding the cross of 2 iMAs I would like to add a value to the value calculated for the iMAs.

Do you know how can I do that? 

For example if the moving average value is v=1000 I would like to code it such as it gives me v+2. 2 being the number of unit I would like to add to the price or value of the moving average.


Thanks much for your help. 

Once that is done I might try to set up a stop loss to the previous low/high. 


AD

 
Antoine Djondo :

***

For example if the moving average value is v=1000 I would like to code it such as it gives me v+2. 2 being the number of unit I would like to add to the price or value of the moving average.

***

I do not understand what the meaning is. Who is '1000', who is 'v + 2.2'?

 

Thank for your answer.

Sorry, let me clarify.


I would like to know if when the EA calculates the value of the iMA, I can set a parameter to add or deduct "x" to the value of the iMA.


I was thinking it has to with the handle of the indicator (handle_iMA_First) or the iCustom for the indicator. 

It would help me make my strategy more efficient because the EA takes some trades when the moving averages crosses but it's actually losing setups. 

For example on the screenshot you can see the EMA(8) value is lower than the SMA(18) so the EA took the sell but I want to be able to add the number 1 to the EMA(8) value of 33047.587 to increase it to 33048.587 and potentially prevent it from taking the sell.


thank you for your help.


Let me know if you want the whole quote.  

 

Using the code example Intersection 2 iMA Choosing Strategies - you need to enter the parameter ' Minimum Intersection height '.

Intersection 2 iMA Choosing Strategies
Intersection 2 iMA Choosing Strategies
  • www.mql5.com
Торговля на пересечении двух iMA (Moving Average, MA). Выбор из нескольких стратегий для открытия
 

Or here's some more code: iMA Minimum Intersection Height:

iMA Minimum Intersection Height

 

Thank you so much Vladimir, it's great, I added the code for the parameter minimum height intersection to the initial "Crossing of 2 iMAs" code.

The one without the intersection parameter is making more money on the same test period but the payoff per trade is less, so I'm trying to understand why the intersection one is not taking some trades...

I attached the mq5 files for each and the reports so you can check it out if you want.


The last thing I'm trying to do is to allow user to set the stop loss to the previous high (for sell) or previous low (for buy).

I'm thinking of using either iLow/iHigh or copyLow/CopyHigh. If you have any idea it would help me a lot, I think after that it will be ready.


Respect.


AD