[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 151

 
Pyro:


Does mql4 know how to set pending orders?

Yes. Which one do you want?
 
OrderSend (symbol, cmd, ...
cmd - Trade operation
.
Can be any of the trade operation
values.
 
I want to put a pending order to open a buy position. There is confusion about the BUY_STOP and BUY_LIMIT orders. Can they be used to open a position or are they just a stop loss and take profit? I do not understand this.
 

Stop Loss and Take Profit are order parameters, not orders.

see Types and characteristics of orders

 

eddy



Thanks, got it figured out. It turns out they have different triggering parameters. Some are triggered by Ask, others by Bid. Who would have thought it:)

 
they still close at opposite prices, so the spread is added to the difference between opening and closing
 
BooGUY:
Could you please tell me how to execute a buy or sell condition in an EA with a custom indicator? For example, the custom indicator gives arrows to buy or sell, iCustom(...0) and iCustom(...1) are, as I understand, buffer indices that contain sell and buy, but how to write a condition in an EA, please advise.

let's say :

d1=icustom(Symbol(), "Zig zag", 0, 0, 0, 1);

if (d1!=0) {OrdOpen(0,OP_BUY,flot,MG);}
 
double iMAOnArray (double array[], int total, ...

total- Number of elements to calculate. 0 means all elements of the array.

I don't understand the role of total and why it always equals zero

 
 
eddy:

total - Number of elements to calculate. 0 means all elements of the array.

I don't understand the role of total and why it always equals zero

It's not always zero. If you enter zero by yourself when calling this function, the whole array [] will be processed.
If you put 100 there, 100 elements of array [ ] will be processed.