//+------------------------------------------------------------------+
//| ProCent.mq4 |
//| Copyright 2018, AM2 |
//| http://www.forexsystems.biz |
//+------------------------------------------------------------------+
#property copyright "Copyright 2018, AM2"
#property link "http://www.forexsystems.biz"
#property version "1.00"
#property strict
#property indicator_chart_window
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//--- indicator buffers mapping
Comment("");
PutHLine("bid",Bid,Green);
PutHLine("tp",Bid+1000*_Point,Blue);
PutHLine("sl",Bid-1000*_Point,Red);
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Горизонтальная линия |
//+------------------------------------------------------------------+
void PutHLine(string name,double p,color clr)
{
ObjectDelete(0,name);
ObjectCreate(0,name,OBJ_HLINE,0,0,p);
//--- установим цвет линии
ObjectSetInteger(0,name,OBJPROP_COLOR,clr);
//--- установим толщину линии
ObjectSetInteger(0,name,OBJPROP_WIDTH,2);
}
//+------------------------------------------------------------------+
//| Put Text Function |
//+------------------------------------------------------------------+
void Text(string name,string text,double price,datetime time,color clr)
{
ObjectDelete(0,name);
//--- create a "Text" object
ObjectCreate(0,name,OBJ_TEXT,0,time,price);
//--- set the text
ObjectSetString(0,name,OBJPROP_TEXT,text);
//--- set the font of the text
ObjectSetString(0,name,OBJPROP_FONT,"Arial");
//--- set the font size
ObjectSetInteger(0,name,OBJPROP_FONTSIZE,14);
//--- set the method binding
ObjectSetInteger(0,name,OBJPROP_ANCHOR,0);
//--- set the color
ObjectSetInteger(0,name,OBJPROP_COLOR,clr);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
const int prev_calculated,
const datetime &time[],
const double &open[],
const double &high[],
const double &low[],
const double &close[],
const long &tick_volume[],
const long &volume[],
const int &spread[])
{
//---
double bid=ObjectGetDouble(0,"bid",OBJPROP_PRICE);
double tp=ObjectGetDouble(0,"tp",OBJPROP_PRICE);
double sl=ObjectGetDouble(0,"sl",OBJPROP_PRICE);
double tpp=MathAbs(tp-bid)/bid*100;
double slp=MathAbs(sl-bid)/bid*100;
Text("slt",(string)NormalizeDouble(slp,2)+"%",sl,Time[5],Red);
Text("tpt",(string)NormalizeDouble(tpp,2)+"%",tp,Time[5],Blue);
//--- return value of prev_calculated for next call
return(rates_total);
}
//+------------------------------------------------------------------+
у меня ни какой картинки нет
double tppro=tpp*lot/AccountBalance()*100;
double slpro=slp*lot/AccountBalance()*100;
extern double Lots = 0.1; // лот
extern double KLot = 2; // умножение лота
extern double KStop = 2; // умножение лося
extern double KTake = 2; // умножение язя
extern double MaxLot = 5; // максимальный лот
extern int StopLoss = 60; // лось
extern int TakeProfit = 80; // язь
extern int Slip = 5; // реквот
extern int Delta = 30; // расстояние от цены
extern int Magic = 123; // магик
Открывает херову гору(на весь деп) ордеров на каком-то сигнале(рандомно)
if(CountTrades()<1)
{
if(Close[1]>Open[1] && Close[2]>Open[2] && Close[3]>Open[3] && Close[4]<Open[4] && Ask>ma) PutOrder(0,Ask);
if(Close[1]<Open[1] && Close[2]<Open[2] && Close[3]<Open[3] && Close[4]>Open[4] && Bid<ma) PutOrder(1,Bid);
}
AM2