
if(CountTrades()>0)
{
if(MathAbs(last-Bid)>Step*_Point)
{
if(ma1>ma2)
PutOrder(0,Ask);
if(ma1<ma2)
PutOrder(1,Bid);
last=Bid;
}
}
1) При закрытии текущих поз. по ТР или СЛ, не должны открываться новые позы. до смены тренда (цвета инд.)
То есть, на текущем тренде работают только указанные в настройках кол-во поз. открытых в начале тренда (по сигналу инд.)
//+------------------------------------------------------------------+
//| Limit.mq5 |
//| Copyright 2021, AM2 |
//| https://www.forexsystems.biz |
//+------------------------------------------------------------------+
#property copyright "Copyright 2021, AM2"
#property link "https://www.forexsystems.biz"
#property version "1.00"
#include <Trade\Trade.mqh>
CTrade trade;
input double Lots = 0.1; // лот
input double KLot = 2; // увеличение лота
input double Price = 1.16; // цена первого ордера
input int StopLoss = 0; // лось
input int TakeProfit = 300; // язь
input int Count = 3; // число ордеров
input int Step = 100; // шаг
input int Type = 2; // 1-BuyLimit 2-SellLimit
input int Slip = 5; // реквот
double sum=0;
double lot=Lots;
//+------------------------------------------------------------------+
//| Script program start function |
//+------------------------------------------------------------------+
void OnStart()
{
double pr=0,sl=0,tp=0;
if(OrdersTotal()<1 && PositionsTotal()<1 && !IsStopped())
{
if(Type==1)
for(int i=0; i<Count; i++)
{
sum+=lot;
pr=NormalizeDouble(Price-Step*_Point*i,_Digits);
if(StopLoss>0)
sl=pr-StopLoss*_Point;
if(TakeProfit>0)
tp=Price+TakeProfit*_Point;
trade.BuyLimit(lot,pr,NULL,sl,tp,0,0,"");
lot*=KLot;
}
if(Type==2)
for(int i=0; i<Count; i++)
{
sum+=lot;
pr=NormalizeDouble(Price+Step*_Point*i,_Digits);
if(StopLoss>0)
sl=pr+StopLoss*_Point;
if(TakeProfit>0)
tp=Price-TakeProfit*_Point;
trade.SellLimit(lot,pr,NULL,sl,tp,0,0,"");
lot*=KLot;
}
}
Comment("\n Profit: ",AccountInfoDouble(ACCOUNT_BALANCE)-AccountInfoDouble(ACCOUNT_EQUITY),
"\n Summ Lot: ",sum);
}
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
//| Limit.mq5 |
//| Copyright 2021, AM2 |
//| https://www.forexsystems.biz |
//+------------------------------------------------------------------+
#property copyright "Copyright 2021, AM2"
#property link "https://www.forexsystems.biz"
#property version "1.00"
#include <Trade\Trade.mqh>
CTrade trade;
input double Lots = 0.1; // лот
input double KLot = 2; // увеличение лота
input double Price = 1.16; // цена первого ордера
input int StopLoss = 0; // лось
input int TakeProfit = 300; // язь
input int Count = 3; // число ордеров
input int Step = 100; // шаг
input int Type = 2; // 1-BuyLimit 2-SellLimit
input int Slip = 5; // реквот
double sum=0;
double lot=Lots;
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//---
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Expert deinitialization function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
//---
}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
void OnTick()
{
double pr=0,sl=0,tp=0;
if(OrdersTotal()<1 && PositionsTotal()<1)
{
if(Type==1)
for(int i=0; i<Count; i++)
{
sum+=lot;
pr=NormalizeDouble(Price-Step*_Point*i,_Digits);
if(StopLoss>0)
sl=pr-StopLoss*_Point;
if(TakeProfit>0)
tp=Price+TakeProfit*_Point;
trade.BuyLimit(lot,pr,NULL,sl,tp,0,0,"");
lot*=KLot;
}
if(Type==2)
for(int i=0; i<Count; i++)
{
sum+=lot;
pr=NormalizeDouble(Price+Step*_Point*i,_Digits);
if(StopLoss>0)
sl=pr+StopLoss*_Point;
if(TakeProfit>0)
tp=Price-TakeProfit*_Point;
trade.SellLimit(lot,pr,NULL,sl,tp,0,0,"");
lot*=KLot;
}
}
Comment("\n Profit: ",AccountInfoDouble(ACCOUNT_BALANCE)-AccountInfoDouble(ACCOUNT_EQUITY),
"\n Summ Lot: ",sum);
}
//+------------------------------------------------------------------+
1. Слишком большой прирост за последний месяц
говорит о высоком риске
2. Счет открыт совсем недавно и поэтому
результаты могут быть случайными
3. Высокий среднемесячный прирост может
означать торговлю с высоким риском
4. Плечо на счете сигнала менялось 1 раз
в диапазоне 1:500 — 1:1000
у меня индикатор стоп не ставит, даже если в настройках включен
AM2