Initial Commit ...

This commit is contained in:
2024-01-25 04:03:36 +03:30
commit 0a19e0f4e1
217 changed files with 41677 additions and 0 deletions
+66
View File
@@ -0,0 +1,66 @@
# Some Usefull Tutorials
## Open Order
for opening a sample order in mql4 follow following syntax:
//
buy => ASK Price ...
sell => BID Price ...
```mql4
void OnTick() {
//
if (OrdersTotal() > 0) {
return;
}
//
// we are on bullish candle ...
if (close[1] > open[1]) {
//
OrderSend(
_Symbol, // Symbol ...
OP_BUY, // Operation ...
0.1 // Lot Size ( Volume ) ...
Ask, // Open Order Price ...
3, // tolerance ...
Ask - 300 * _Point, // SL ...
Ask + 150 * _Point, // TP ...
NULL, // Trade Comment ...
0, // Magic Number (user unique number) ...
0, // Expiration ...
Green // Arrow Line ...
);
}
}
```
## Counting Open Buy Positions
```mql4
int CountOpenBuyOrders() {
//
int result = 0;
//
for (int i = OrdersTotal() - 1; i >= 0; i--) {
//
OrderSelect(i, SELECT_BY_POSITION, MODE_TRADES);
//
string orderSymbol = OrderSymbol();
//
if (
orderSymbol == _Symbol &&
OrderType() == OP_BUY
) {
result++;
}
}
//
return result;
}
```