Вы можете сделать чтоб сразу тралил стоп?
Это уже другой заказ.
Вы можете сделать чтоб сразу тралил стоп?
Поставил на график, а там вот как стряпает:
//+------------------------------------------------------------------+
//| TrendFollow.mq4 |
//| Copyright 2017, AM2. |
//| http://www.forexsyatems.biz |
//+------------------------------------------------------------------+
#property copyright "Copyright 2017, AM2."
#property link "http://www.forexsyatems.biz"
#property version "1.00"
#property strict
#property indicator_chart_window
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//--- indicator buffers mapping
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void PutTrendLine(string name,datetime time1,double price1,datetime time2,double price2,color clr)
{
ObjectDelete(0,name);
ObjectCreate(0,name,OBJ_TREND,0,time1,price1,time2,price2);
//--- установим цвет линии
ObjectSetInteger(0,name,OBJPROP_COLOR,clr);
//--- установим стиль отображения линии
ObjectSetInteger(0,name,OBJPROP_STYLE,STYLE_SOLID);
//--- установим толщину линии
ObjectSetInteger(0,name,OBJPROP_WIDTH,2);
//--- включим (true) или отключим (false) режим продолжения отображения линии вправо
ObjectSetInteger(0,name,OBJPROP_RAY_RIGHT,false);
}
//+------------------------------------------------------------------+
//| 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[])
{
//---
if(Low[1]>Low[33]) PutTrendLine("UP",Time[33],Low[33],Time[1],Low[1],Blue);
if(High[1]<High[33]) PutTrendLine("DN",Time[33],High[33],Time[1],High[1],Red);
//--- return value of prev_calculated for next call
return(rates_total);
}
//+------------------------------------------------------------------+
Надо только проконтролировать своп
AM2