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

 

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.


int m=TimeMinute(OrderCloseTime());
Print("Минута закрытия ордера  ",m);

or

it is the same, but in the left hand :-))

int m=TimeMinute(214576879809);
Print("Минута закрытия ордера  ",m);

or

int m=TimeMinute(D'2014.10.19 00:13');
Print("Ордер закрылся на  ",m,"   минуте");
 
_new-rena:
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

 
pako:

or

it's all the same, only as if in the left hand:-)))

or

Thanks.
 

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.

 
Why is there no communication on the terminal? No server is available (n/a). this is on the real account. There is a connection on the demo account. Everything is OK from the other IP...
 
oDin48:

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.

 
pako:

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.

 
solnce600:

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.
 
artmedia70:

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.
Thank you.
Reason: