и открывает сделку на пробой этих двух условий
//+------------------------------------------------------------------+
//| CandlePointer.mq4 |
//| Copyright 2024, AM2 |
//| https://www.forexsystems.biz |
//+------------------------------------------------------------------+
#property copyright "Copyright 2024, AM2"
#property link "https://www.forexsystems.biz"
#property version "1.00"
#property strict
#property indicator_chart_window
#property indicator_buffers 2
input int procent=33;
double up[],dn[];
datetime t=0;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
Comment("");
//--- indicator buffers mapping
SetIndexStyle(0,DRAW_ARROW,0,2,Aqua);
SetIndexArrow(0,233);
SetIndexBuffer(0,up);
SetIndexStyle(1,DRAW_ARROW,0,2,Red);
SetIndexArrow(1,234);
SetIndexBuffer(1,dn);
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| 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[])
{
//---
for(int i=0; i<1111; i++)
{
if(close[i]>open[i] && high[i]-close[i]==0)
{
up[i]=low[i];
}
if(close[i]<open[i] && close[i]-low[i]==0)
{
dn[i]=high[i];
}
}
double pr=int(TimeCurrent()-Time[0])/PeriodSeconds();
Comment("\n Delta: ",int(TimeCurrent()-Time[0]),
"\n Procent: ",pr,
"\n Seconds: ",PeriodSeconds());
//--- return value of prev_calculated for next call
return(rates_total);
}
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
double pr=int(TimeCurrent()-Time[0])/PeriodSeconds()*100;
советник мартин для мт5?
в том то и дело что настроить стандартно я не могу так как для каждого ордера разные цели.для села может быть 100п а для бая 300п.я вручную хотел подвигать тейк до нужного уровня и чтоб на этом уровне закрывалось половина ордера а другая переводилась в безубыток
AM2