[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 923

 
_SS_:
tried it, it doesn't work!
Remove the semicolon in function declaration.

You have int First();

You need int First()

{

//-------- Function body ----------

return (0);

}

 

Where does the above need to be described?

error

 
_SS_:

Where does the above need to be described?

error

After adding a function to start(), there will be no warning
 
_SS_:

Where should the above be described?

error

You don't need to describe it anywhere. It is not an error, but a warning that the function is not used anywhere in the EA and it can be removed.

After First(); function is called in the EA body, there will be no more such a warning.

 
Thank you friends!
 
Is there the smallest code that determines where the price is, above Moving or below it?
 
vlandex:
Is there the smallest code that determines where the price is, above Moving or below it?

double MA1=iMA(Symbol(), Period(), PeriodMA, 0, MODE_SMA, PRICE_CLOSE, 1);

double pa=MarketInfo(Symbol(), MODE_ASK);

double pb=MarketInfo(Symbol(), MODE_BID);

int pt=MarketInfo(Symbol(), MODE_POINT);

int dg=MarketInfo(Symbol(), MODE_DIGITS);

---------------------------------------- Для Buy -------------------------------------------------

if(NormalizeDouble(pa, dg)>NormalizeDouble(MA1, dg)) {Price is higher than MA1}

if (NormalizeDouble(pa, dg)<NormalizeDouble(MA1, dg)) {Price is lower than MA1}

else if (NormalizeDouble(pa, dg)==NormalizeDouble(MA1, dg)) {Price is equal to MA1}

----------------------------------------------------------------------------------------------------

---------------------------------------- Для Sell ------------------------------------------------

if (NormalizeDouble(pb, dg)>NormalizeDouble(MA1, dg)) {Price is higher than MA1}

if (NormalizeDouble(pb, dg)<NormalizeDouble(MA1, dg)) {Price is lower than MA1}

else if (NormalizeDouble(pb, dg)==NormalizeDouble(MA1, dg)) {Price is equal to MA1}

----------------------------------------------------------------------------------------------------

The simplest one is first class middle school maths

 
artmedia70:

double MA1=iMA(Symbol(), Period(), PeriodMA, 0, MODE_SMA, PRICE_CLOSE, 1);

double pa=MarketInfo(Symbol(), MODE_ASK);

double pb=MarketInfo(Symbol(), MODE_BID);

int pt=MarketInfo(Symbol(), MODE_POINT);

int dg=MarketInfo(Symbol(), MODE_DIGITS);

---------------------------------------- Для Buy -------------------------------------------------

if (NormalizeDouble(pa, dg)>NormalizeDouble(MA1, dg)) {Price is higher than MA1}

if (NormalizeDouble(pa, dg)<NormalizeDouble(MA1, dg)) {Price is lower than MA1}

else if (NormalizeDouble(pa, dg)==NormalizeDouble(MA1, dg)) {Price is equal to MA1}

----------------------------------------------------------------------------------------------------

---------------------------------------- Для Sell ------------------------------------------------

if (NormalizeDouble(pb, dg)>NormalizeDouble(MA1, dg)) {Price is higher than MA1}

if (NormalizeDouble(pb, dg)<NormalizeDouble(MA1, dg)) {Price is lower than MA1}

else if (NormalizeDouble(pb, dg)==NormalizeDouble(MA1, dg)) {Price is equal to MA1}

----------------------------------------------------------------------------------------------------

The simplest one is first grade maths in high school


Artem. And if you think about it
 
Vinin:

Artem. And if you think about it...

Hello, Victor. You know, I've got my mind on a specific order. The first thing that popped into my head is what I wrote. I'm not the one who has to think further. The main thing is to set the direction of thought... :)

Just correct it, so that a man doesn't get lost... :)

 

Right... It would be more correct to compare the difference in these values, but we'll leave that to the questioner... :)

The main thing - the direction of thought is given...