Так можно же стохастик настроить под wpr+ma.
enum closeType { BuyBuy_SellSell, // — Buy X + Buy && — Sell X + Sell BuySell_SellBuy, // — Buy X + Sell && — Sell X + Buy };
enum closeType
{
BuyBuy, // — Buy X + Buy
SellSell, // — Sell X + Sell
BuySell, // — Buy X + Sell
SellBuy // — Sell X + Buy
};
enum closeType
{
BuyBuy_SellSell, // — Buy X + Buy && — Sell X + Sell
BuySell_SellBuy, // — Buy X + Sell && — Sell X + Buy
};
это серьезный труд
//+------------------------------------------------------------------+
//| StopLimit_Test2.mq5 |
//+------------------------------------------------------------------+
#property copyright "Copyright 2023"
//+------------------------------------------------------------------+
#include <Trade\Trade.mqh>
CTrade trade;
//+------------------------------------------------------------------+
enum Ord
{
ord1 = 0, // BUYSTOPLIMIT
ord2 = 1, // SELLSTOPLIMIT
};
input Ord ORD_ = ord1; // Ордер
input double Lot = 0.1; // Лот
input int Deviation = 100; // Отклонение
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//---
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Expert deinitialization function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
//---
}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
void OnTick()
{
MqlTick tick;
SymbolInfoTick(_Symbol,tick);
trade.SetTypeFilling(ORDER_FILLING_RETURN);
double ticksise=SymbolInfoDouble(_Symbol,SYMBOL_TRADE_TICK_SIZE);
if(OrdersTotal()==0)
{
if (ORD_==0) trade.OrderOpen(_Symbol,ORDER_TYPE_BUY_STOP_LIMIT,Lot,tick.ask+Deviation*ticksise,tick.ask+100*ticksise,0,0);
if (ORD_==1) trade.OrderOpen(_Symbol,ORDER_TYPE_SELL_STOP_LIMIT,Lot,tick.bid-Deviation*ticksise,tick.bid-100*ticksise,0,0);
}
}
#property copyright "Copyright 2013"
#property link ""
#property strict
#property indicator_chart_window
string Gsa_80[24] = {"EURUSD","GBPUSD","USDJPY","USDCHF","NZDUSD","USDCAD","AUDUSD","AUDNZD","AUDCAD","AUDCHF","AUDJPY","CADCHF","CADJPY","CHFJPY","EURGBP","EURAUD","EURCHF","EURJPY","EURNZD","EURCAD","GBPJPY","GBPCHF","NZDJPY","GOLD"};
int FontSize = 12;
int Gia_84[24] = {251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251,251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251};
bool Gba_88[24] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
string Gsa_92[24] = {"", "", "", "", "", "", "", "", "", "", "", "","", "", "", "", "", "", "", "", "", "", "", ""};
string Gsa_96[24] = {"", "", "", "", "", "", "", "", "", "", "", "","", "", "", "", "", "", "", "", "", "", "", ""};
datetime G_time_100 = 1;
double Gd_unused_104;
int G_count_112 = 0;
// E37F0136AA3FFAF149B351F6A4C948E9
int init() {
double iclose_0;
int Lia_unused_8[];
if (Point == 0.00001) Gd_unused_104 = 0.0001;
else {
if (Point == 0.001) Gd_unused_104 = 0.01;
else Gd_unused_104 = Point;
}
G_time_100 = Time[0];
for (int index_12 = 0; index_12 <= ArraySize(Gsa_80) - 1; index_12++) for (int Li_16 = 0; Li_16 <= 3; Li_16++) iclose_0 = iClose(Gsa_80[index_12], 0, Li_16);
return (0);
}
// 52D46093050F38C27267BCE42543EF60
int deinit() {
f0_4();
return (0);
}
// C221A17B360C36A473B962FBBDF51DA3
void f0_4() {
for (int Li_0 = ObjectsTotal() - 1; Li_0 >= 0; Li_0--)
if (StringSubstr(ObjectName(Li_0), 0, StringLen("Ben Binary Indicator")) == "Ben Binary Indicator") ObjectDelete(ObjectName(Li_0));
}
// ED527DFD7147F55A900CF91EA8B9A467
void f0_6(color A_color_0) {
string name_12;
int fontsize_4 = 120;
int Li_8 = 130;
for (int count_20 = 0; count_20 < 4; count_20++) {
for (int count_24 = 0; count_24 < 4; count_24++) {
name_12 = "Ben Binary Indicator" + "-bgblock-" + ((count_20 + 1)) + "-" + ((count_24 + 1));
if (ObjectFind(name_12) == -1) ObjectCreate(name_12, OBJ_LABEL, 0, 0, 0);
ObjectSetText(name_12, "g", fontsize_4, "Webdings", A_color_0);
ObjectSet(name_12, OBJPROP_XDISTANCE, Li_8 * count_20 + 4);
ObjectSet(name_12, OBJPROP_YDISTANCE, Li_8 * count_24 + 20);
ObjectSet(name_12, OBJPROP_COLOR, A_color_0);
ObjectSet(name_12, OBJPROP_FONTSIZE, fontsize_4);
}
}
}
// C78C6CE47D21092278DDCB1713B15763
void f0_5(int Ai_0, color A_color_4, int Ai_8) {
string name_12 = "Ben Binary Indicator" + "-parrow-" + Ai_0;
if (ObjectFind(name_12) == -1) ObjectCreate(name_12, OBJ_LABEL, 0, 0, 0);
ObjectSetText(name_12, CharToStr(Ai_8), FontSize, "Wingdings", A_color_4);
ObjectSet(name_12, OBJPROP_XDISTANCE, 230);
ObjectSet(name_12, OBJPROP_YDISTANCE, Ai_0 * FontSize * 2 + 60);
ObjectSet(name_12, OBJPROP_COLOR, A_color_4);
ObjectSet(name_12, OBJPROP_FONTSIZE, FontSize);
ObjectSet(name_12, OBJPROP_BACK, FALSE);
}
// 2E19B008659812AC2C3D6D6F879D9E70
void f0_1(int Ai_0, string As_4, int A_x_12, color A_color_16, string A_text_20) {
string name_28 = "Ben Binary Indicator" + "-" + As_4 + "-" + Ai_0;
if (ObjectFind(name_28) == -1) ObjectCreate(name_28, OBJ_LABEL, 0, 0, 0);
ObjectSetText(name_28, A_text_20, FontSize, "Tahoma", A_color_16);
ObjectSet(name_28, OBJPROP_XDISTANCE, A_x_12);
ObjectSet(name_28, OBJPROP_YDISTANCE, Ai_0 * FontSize * 2 + 60);
ObjectSet(name_28, OBJPROP_COLOR, A_color_16);
ObjectSet(name_28, OBJPROP_FONTSIZE, FontSize);
ObjectSet(name_28, OBJPROP_BACK, FALSE);
}
// 3615EE2C04E2B67B734E47180D26EF4D
void f0_2() {
color color_0 = Silver;
int x_4 = 20;
int y_8 = 30;
string name_12 = "Ben Binary Indicator" + "-scanning";
if (ObjectFind(name_12) == -1) ObjectCreate(name_12, OBJ_LABEL, 0, 0, 0);
ObjectSetText(name_12, "Торговля", FontSize, "Arial", color_0);
ObjectSet(name_12, OBJPROP_XDISTANCE, x_4);
ObjectSet(name_12, OBJPROP_YDISTANCE, y_8);
ObjectSet(name_12, OBJPROP_COLOR, color_0);
ObjectSet(name_12, OBJPROP_FONTSIZE, FontSize);
ObjectSet(name_12, OBJPROP_BACK, FALSE);
for (int count_20 = 0; count_20 < 4; count_20++) {
name_12 = "Ben Binary Indicator" + "-scan-" + count_20;
if (count_20 <= G_count_112) {
if (ObjectFind(name_12) == -1) ObjectCreate(name_12, OBJ_LABEL, 0, 0, 0);
ObjectSetText(name_12, CharToStr(52), 10, "Webdings", color_0);
ObjectSet(name_12, OBJPROP_XDISTANCE, x_4 + 180 + 10 * count_20);
ObjectSet(name_12, OBJPROP_YDISTANCE, y_8 + 4);
ObjectSet(name_12, OBJPROP_COLOR, color_0);
ObjectSet(name_12, OBJPROP_FONTSIZE, 10);
ObjectSet(name_12, OBJPROP_BACK, FALSE);
} else
if (ObjectFind(name_12) > -1) ObjectDelete(name_12);
}
G_count_112++;
if (G_count_112 > 4) G_count_112 = 0;
}
// 0BEB11C60932324283D99AE1621CE4EA
int f0_0(string A_symbol_0, int Ai_8) {
return (iClose(A_symbol_0, 0, Ai_8) > iOpen(A_symbol_0, 0, Ai_8));
}
// 9D2B54D8854E5058E9165CC517FF5612
int f0_3(string A_symbol_0, int Ai_8) {
return (iOpen(A_symbol_0, 0, Ai_8) > iClose(A_symbol_0, 0, Ai_8));
}
// EA2B2676C28C0DB26D39331A336C6B92
int start() {
int Li_4;
int Li_8;
int index_0;
string Ls_12;
bool Li_20;
f0_6(Black);
f0_2();
for (index_0 = 0; index_0 <= ArraySize(Gsa_80) - 1; index_0++) {
if (f0_3(Gsa_80[index_0], 1) && f0_3(Gsa_80[index_0], 2) && f0_3(Gsa_80[index_0], 3)) {
Li_4 = 233;
Gba_88[index_0] = Gia_84[index_0] != Li_4;
Gsa_92[index_0] = "BUY";
Gsa_96[index_0] = DoubleToStr(iOpen(Gsa_80[index_0], 0, 0), MarketInfo(Gsa_80[index_0], MODE_DIGITS));
Gia_84[index_0] = Li_4;
Li_8 = 65280;
} else {
if (f0_0(Gsa_80[index_0], 1) && f0_0(Gsa_80[index_0], 2) && f0_0(Gsa_80[index_0], 3)) {
Li_4 = 234;
Gba_88[index_0] = Gia_84[index_0] != Li_4;
Gsa_92[index_0] = "SELL";
Gsa_96[index_0] = DoubleToStr(iOpen(Gsa_80[index_0], 0, 0), MarketInfo(Gsa_80[index_0], MODE_DIGITS));
Gia_84[index_0] = Li_4;
Li_8 = 17919;
} else {
Li_4 = 251;
Gba_88[index_0] = 0;
Gsa_92[index_0] = "";
Gsa_96[index_0] = "-";
Gia_84[index_0] = Li_4;
Li_8 = 65535;
}
}
f0_1(index_0, "pair", 30, Li_8, Gsa_80[index_0]);
f0_5(index_0, Li_8, Gia_84[index_0]);
f0_1(index_0, "price", 300, Li_8, Gsa_96[index_0]);
}
if (G_time_100 != Time[0]) {
G_time_100 = Time[0];
Ls_12 = "";
Li_20 = FALSE;
for (index_0 = 0; index_0 <= ArraySize(Gba_88) - 1; index_0++) {
if (Gba_88[index_0] && Gsa_92[index_0] != "" && Gsa_96[index_0] != "") {
Ls_12 = Gsa_92[index_0] + " on " + Gsa_80[index_0] + " @ " + Gsa_96[index_0] + " " + TimeToStr(TimeLocal(),TIME_SECONDS);
if (Ls_12 != "") {
Alert(Ls_12);
Li_20 = TRUE;
}
}
}
if (Li_20) PlaySound("alert.wav");
}
return (0);
}
OSS5