Questions from Beginners MQL5 MT5 MetaTrader 5 - page 905
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
if(iTime(NULL,PERIOD_D1,i+1)!=iTime(NULL,PERIOD_D1,i)&& how do I write this? )
You need to extract date from time[i] and compare it with time[i+1]. If they are not equal, then extract time from time[i] and compare with given time. If they are the same, put in a line.
How all this is extracted - I have shown in the script. All that remains is to think about it.
You need to extract the date from time[i] and compare it with time[i+1]. If not equal, extract the time from time[i] and compare it with the given time. If they are the same, draw a line.
How it's all extracted - I've shown in the script. All that's left to do is think about it.
Friday night, thinking badly) Nothing builds. Why?
then extract the time from time[i] and compare it with the set time.
Probably time[i+1], I need to put the line to the previous day after the close of the day.
Hello.
Stupid question but still, please help)
I entered a trade at some price, I always long) And I compare the price of the trade with the current bid, if we increased by 0.5% I close.Cursed at bid(((
I entered a trade at some price, I am always longing)And I compare the price of the trade with the current bid, if we went up by 0.5% I close.It swears at bid(((
Probably because this is MQL5. There is no "bid" here butSymbolInfoDouble(_Symbol, SYMBOL_BID)
Hello.
Stupid question but still, please help)
I entered the trade at some price, I always long) And I compare the price of the trade with the current bid, if we rose by 0.5% I close.It swears at bid(((
You're right to swear. There is no such array with Bid prices in MQL5.
Replace it with
m_symbol.Bid()
and before the cycle do not forget to update the prices:
And he is right to swear. There is no such array with Bid prices in MQL5.
Replace it with
and before the loop do not forget to update the prices:
I have done it in two different ways:
1) Expert Advisor works, but unfortunately it does not give me the idea. It is simple, I buy when the previous candle closed below and the next one closed above. And I close only if the price rose by 0.5%.
It makes strange deals(((
2) My method is as follows:
I think I messed up(((.
It generates an error:
Did it in two different ways:
1) The Expert Advisor works, but unfortunately it does not implement the idea. It is simple, I buy when the previous candle closed lower and the next one closed higher. And I close only if the price went up 0.5%.
It makes strange deals(((
2) My method is as follows:
I think I messed up(((.
It gives out an error:
Open any of my code and there you will see both m_symbol and RefreshRates.
Open any of my code and you will see both m_symbol and RefreshRates there.
Thank you. I've read it and done it.
Now I can't figure out why the algorithm doesn't work.
What happens is the following: the purchase is made under the condition
1) If the condition is fulfilled;
2) I check whether there is already an open position, if there is, I go to point 3), if not, I open a 2*)
3) If the position is buy, and the condition is fulfilled that the price has increased by 10% from the entry price, then I close it.
In the test, the following happens, position opens and closes, not on conditions (( Again, please help!
Thank you. I've done the reading.
Now I can't figure out why the algorithm doesn't work.
What happens is the following: the purchase is made under the condition
1) If the condition is fulfilled;
2) I check whether there is already an open position, if there is, I go to point 3), if not, I open a 2*)
3) If the position is buy, and the condition is fulfilled that the price has increased by 10% from the entry price, then I close it.
When testing the following happens, position opens and closes, not on conditions (( Again, please help!
I propose the following algorithm:
Pay attention to m_Position.PriceOpen()