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

 
tuner:

Is it possible to create a two-dimensional array by setting the size of the second dimension to a variable instead of a constant?


Use classes or structures. ArrayResize can help you there.

The define option is not suitable because it is not variable.

 
atztek,sergeev ,thanks for the tip, I will try the structure
 
tuner:

Is it possible to create a two-dimensional array by setting the size of the second dimension to a variable instead of a constant?


It is possible. Is the size of the first dimension constant?

 
tara:


Can I. Is the size of the first dimension constant?


Basically, both dimensions have to be set from global variables, like this:

input int x=10;

input int y=20; 

int massiv[x][y]; 
 

Good day!

There is a problem: Order does not close, error 129: Wrong price. I set the closing price Ask and Bid respectively for Buy and Sell:

bool close1 = OrderClose(ticket1,0.1,Ask,15,clrNONE);

bool close2 = OrderClose(ticket2,0.1,Bid,15,clrNONE);

What could be the problem here other than a broker quirk?

 
ko39:

Good day!

There is a problem: Order does not close, error 129: Wrong price. I set the closing price Ask and Bid to buy and sell respectively:

bool close1 = OrderClose(ticket1,0.1,Ask,15,clrNONE);

bool close2 = OrderClose(ticket2,0.1,Bid,15,clrNONE);

What could be the problem here other than a broker quirk?


Instead of Ask and Bid, put OrderClosePrice() and if 5-digit quotes , put a bigger slip, 30-40
 
ko39:


What could be the problem here other than the broker's quirks?


Could also be a programmer's quirk, trying to close an order on one pair, but taking an asc and bid from another :)
 
ko39:

Good afternoon!

I have the following problem: order does not close, error 129: wrong price. I set the close price as Ask and Bid The order is closed at the same price as the buy or sell order, respectively:

bool close1 = OrderClose(ticket1,0.1,Ask,15,clrNONE);

bool close2 = OrderClose(ticket2,0.1,Bid,15,clrNONE);

What may be the problem here, besides a broker's quirk?

If in the same sequence as in the post, just in case:

buy closes at Bid, sell closes at Ask.


P./S.: Requirements and restrictions for trade transactions.

 

I had an idea to use "ENUM_APPLIED_PRICE"in indicator, i.e. to use different prices of this enumeration.

I can not find examples how to take PRICE_HIGH[i] and give it to the indicator during optimization instead of Close[i].

Or at least High[i] instead of Close[i]

 
Forexman77:

I had an idea to use "ENUM_APPLIED_PRICE"in indicator, i.e. to use different prices of this enumeration.

I can not find examples how to take PRICE_HIGH[i] from it and feed it to the indicator during optimization instead of Close[i].

Or at least High[i] instead of Close[i]

Several indicators and the necessary mathematical operations on them will probably solve this problem
Reason: