[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 159
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
1) And how do you make it disabled, through external variables?
2) Can I set it in such a way that the first order opened is closed upon opening, and the subsequent orders 2, 3, etc. are not closed? Suppose I open a Buy order - this is the first order, then I open another Buy order - the second one, etc. and then out of this series of orders only the 1st order would be closed by СorderClose ?
Check the address pages at https://www.mql5.com/ru/forum/105913
1) Approximately like this -
2)
Remove the lock ( // ) before
// return(0); // exit
and then only the first(or last) position would be closed.
Hello, everyone ))))
Help.
I just started to program mql4.
Writing an Expert Advisor.
How to do this.
I want my Expert Advisor to work only on Mondays.
>> thank you!
Thank you, Vinin =)
Look through the 'Closing Positions. On indicator signal'.
1) Approximately like this -
2)
Remove the blocking ( // ) before
// return(0); // exit
and then only the first positions will be closed.
Thanks, rid!
You helped me a lot, there are still kind people)
Got it all, I'll go read the math, I hope I didn't take up too much of your time)
Please help.
If during the visual testing of the EA 1.mq4 (attached) I put on a chart the indicator 3-cci-h3 (attached), then, as it would seem, with exactly the same parameters of calculated cci signals of the indicator and the actual cci (object text in the upper right corner) do not coincide.
WHY?
Why is it that alerts don't work in this indicator?
Expert Advisor code:
Indicator code:
like this for bystop:
And how do you set the pending from open position itself?
How do you place the pending order itself?
First, you need to determine the opening price of the last open position programmatically.
For that, you can use a pre-defined function, e.g.
Function PriceOpenLastPos().
This function returns the open price of the last position opened. The selection of positions to be considered is specified by external parameters:
sy - Name of market instrument. If this parameter is set, the function will consider only positions of the specified instrument. The default value - "" means any market instrument. NULL value means the current instrument.
op - Trade operation, position type. Valid values: OP_BUY, OP_SELL or -1. The default value -1 means any position.
mn - Position identifier, MagicNumber. The default value of -1 means any identifier.
'Useful functions from KimIV
//-------
Insert the function itself at the very end of your code.
And you call it in the START function and set the opening price of the last position you need (buy or sell), for example.
double OpenPrice=PriceOpenLastPos(NULL,OP_BUY, MAGIC) ;
First you must determine the price of the last open position programmatically.
To do this, you can use a pre-defined function, e.g.
Function PriceOpenLastPos().
This function returns the opening price of the last position opened. Selection of positions to be considered is defined by external parameters:
sy - Name of market instrument. If this parameter is set, the function will only consider positions of this instrument. The default value - "" means any market instrument. NULL value means the current instrument.
op - Trade operation, position type. Valid values: OP_BUY, OP_SELL or -1. The default value -1 means any position.
mn - Position identifier, MagicNumber. The default value of -1 means any identifier.
'Useful functions from KimIV
//-------
Insert the function itself at the very end of your code.
In the START function, you call it and set the opening price of the last position you want (buy or sell), e.g.
double OpenPrice=PriceOpenLastPos(NULL,OP_BUY, MAGIC) ;
Thank you very much!))
In Indicator, if a condition is met, I want to enter a line with a note in a text file (no matter what, let's say date and time).
The file is created and the line is added, but only in real time. I, on the other hand, want to make a note when working on history. Does anyone know how to do this?
Thank you!