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
The NumberOfBarCloseLastPos() function.
This function returns the bar close number of the last position or -1. The selection of positions to be taken into account is defined by external parameters:
DeleteOrders() function. Tester version.
Function DeleteOrders() is designed to delete pending orders BuyLimit, BuyStop, SellLimit and SellStop. op - Type of trade operation, type of pending order. One of five values is possible: -1, OP_BUYLIMIT, OP_BUYSTOP, OP_SELLLIMIT or OP_SELLSTOP. The default value of -1 means any order.
mn - MagicNumber, identification number of the pending order. The default value -1 means any magik.
Hello. On page 10 this function has been set to be applied.
I have applied it in my Expert Advisor to delete the pending orders. Or rather, I wanted to use it. I placed the function outside the int start section
I pasted it in.
But when compiling, I get an error
'clDelete' - variable not defined C:\Program Files\MetaTrader - Alpari\experts\0005.mq4 (1155, 40)
How can I eliminate this error?
And when I use the ClosePositions() function - Closepositions at market price, everything is fine - no errors!
/ even if I just insert the DeleteOrders function and don't apply it yet - this error still compiles!
But when you compile it you get an error
'clDelete' - variable not defined C:\Program Files\MetaTrader - Alpari\experts\0005.mq4 (1155, 40)
How can I eliminate this error? What is this 'clDelete'?
There, on page 10 in the attachment is the file test_DeleteOrders.mq4
Download it and look for any clDelete references in it.
Downloaded it, watched it! So? Turns out all I had to do was set the colour of the closing icon!
But now it's not all right again. Now that error is gone. But another error has appeared - at the ClosePositions() function - which hasn't been there before.
ClosePosBySelect' - function is not defined C:\Program Files\MetaTrader - Alpari\experts\0005.mq4 (905, 47)
And there is no script nearby (p. 14) to check
Can you tell me how to fix this error?
ClosePosBySelect' - function is not defined C:\Program Files\MetaTrader - Alpari\experts\0005.mq4 (905, 47)
This error means that ClosePosBySelect() is not defined.
Can you tell me how to fix this error?
Sorry to bother you again! I put the ClosePositions() function you specified next to ClosePosBySelect(), and six errors appeared after compilation! I feel angry!
I've dealt with four of them myself. Slip, colour, number of close attempts....Two errors remain, -
sound files -
'UseSound' - variable not defined C:\Program Files\MetaTrader - Alpari\experts\0005.mq4 (1002, 13)
NameFileSound' - variable not defined C:³ Files\MetaTrader - Alpari\experts\0005.mq4 (1002, 33)
Where do I take it from? Where do I put them?
Well extern bool UseSound = false;//Switch off
I will put it in EXPERT'S PROPERTIES but what is NameFileSound' and where do I take it?
**************************************************************************
Found it and put it in global.
And then instead of one error, the compiler threw up 4 more:
'GetNameOP' - function is not defined
'ErrorDescription' - function is not defined
'else' - unexpected token
'GetNameOP' - function is not defined
These errors seem to keep coming up endlessly. To use one ClosePositions() function, I had to first create another one - ClosePosBySelect(). And the other in turn requires some sounds - bells and whistles. And when I'm struggling to find these totally unnecessary bells and bells, I get all kinds of strange errors -'else' - unexpected token and other errors. I haven't even started using this function yet. I've only set it among others!
Can you tell me how I can fix these errors? I commented out all these GetNameOP. The errors seem to be gone. But will the function work well without them?
And here instead of one error the compiler threw 4 more:
'GetNameOP' - function is not defined
On the first page in the attachment testrSetOrder.mq4
ErrorDescription' - function is not defined
In the code of your EA insert the following line
#include <stdlib.mqh>.
'else' - unexpected token
The NumberOfBarOpenLastPos() function.
This function returns the bar number of the last position opened or -1. The selection of positions to be taken into account is specified by external parameters: