Исходный код · ID 474
pioner_v2.mq4
Похожие материалы по тегам
Вы автор или правообладатель?
Сообщите нам, если считаете, что материал размещён без разрешения.
Сообщить о материале
Обращение по товару «pioner_v2.mq4» отправится на рассмотрение. Укажите контакт для ответа и опишите причину.
Поиск по коду файла
#include <stdlib.mqh>
extern double Lots = 0.1;
extern int Grid = 20;
extern int StopLoss = 200;
extern bool FixedLot = true;
extern double Slippage = 3;
extern int Magic = 110705;
extern bool StopOnRoll = false;
extern bool StopAll = false;
int BuyCnt = 0;
int SellCnt = 0;
int BuyLimitCnt = 0;
int SellLimitCnt = 0;
int BuyStopCnt = 0;
int SellStopCnt = 0;
int Step = 0;
#define STATE_0 0
#define STEP_UP 1
#define STEP_DOWN 2
#define ROLL_UP 3
#define ROLL_DOWN 4
string gVarName = "Pioner_PrevState";
int PrevState = STATE_0;
int init() {
// код доступен только после оплаты
}
int deinit() {
return(0);
}
int start() {
// код доступен только после оплаты
}
int OrderSelectByType(int type, int ind) {
int cnt = OrdersTotal();
int ind0 = 0;
for (int i=0; i < cnt; i++) {
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol() != Symbol()) continue;
if (OrderMagicNumber() != Magic) continue;
if (OrderType() == type) ind0++;
if (ind == ind0) return (OrderTicket());
}
return(-1);
}
int Buy(double lot, double price, double SL, double TP, string comment) {
bool res = 0;
while (res<=0) {
RefreshRates();
res = OrderSend(Symbol(), OP_BUY, lot, price, Slippage, SL, TP, comment, Magic);
if (res < 0) {
Print("Error opening BUY order: ", ErrorDescription(GetLastError()));
Sleep(6000);
}
}
Sleep(2000);
return(0);
}
int Sell(double lot, double price, double SL, double TP, string comment) {
bool res = 0;
while (res<=0) {
RefreshRates();
res = OrderSend(Symbol(), OP_SELL, lot, price, Slippage, SL, TP, comment, Magic);
if (res < 0) {
Print("Error opening SELL order: ", ErrorDescription(GetLastError()));
Sleep(6000);
}
}
Sleep(2000);
return(0);
}
int SetBuyStop(double lot, double price, double SL, double TP, string comment) {
bool res = 0;
while (res<=0) {
RefreshRates();
res = OrderSend(Symbol(), OP_BUYSTOP, lot, price, Slippage, SL, TP, comment, Magic);
if (res < 0) {
Print("Error setting BUYSTOP order: ", ErrorDescription(GetLastError()));
Sleep(6000);
}
}
Sleep(2000);
return(0);
}
int SetSellStop(double lot, double price, double SL, double TP, string comment) {
bool res = 0;
while (res<=0) {
RefreshRates();
res = OrderSend(Symbol(), OP_SELLSTOP, lot, price, Slippage, SL, TP, comment, Magic);
if (res < 0) {
Print("Error setting SELLSTOP order: ", ErrorDescription(GetLastError()));
Sleep(6000);
}
}
Sleep(2000);
return(0);
}
int SetBuyLimit(double lot, double price, double SL, double TP, string comment) {
bool res = 0;
while (res<=0) {
RefreshRates();
res = OrderSend(Symbol(), OP_BUYLIMIT, lot, price, Slippage, SL, TP, comment, Magic);
if (res < 0) {
Print("Error setting BUYLIMIT order: ", ErrorDescription(GetLastError()));
Sleep(6000);
}
}
Sleep(2000);
return(0);
}
int SetSellLimit(double lot, double price, double SL, double TP, string comment) {
bool res = 0;
while (res<=0) {
RefreshRates();
res = OrderSend(Symbol(), OP_SELLLIMIT, lot, price, Slippage, SL, TP, comment, Magic);
if (res < 0) {
Print("Error setting SELLLIMIT order: ", ErrorDescription(GetLastError()));
Sleep(6000);
}
}
Sleep(2000);
return(0);
}
int CloseOrder(int ticket, double lot, double price) {
bool res = 0;
while (res<=0) {
RefreshRates();
res = OrderClose(ticket, lot, price, Slippage);
if (!res) {
Print("Error closing order: ", ErrorDescription(GetLastError()));
Sleep(6000);
}
}
Sleep(2000);
return(0);
}
int DeleteOrder(int ticket) {
bool res = 0;
while (res<=0) {
RefreshRates();
res = OrderDelete(ticket);
if (!res) {
Print("Error deleting order: ", ErrorDescrПоказано первые 50% кода (символов: 9159)
Что вы получите после оплаты
На этой странице откроется полный исходный код файла вместо ознакомительного фрагмента.
Зачем нужен email? Адрес передаётся вместе с заказом в магазин и сохраняется для связи заказа с оплатой. Укажите адрес, к которому у вас есть доступ.
Чтобы оформить заказ, введите email и перейдите к оплате.
Стоимость полного кода
916₽
≈ $10.77