В левом верхнем углу даже не появляется требуемая надпись.До этого такой «бяки» на графиках Ренко не возникало.
а можешь глянуть ещё один мой заказ
А как же мой Там тоже самое
Добавьте пожалуйста закрытие по профиту в валюте. И чтобы был выбор открывать по тренду, то есть он открывает если свеча красная то в бай, а нужно добавить выбор, чтобы если свеча красная следующая тоже красная. Ну и можно если уж совсем делать, то добавить отдельно магики бай и сел и закрытие по профиту в валюте тоже отдельно бай и сел.
extern string IndName = "FL01";
//+------------------------------------------------------------------+
//| FL.mq4 |
//| Copyright 2016, AM2 |
//| http://www.forexsystems.biz |
//+------------------------------------------------------------------+
#property copyright "Copyright 2016, AM2"
#property link "http://www.forexsystems.biz"
#property version "1.00"
#property strict
//--- Inputs
extern double Lots = 0.1; // лот
extern double KLot = 1; // умножение лота
extern double MaxLot = 5; // максимальный лот
extern int StopLoss = 0; // лось
extern int TakeProfit = 0; // язь
extern int Box = 200; // высота коробки
extern int Slip = 30; // реквот
extern int Count = 5; // максимальное количество позиций
extern int CloseOn = 1; // 1-закрытие по сигналу
extern int Shift = 1; // сдвиг
extern int Magic = 123; // магик
extern string IndName = "FL01";
int b=0,s=0;
datetime t=0;
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//---
Comment("");
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Expert deinitialization function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
Comment("");
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void PutOrder(int type,double price)
{
int r=0;
color clr=Green;
double sl=0,tp=0;
if(type==1 || type==3 || type==5)
{
clr=Red;
if(StopLoss>0) sl=NormalizeDouble(price+StopLoss*Point,Digits);
if(TakeProfit>0) tp=NormalizeDouble(price-TakeProfit*Point,Digits);
}
if(type==0 || type==2 || type==4)
{
clr=Blue;
if(StopLoss>0) sl=NormalizeDouble(price-StopLoss*Point,Digits);
if(TakeProfit>0) tp=NormalizeDouble(price+TakeProfit*Point,Digits);
}
r=OrderSend(NULL,type,Lot(),NormalizeDouble(price,Digits),Slip,sl,tp,"",Magic,0,clr);
return;
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int CountTrades()
{
int count=0;
for(int i=OrdersTotal()-1;i>=0;i--)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
{
if(OrderSymbol()==Symbol() && OrderMagicNumber()==Magic)
{
if(OrderType()<2) count++;
}
}
}
return(count);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void ClosePos()
{
double up = iCustom(NULL,0,IndName,1,Shift);
double dn = iCustom(NULL,0,IndName,2,Shift);
//---
for(int i=OrdersTotal()-1;i>=0;i--)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
{
if(OrderSymbol()==Symbol() && OrderMagicNumber()==Magic)
{
if(OrderType()==OP_BUY)
{
if(Close[1]<up && Open[1]>up)
{
CloseAll();
}
}
if(OrderType()==OP_SELL)
{
if(Close[1]>dn && Open[1]<dn)
{
CloseAll();
}
}
}
}
}
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void CloseAll()
{
bool cl;
for(int i=OrdersTotal()-1;i>=0;i--)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
{
if(OrderSymbol()==Symbol() && OrderMagicNumber()==Magic)
{
if(OrderType()==OP_BUY)
{
RefreshRates();
cl=OrderClose(OrderTicket(),OrderLots(),NormalizeDouble(Bid,Digits),Slip,White);
}
if(OrderType()==OP_SELL)
{
RefreshRates();
cl=OrderClose(OrderTicket(),OrderLots(),NormalizeDouble(Ask,Digits),Slip,White);
}
}
}
}
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
double Lot()
{
double lot=Lots;
if(OrderSelect(OrdersHistoryTotal()-1,SELECT_BY_POS,MODE_HISTORY))
{
if(OrderProfit()<0)
{
lot=OrderLots()*KLot;
}
}
if(lot>MaxLot)lot=Lots;
return(lot);
}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
void OnTick()
{
double up = iCustom(NULL,0,IndName,1,Shift);
double dn = iCustom(NULL,0,IndName,2,Shift);
if(CountTrades()<1)
{
b=0;
s=0;
}
if(CountTrades()<=Count && t!=Time[0])
{
if(Close[1]>dn && Open[1]<dn)
{
PutOrder(0,Ask);
PutOrder(5,Close[1]-Box*Point);
b++;
}
if(Close[1]<up && Open[1]>up)
{
PutOrder(1,Bid);
PutOrder(4,Close[1]+Box*Point);
s++;
}
t=Time[0];
}
//else if(CloseOn>0) ClosePos();
Comment("\n UP: ",up,
"\n DN: ",dn);
}
//+------------------------------------------------------------------+
red<1000
lime<1000
AM2