Questions from Beginners MQL4 MT4 MetaTrader 4 - page 140

 
Andrii Djola:

here's

Thanks, I think I've got it.

 
enum Colour // Flag colour
{
Red,
Green
};

Colour Flag=Red;

void start()
{
if(!Alarm())Flag=Green;

if(Alarm()>0 && Flag==Green)
{
OrderSend(Purchase...);
Flag=Red;
}

if(Signal()<0 && Flag==Green)
{
OrderSend(Sell...);
Flag=Red;
}
}

int Signal()// Buy and Sell signals
{
return WhatNeed;
}
 

if(!Signal())Flag=Green; it is not clear here if the signal function ! has no signal then the flag is assigned green . this is a flush .

if(Signal()>0 && Flag==Green) and it is not clear if the signal is greater than zero . if ma> mf1 then z=1; whether .

 
Лауреат:

if(!Signal())Flag=Green; it is not clear here if the signal function ! has no signal then the flag is assigned green . this is a flush .

if(Signal()>0 && Flag==Green) and it is not clear if the signal is greater than zero . if ma> mf1 then z=1; whether .

The Signal() function is supposed to have 3 values: -1 Sell, +1 Buy, 0 Wait. If there is no signal, we raise the green flag and then the next signal will enter the bazaar. When there is a signal (+1 or -1) we enter the market and raise the red flag. On the next tick in the presence of the signal entry is forbidden, which is what we wanted. When the signal is zeroed, we raise the green flag and then at the next signal will be entrance into the market. Any indicators or calculation formula can be inserted inside the Signal() function. This is a universal modular approach of designing EAs, robots, assistants, ...
 
e33:
The Signal() function is supposed to have 3 values: -1 Sell, +1 Buy, 0 Wait. If there is no signal, we raise the green flag and the next signal will cause entry into the bazaar. When there is a signal (+1 or -1) we enter the market and raise the red flag. On the next tick in the presence of the signal entry is forbidden, which is what we wanted. When the signal is zeroed, we raise the green flag and then at the next signal will be entrance into the market. Any indicators or calculation formula can be inserted inside the Signal() function. This is a universal modular approach of designing EAs, robots, assistants, ...

}

int Signal()// Buy and sell signals
{
return WhatNeed;
}

and in the return return WhatNado; what to write respectful please advise ?

 
Лауреат:

}

int Signal()// Buy and sell signals
{
return WhatNeed;
}

and in the return return WhatNado; what to write dear please advise ?

It depends on the strategy used. If a trend strategy, then when the trend is less than the set value, it is zero. If a counter-trend strategy, we catch the reversal. There are also Elliott waves. Start with one MA, then 2 MAs, then ... There's a lot of them: Gator, Alligator, Coloured МА...
 
Лауреат:

if(!Signal())Flag=Green; it is not clear here if the signal function ! has no signal then the flag is assigned green . it is a flush .

if(Signal()>0 && Flag==Green) but it is not clear at all if the signal is greater than zero. if ma> mf1 then z=1; whether .

is a flush - what does it mean? There is a flash drive for writing information, but I don't think it's about that. I found it on the Internet, but it doesn't have a soft sign on it:

But "flash" is obviously not a Russian word. It's too short, hissy and generally unusual. Besides, it has multiple meanings, which is typical for English words. Today we will analyze its main meanings, learn how "flash" is translated and what word-formation potential it has. Where it all began. The energetic, impetuous sound of the English word flash fits very well with its meanings "flash, moment".

Flash. Fleches (French: fleche, meaning "arrow"), ancient (before the early 20th century) field fortifications, less often long-term fortifications of the redan type, made of two facades, 20 to 30 metres long each, which formed a blunt corner turned towards the enemy.

 
e33:

Flash - what does that mean? There is a flash drive for writing information, but I don't think that's what it means here. I found it on the Internet, but it doesn't have an ellipsis:

But "flash" is clearly not a Russian word. It's too short, hissy and generally unusual. Besides, it has multiple meanings, which is typical for English words. Today we will analyze its main meanings, learn how "flash" is translated and what word-formation potential it has. Where it all began. The energetic, impetuous sound of the English word flash fits very well with its meanings "flash, moment".

Flash. Fleches (French: fleche, meaning 'arrow'), ancient (before the early 20th century), fortifications of the redan type, usually made of two 20-30 m long fascias each, which formed a blunt corner turned towards the enemy.

The flush is a lie. I see. Thank you.

 
Is there any function to calculate the lot....

I.e. if I started trading with $1.000 account with 0.01 lot then when my account is $2.000 the lot will change to 0.02 and so on ???

I have it like this now:
HTML code:
LOT = 0.01; if(AccounBalance() > 2000) { LOT = 0.02; } if(AccounBalance() > 3000) { LOT = 0.03; }
 
sviter-pro:
Is there any function to calculate the lot....

I.e. if I started to trade with 1.000$ account with 0.01 lot, then when my account is 2.000$, then the lot will change to 0.02 and so on ?

This is how I do it:
HTML code:

different methods of lot calculation exist, have a look at codobase

they usually use either a fixed lot or % of the deposit

in your case it is 1/100 000 part of the deposit: LOT = AccountBalance()/100 000

but you need to normalise the order volume, here's an example:https://www.mql5.com/ru/forum/131859/page8#comment_3359730

Только "Полезные функции от KimIV".
Только "Полезные функции от KimIV".
  • 2011.02.18
  • www.mql5.com
Все функции взяты из этой ветки - http://forum.mql4...
Reason: