[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 972

 

Help me write a muwings crossing.

MA1 = iMA(NULL,0,8,0,MODE_EMA,PRICE_OPEN,0);
MA2 = iMA(NULL,0,20,0,MODE_EMA,PRICE_OPEN,0);

if (MA1 > MA2)

will it work?

 
mirgha:

Help me write a muwings crossing.

MA1 = iMA(NULL,0,8,0,MODE_EMA,PRICE_OPEN,0);
MA2 = iMA(NULL,0,20,0,MODE_EMA,PRICE_OPEN,0);

if (MA1 > MA2)

will it work?


Type in the search bar at the top right: crossing of muwings
 
mirgha:

Help me write a muwings crossing.

MA1 = iMA(NULL,0,8,0,MODE_EMA,PRICE_OPEN,0);
MA2 = iMA(NULL,0,20,0,MODE_EMA,PRICE_OPEN,0);

if (MA1 > MA2)

will it work?

This way you will only check above... Below or equal you will not check.

The crossing needs to be checked on two bars. The 1st and 2nd bar.

On zero bar it is not desirable to check it, because it is not yet formed, which means that false triggers are possible.

Secondly, the prices need to be normalised for a correct comparison.

 

Hi all! Such a request: Show me an example of how to make an EA work on four and five-digit brokers and only on H4. Thank you very much in advance.

 
Maniac:

Hi all! Such a request: Show me an example of how to make an EA work on four and five-digit brokers and only on H4. Thank you very much in advance.


First operator after Start() insert

if (Period != 240) return(0);
 
Mislaid:


Insert the first statement after Start().

if (Period != 240) return(0);

Phew, that's not very nice.
 
artmedia70:

This way you will only check higher. Below or equal you won't check it.

The intersection has to be checked on two bars. The 1st and 2nd bar.

It is not advisable to check on the zero bar because it has not yet formed and therefore false positives are possible.

Second, the prices need to be normalized for correct comparison.


Thank you. I will continue to develop.
 
Hello, can you tell me if there is a program called TakeMySpread for changing the spread? It allows you to change the spread on the symbol for testing and optimization. Is there a programme that changes the level of a stop loss or a freeze frame, or how do I do it manually?
 
Hello! Please help. How to make an order open at the beginning of a candle, and when a new candle appears, it closes and a new one opens. If there is such an EA, please give me a link. I would like to use this as a reference. Thank you!
 

extern int Period_MA = 21;

bool Fact_Up = true;

bool Fact_Dn = true;

int start()

{
double MA;

MA=iMA(NULL,0,Period_MA,0,MODE_SMA,PRICE_CLOSE,0);
if (Bid > MA && Fact_Up == true)

{
Fact_Dn = true;

Fact_Up = false;

Alert("Price is above MA(",Period_MA,").");
}
if (Bid < MA && Fact_Dn == true)
{
Fact_Up = true;
Fact_Dn = false;
Alert("Price is below MA(",Period_MA,"). ");

}
return;
}

This is from the tutorial, I wanted to try it but I got stuck.

How do I get it to report on every tick?

help?

Reason: