Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 100
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
I don't understand where to put it and why it's not (-1)
there is an input parameter bool
void OnTick
{analysis of order opening, trailing stop}
void Trailing Stop
{corresponds to close conditions
if yes we cover all there is
}
I do not know what logics you have there. How do you expect me to guess what you have there?
by three points
1 extern point where we set whether we want to open the second or more orders
2) a condition where we have to open the first order
3) close order point
I can send you the code but it is the same for everyone
So why do you litter the thread if you do not need help?
You will not find useful messages in a thousand useless pages
P.S. Or is your goal to stuff your posts to the maximum?Then I ask for a diagram of the switch on these three points. Then I'll delete my posts if you consider it rubbish.
What is this point?
1 extern point where we set whether we want to open the second or more orders
2) a condition where we have to open the first order
3) point of order closing
Do you even know what you want?
You can't set an order in point 2, you can't close it, and it can only be deleted. In general, everything you have is somehow logically incoherent and vague, you need to be a deputy.
There is this part of the code:
ObjectCreate(0,nm,OBJ_TEXT,0,0,0);
ObjectSetString(0,nm,OBJPROP_PRICE, TIME(0)+Period()*60*3); // сдвиг вправо на 3 свечи
}
Question:Period() returns a sane value up to M30, from H1 a set of digits, and the marker can no longer be shifted in this way.
How to shift by N - candlesticks regardless of the period? I don't have to write a separate function, do I?
There is this part of the code:
ObjectCreate(0,nm,OBJ_TEXT,0,0,0);
ObjectSetString(0,nm,OBJPROP_PRICE, TIME(0)+Period()*60*3); // сдвиг вправо на 3 свечи
}
Question:Period() returns a sane value up to M30, from H1 a set of digits, and it's no longer possible to offset the mark in this way.
How to shift by N - candlesticks regardless of the period? I don't have to write a separate function, do I?
Thank you!
The question is: How correct is this entry, it is at the beginning of the program, while throughout the program a lot of Time[0] and Time[1] are used, and not to be called every time, it is written in a variable. There seems to be no errors outside the array, but everything is superficially defined:
//------------
void OnTimer()
ArraySetAsSeries(TM, true);
if(CopyTime(_Symbol, PERIOD_CURRENT, 0, 2, TM)==-1) return;
TIME0 = TM[0];
TIME1 = TM[1];
Thanks!
What is this point?
1 extern point where we set whether we want to open the second or more orders
2) a condition where we have to open the first order
3) point of order closing
Do you even know what you want?
You can't set an order in point 2, you can't close it, and it can only be deleted. In general, you are always somehow logically incoherent and vague, you need to be a deputy.
please. Here is the extern bool parameter OpenOrders=false;//+---open order
I need it to open orders, close them and then just hang on the chart without eating up resources
at the moment it is self-sawed (it works, but unacceptable for a panel element)
please. Here is the extern bool parameter OpenOrders=false;//+---open order
I need it to open an order, close it, and then just hang on the chart without eating up resources
at the moment it is self-sawed (it works, but unacceptable for a panel element)
I would have done so. Add "Disabled" to the code
P.S. Replace line 72 with "if(! Disabled) return;". I think the logic of the flag is clear.I would do the following. Add "Disabled" to the code.
P.S. Replace line 72 with "if(! Disabled) return;". I think the logic of the flag is clear.No, it's not clear. Going back to where we came from.
1) Disabled=true
initialize to true inite
pass to ontik if(!Disabled) return;
open close
Disabled=false; exit. Everything is fine.
2) Disabled=false
initialize ontik to true
pass to ontic if(!Disabled) return;
open close
Disabled=false; exit. Where do I open the next order? Some variant should allow this.
Now do you understand why I asked you to describe the logic?
I have an option of 2 EAs too.
No, I don't understand. Back to where we came from.
1) Disabled=true
Initialize in the inite to true
pass to ontik if(!Disabled) return;
open close
Disabled=false; exit. Everything is fine.
2) Disabled=false
initialize ontik to true
pass to ontic if(!Disabled) return;
open close
Disabled=false; exit. Where do I open the next order? Some variant should allow this.
Now do you understand why I asked you to describe the logic?
I have an option of 2 EAs too.