Indicators: MAM_Crossover

 

MAM_Crossover:

The Crossover Moving Average Mirror user, completed with Sound Alert.

Author: andy tjatur

 
Question:
How you can get the MA value if i=0? (are you looking into the future?)
--------------------------------------------------------------------------
for(i = 0; i <= limit; i++) {
   
.....
      
      E=iMA(NULL,0,20,0,MODE_SMA,PRICE_CLOSE,i-1);
      F=iMA(NULL,0,20,0,MODE_SMA,PRICE_OPEN,i-1);
---------------------------------------------------------------------------
 

I have often seen this type of coding, where the For loop begins with i=0 and then later we see i-1 in the body of the loop.

This appears to be an obvious error.

How can this code compile successfully, let alone execute.

 

dear val77 & michael b,

thanks for your concern, i use i-1 in to avoid bias indicator. I will be glad if you have an alternative to improve my crossover.

rgds

 

Thankyou very much! Is it an ordinary MA crossover or something else? and what values you are using. We can better use it if values and indicator is known.


 

Thankyou promono!

Can we add to this indicator that it only gives signal where the trend is. Like if I am trading 15m chart it gives me buy signal only in uptrend and sell signal only in downtrend. This indicator can be profitable if we can stay away from non trending markets, so can we add something that in choppy market it does not give signal. Please assist in improving.

Regards




 

I have also found that the sound alert is not working. Is anyone facing same problem?


Regards

Mayank Saini

 

Hi pramono,

Is this crossover indicator based on your MACD mirror. I put both the indicators on same chart to see whether they use same technique or not but buy/sell of both indicators are different.


Regards

Mayank Saini

 
repaints (i-1)
Reason: