Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 743

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
solnce600:
Please tell me which function returns the following value.
If an order has closed on the SL - do not return the whole time of closing the order on the SL, but only the minutes of closing the order on the SL.
For example, the order closed by the SL at 12:00 AM. I need the function to return only00 (i.e. only the minutes)
//--------------------------------------------------------------------------------------------------------------------------------------------------------So, how do we understand the example in the workbook?
datetime Alfa = D'2004.01.01 00:00';
You said after '=' there should be a set of digits representing the number of seconds since01.01.1970 - 01.01.2004.
or
it is the same, but in the left hand :-))
or
I cannot find the command that defines the maximum number of market orders which can be opened. Who knows, please tell me
ACCOUNT_LIMIT_ORDERS
Maximum allowed number of active pending orders
No market orders, but opening of market orders can be limited
ACCOUNT_MARGIN
Amount of reserved margin for the account in the deposit currency
double
ACCOUNT_FREEMARGIN
Size of free funds in the account in the currency of the deposit, available for the order opening
double
ACCOUNT_MARGIN_LEVEL
Account margin level in percent
double
or
it's all the same, only as if in the left hand:-)))
or
Guys, please advise me on 2 lines of code.
I am writing owl on stochastic, parameter of divergence of signal line and main line is set, on one bar the indicator makes several moves in and out of trading area, it turns out that on one bar several orders are opened and immediately closed. How may I fix it?
One year ago I was told "To compare the open time of a signal bar and the zero bar, when the time of the zero bar becomes longer, you can act". I still do not understand how to do it with code. The topic is for newbies.
Guys, please advise me on 2 lines of code.
I am writing owl on stochastic, parameter of divergence of signal line and main line is set, on one bar the indicator makes several moves in and out of trading area, it turns out that on one bar several orders are opened and immediately closed. How may I fix it?
One year ago I was told "To compare the open time of a signal bar and the zero bar, when the time of the zero bar becomes longer, you can act". I still do not understand how to do it with code. The theme is for newbies.
The easiest way is not to trade on the indicator data from the zero bar, but to take data from the first bar, which is already closed. And you should trade on the open bar only.
There are also several ways to limit the trade within the bar, if you trade tickwise, for example:
1. Compare the price at which you are going to open with the price of already existing positions if it is closer than X pips (Bid<=OrderOpenPrice()+X*_Point (or Ask>=OrderOpenPrice()-X*_Point), where OrderOpenPrice() is the opening price of the latest market order at the symbol) - prohibit opening.
2. Compare the current time before sending the order to the server with the time of opening already existing positions, if the time within the same bar (TimeCurrent()<=OrderOpenTime()+PeriodSeconds(), where OrderOpenTime() - disable opening.
Please advise.... I don't have enough brains of my own yet.
I am testing my idea on TF5
Model: based on open prices.
Only 1 order may be open.
Orders open on any candlestick with minute value only - 00
THE PROBLEM
In some cases on a candlestick with a minute value of 00 at the same time and at the same price
- order 1 closes on a SL
- order N2 opens
My idea is not to close on a SL and open the next order at the same time.
Q: .
How should I make it so that if order N1 is closed by a SL, order N2 is not opened at the same time as order N1, but at the next nearest candlestick with the value of minutes - 00
Here is my code.
int start()
{
int ot = OrdersTotal();
if(ot==0)
if(Minute()==0)
OrderSend(Symbol(),OP_SELL,0.1,Bid,1,Ask+1500*Point,Ask-300*Point, "jfh",123
return(0);
}
Thank you.
ACCOUNT_LIMIT_ORDERS
Maximum allowed number of active pending orders
No market orders, but opening of market orders can be limited
ACCOUNT_MARGIN
Amount of reserved margin for the account in the deposit currency
double
ACCOUNT_FREEMARGIN
Size of free funds in the account in the currency of the deposit, available for the order opening
double
ACCOUNT_MARGIN_LEVEL
Account margin level in percent
double
Ok. What would the command explaining the number of pending orders look like in this case?
I don't think more market ones can be opened, most likely this command is valid for the total number of orders, i.e. pending orders + market ones.
Please advise.... I don't have enough brains of my own yet.
I am testing my idea on TF5
Model: based on open prices.
Only 1 order may be open.
Orders open on any candlestick with minute value only - 00
THE PROBLEM
In some cases on a candlestick with a minute value of 00 at the same time and at the same price
- order 1 closes on a SL
- order N2 opens
My idea is not to close on a SL and open the next order at the same time.
Q: .
How should I make it so that if order N1 is closed by a SL, order N2 is not opened at the same time as order N1, but at the next closest candlestick with a value of 00 minutes.
Thank you.
It is very easy, Watson.
Compare the opening bar and the closing bar of the last closed position. If they are equal, then the position is closed on the same bar it was opened on - do not open on that bar again.Elementary, Watson.
Compare the opening bar and the closing bar of the last closed position. If they are equal, then the position is closed on the same bar it was opened on - do not open on that bar again.