[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 116

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
Guys, can you tell me why there might be an error about not being able to open an indicator in an EA?
This condition is met:
-List of parameters (if necessary). Transmitted parameters must match the order of declaration and type of external (extern) variables of the custom indicator.
You should check the name of the indicator. It could be
I would have to check the indicator name. I do not know what it may be.
I checked the name. It's OK. Figuring it out...
P.S. I set up a five-digit DC terminal, moved everything there, double-checked everything again, lots of code edits, no such error occurs anymore.
1. Open an order and assign the opening price value to the PriceBuy variable and display a message about it.
2. Open a new order with the same conditions when TakeProfit is reached.
Here is the program code:
extern double PriceBuy = 0;
extern bool Buy = true;
extern bool number = false;
int start()
{
if(Buy)
{
int ticket=OrderSend(Symbol(),OP_BUY,0.01,Ask,3,Bid-100*Point,Bid+100*Point);
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)
PriceBuy=OrderOpenPrice();
Alert("Buy Price = ",PriceBuy);
Buy = false;
number = true;}
if (Bid+100*Point<=PriceBuy && number)
{PriceBuy = 0;
number = false;
Buy=true;}
return;
}
Thanks in advance
O MQL programming gurus, help a newcomer solve a problem. The program doesn't work correctly, it doesn't do what it's supposed to do. Could you please tell me what is my error? The program needs to:
1. open an order and assign the open price value to the PriceBuy variable and display a message about it.
To open a new order with the same conditions when TakeProfit is reached.
Here is the program code:
extern double PriceBuy = 0;
extern bool Buy = true;
extern bool number = false;
int start()
{
if(Buy)
{
int ticket=OrderSend(Symbol(),OP_BUY,0.01,Ask,3,Ask-100*Point,Ask+100*Point);
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES))
PriceBuy=OrderOpenPrice();
Alert("Buy Price = ",PriceBuy);
Buy = false;
number = true;}
if(Bid+100*Point<=PriceBuy && number)
{PriceBuy = 0;
number = false;
Buy=true;}
return;
}
Thanks in advance
Bid>=PriceBuy+100*Point
I want to connect CreateNamedPipe() function from kernel32.dll. I need to prescribe flags of Dword type.
I'm doing it this way:
#define ACCESS_SYSTEM_SECURITY 0x01000000L
Naturally, the compiler swears at the L at the end. Would you tell me what to do?
I have to check the indicator name. It may be.
Yes, really, Victor, my mistake was that I tried to address it automatically... :-))) to the indicator via
... I have not found the "short" and "normal" names, when addressing to the indicator values through iCustom(), i.e. when they don't coincide, the indicator should be addressed only by its "normal" name.
Thank you.
Hello.
Please help me find an error.
The code is designed to close all positions when the price crosses the line drawn on the chart. Most of the time it does. But periodically there are 2 glitches: 1. Price crosses the line, but positions are not closed. 2. The line intersects the current price level (at an angle), but does not coincide with it (does not affect the current candle), while all positions are closed (which should not happen).
I thank you in advance.
Please help me find the error.
Withdrawing the question, I've figured it out.
I want to connect CreateNamedPipe() function from kernel32.dll. I need to prescribe flags of Dword type.
I'm doing it this way:
#define ACCESS_SYSTEM_SECURITY 0x01000000L
Naturally, the compiler swears at the L at the end. What do you suggest?
Remove the digit. There can only be 8 bits. MQL4 does not work with big ones.
You need to remove an extra zero. Try it like this: 0x1000000L
It doesn't work like this. Compiler gives error '0x1000000L' - invalid number
It does not work like that. The compiler generates the error '0x1000000L' - invalid number
Not thinking at all at night... :-)) There is no such number in the 16 bit system. It is an identifier of a constant type.
L should be removed:0x01000000