25.10.2016 Views

Expert Advisor Programming by Andrew R. Young

Expert Advisor Programming by Andrew R. Young

Expert Advisor Programming by Andrew R. Young

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

EXPERT ADVISOR PROGRAMMING<br />

To close sell market orders using the above code, simply change the order type to OP_SELL and the<br />

ClosePrice to the symbol's Ask price. The sell order close function can be viewed in Appendix D.<br />

Let's examine the code to close multiple pending orders. This example will close all buy stop orders.<br />

The difference between this code and the code to close buy market orders above is that we specify<br />

OP_BUYSTOP as our order type, and we use OrderDelete() to close the orders.<br />

void CloseAllBuyStopOrders(string argSymbol, int argMagicNumber, int argSlippage)<br />

{<br />

for(int Counter = 0; Counter

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!