Коробка рисуется по минимуму максимуму первой часовой свече
Нарисуйте входы на скрине?
Коробка рисуется по минимуму максимуму первой часовой свече
Господин Сmillion, чей советник продемонстрирован в видео, попросил за написание подобного, но конечно гораздо более функционального советника, 3000 $.
2017.05.28 18:20:44.730 EURUSD,H1: 52790 tick events (3110 bars, 53790 bar states) processed in 0:00:13.235 (total time 0:00:15.485)
2017.05.28 18:20:44.730 2017.05.26 23:59:56 Tester: order #29 is closed
2017.05.28 18:20:44.730 2017.05.26 23:59:56 Tester: order #30 is closed
2017.05.28 18:20:40.239 2017.04.24 00:00:00 Rulim EURUSD,H1: 0.2
2017.05.28 18:20:40.239 2017.04.24 00:00:00 Rulim EURUSD,H1: open #30 sell 0.20 EURUSD at 1.09179 ok
2017.05.28 18:20:38.338 2017.03.30 19:45:00 Rulim EURUSD,H1: close #27 sell 0.10 EURUSD at 1.05055 at price 1.07118
2017.05.28 18:20:38.338 2017.03.30 19:45:00 Rulim EURUSD,H1: close #28 sell 0.20 EURUSD at 1.08083 at price 1.07118
2017.05.28 18:20:37.116 2017.03.21 13:15:00 Rulim EURUSD,H1: 0.2
2017.05.28 18:20:37.116 2017.03.21 13:15:00 Rulim EURUSD,H1: open #28 sell 0.20 EURUSD at 1.08083 ok
2017.05.28 18:20:34.642 2017.02.22 14:15:00 Rulim EURUSD,H1: 1.0
2017.05.28 18:20:34.642 2017.02.22 14:15:00 Rulim EURUSD,H1: open #27 sell 1.00 EURUSD at 1.05055 ok
2017.05.28 18:20:34.642 2017.02.22 14:15:00 Tester: stop loss #26 at 1.05046 (1.05055 / 1.05065)
2017.05.28 18:20:34.641 2017.02.22 13:50:00 Rulim EURUSD,H1: modify #26 sell 1.00 EURUSD at 1.05068 sl: 1.05046 tp: 0.00000 ok
2017.05.28 18:20:34.640 2017.02.22 12:50:00 Rulim EURUSD,H1: 1.0
2017.05.28 18:20:34.640 2017.02.22 12:50:00 Rulim EURUSD,H1: open #26 sell 1.00 EURUSD at 1.05068 ok
2017.05.28 18:20:34.640 2017.02.22 12:50:00 Tester: stop loss #25 at 1.05062 (1.05068 / 1.05078)
2017.05.28 18:20:34.625 2017.02.22 12:32:30 Rulim EURUSD,H1: modify #25 sell 1.00 EURUSD at 1.05089 sl: 1.05062 tp: 0.00000 ok
2017.05.28 18:20:34.612 2017.02.22 10:45:00 Rulim EURUSD,H1: 1.0
2017.05.28 18:20:34.612 2017.02.22 10:45:00 Rulim EURUSD,H1: open #25 sell 1.00 EURUSD at 1.05089 ok
2017.05.28 18:20:34.612 2017.02.22 10:45:00 Tester: stop loss #24 at 1.05087 (1.05089 / 1.05099)
2017.05.28 18:20:34.606 2017.02.22 10:20:00 Rulim EURUSD,H1: modify #24 sell 1.00 EURUSD at 1.05323 sl: 1.05087 tp: 0.00000 ok
2017.05.28 18:20:34.606 2017.02.22 10:15:00 Rulim EURUSD,H1: modify #24 sell 1.00 EURUSD at 1.05323 sl: 1.05137 tp: 0.00000 ok
2017.05.28 18:20:34.601 2017.02.22 09:50:00 Rulim EURUSD,H1: modify #24 sell 1.00 EURUSD at 1.05323 sl: 1.05162 tp: 0.00000 ok
2017.05.28 18:20:34.601 2017.02.22 09:45:00 Rulim EURUSD,H1: modify #24 sell 1.00 EURUSD at 1.05323 sl: 1.05207 tp: 0.00000 ok
2017.05.28 18:20:34.601 2017.02.22 09:40:00 Rulim EURUSD,H1: modify #24 sell 1.00 EURUSD at 1.05323 sl: 1.05241 tp: 0.00000 ok
2017.05.28 18:20:34.596 2017.02.22 09:20:00 Rulim EURUSD,H1: modify #24 sell 1.00 EURUSD at 1.05323 sl: 1.05269 tp: 0.00000 ok
2017.05.28 18:20:34.590 2017.02.22 08:50:00 Rulim EURUSD,H1: modify #24 sell 1.00 EURUSD at 1.05323 sl: 1.05309 tp: 0.00000 ok
2017.05.28 18:20:33.924 2017.02.15 15:56:40 Rulim EURUSD,H1: 1.0
2017.05.28 18:20:33.924 2017.02.15 15:56:40 Rulim EURUSD,H1: open #24 sell 1.00 EURUSD at 1.05323 ok
2017.05.28 18:20:33.924 2017.02.15 15:56:40 Tester: stop loss #23 at 1.05322 (1.05323 / 1.05333)
2017.05.28 18:20:33.924 2017.02.15 15:46:40 Rulim EURUSD,H1: modify #23 sell 1.00 EURUSD at 1.05554 sl: 1.05322 tp: 0.00000 ok
2017.05.28 18:20:33.924 2017.02.15 15:40:00 Rulim EURUSD,H1: modify #23 sell 1.00 EURUSD at 1.05554 sl: 1.05433 tp: 0.00000 ok
2017.05.28 18:20:33.924 2017.02.15 15:33:20 Rulim EURUSD,H1: modify #23 sell 1.00 EURUSD at 1.05554 sl: 1.05516 tp: 0.00000 ok
2017.05.28 18:20:33.921 2017.02.15 13:02:30 Rulim EURUSD,H1: 1.0
2017.05.28 18:20:33.921 2017.02.15 13:02:30 Rulim EURUSD,H1: open #23 sell 1.00 EURUSD at 1.05554 ok
2017.05.28 18:20:33.921 2017.02.15 13:02:30 Tester: stop loss #22 at 1.05547 (1.05554 / 1.05564)
2017.05.28 18:20:33.920 2017.02.15 12:32:30 Rulim EURUSD,H1: modify #22 sell 1.00 EURUSD at 1.05581 sl: 1.05547 tp: 0.00000 ok
2017.05.28 18:20:33.897 2017.02.15 12:20:00 Rulim EURUSD,H1: modify #22 sell 1.00 EURUSD at 1.05581 sl: 1.05570 tp: 0.00000 ok
2017.05.28 18:20:33.896 2017.02.15 12:07:30 Rulim EURUSD,H1: 1.0
2017.05.28 18:20:33.896 2017.02.15 12:07:30 Rulim EURUSD,H1: open #22 sell 1.00 EURUSD at 1.05581 ok
2017.05.28 18:20:33.896 2017.02.15 12:07:30 Tester: stop loss #21 at 1.05586 (1.05581 / 1.05591)
2017.05.28 18:20:33.896 2017.02.15 11:50:00 Rulim EURUSD,H1: modify #21 sell 1.00 EURUSD at 1.05738 sl: 1.05586 tp: 0.00000 ok
2017.05.28 18:20:33.895 2017.02.15 11:16:40 Rulim EURUSD,H1: modify #21 sell 1.00 EURUSD at 1.05738 sl: 1.05614 tp: 0.00000 ok
2017.05.28 18:20:33.895 2017.02.15 10:50:00 Rulim EURUSD,H1: modify #21 sell 1.00 EURUSD at 1.05738 sl: 1.05635 tp: 0.00000 ok
2017.05.28 18:20:33.894 2017.02.15 10:20:00 Rulim EURUSD,H1: modify #21 sell 1.00 EURUSD at 1.05738 sl: 1.05710 tp: 0.00000 ok
2017.05.28 18:20:33.881 2017.02.14 20:46:40 Rulim EURUSD,H1: 1.0
2017.05.28 18:20:33.881 2017.02.14 20:46:40 Rulim EURUSD,H1: open #21 sell 1.00 EURUSD at 1.05738 ok
2017.05.28 18:20:33.881 2017.02.14 20:46:40 Tester: stop loss #20 at 1.05733 (1.05738 / 1.05748)
2017.05.28 18:20:33.880 2017.02.14 20:02:30 Rulim EURUSD,H1: modify #20 sell 1.00 EURUSD at 1.05740 sl: 1.05733 tp: 0.00000 ok
2017.05.28 18:20:33.862 2017.02.14 18:15:00 Rulim EURUSD,H1: 1.0
2017.05.28 18:20:33.862 2017.02.14 18:15:00 Rulim EURUSD,H1: open #20 sell 1.00 EURUSD at 1.05740 ok
2017.05.28 18:20:33.856 2017.02.14 18:15:00 Tester: stop loss #19 at 1.05722 (1.05740 / 1.05750)
2017.05.28 18:20:33.856 2017.02.14 17:46:40 Rulim EURUSD,H1: modify #19 sell 1.00 EURUSD at 1.05905 sl: 1.05722 tp: 0.00000 ok
2017.05.28 18:20:33.856 2017.02.14 17:40:00 Rulim EURUSD,H1: modify #19 sell 1.00 EURUSD at 1.05905 sl: 1.05790 tp: 0.00000 ok
2017.05.28 18:20:33.851 2017.02.14 17:33:20 Rulim EURUSD,H1: modify #19 sell 1.00 EURUSD at 1.05905 sl: 1.05840 tp: 0.00000 ok
2017.05.28 18:20:33.851 2017.02.14 17:27:30 Rulim EURUSD,H1: 1.0
2017.05.28 18:20:33.851 2017.02.14 17:27:30 Rulim EURUSD,H1: open #19 sell 1.00 EURUSD at 1.05905 ok
2017.05.28 18:20:33.851 2017.02.14 17:27:30 Tester: stop loss #18 at 1.05880 (1.05905 / 1.05915)
2017.05.28 18:20:33.850 2017.02.14 17:20:00 Rulim EURUSD,H1: modify #18 sell 1.00 EURUSD at 1.06023 sl: 1.05880 tp: 0.00000 ok
2017.05.28 18:20:33.850 2017.02.14 17:15:00 Rulim EURUSD,H1: modify #18 sell 1.00 EURUSD at 1.06023 sl: 1.06015 tp: 0.00000 ok
2017.05.28 18:20:33.773 2017.02.14 05:10:00 Rulim EURUSD,H1: 1.0
2017.05.28 18:20:33.773 2017.02.14 05:10:00 Rulim EURUSD,H1: open #18 sell 1.00 EURUSD at 1.06023 ok
2017.05.28 18:20:33.773 2017.02.14 05:10:00 Tester: stop loss #17 at 1.06022 (1.06023 / 1.06033)
2017.05.28 18:20:33.773 2017.02.14 04:07:30 Rulim EURUSD,H1: modify #17 sell 1.00 EURUSD at 1.06049 sl: 1.06022 tp: 0.00000 ok
2017.05.28 18:20:33.773 2017.02.14 03:50:00 Rulim EURUSD,H1: modify #17 sell 1.00 EURUSD at 1.06049 sl: 1.06042 tp: 0.00000 ok
2017.05.28 18:20:33.773 2017.02.14 02:15:00 Rulim EURUSD,H1: 1.0
2017.05.28 18:20:33.773 2017.02.14 02:15:00 Rulim EURUSD,H1: open #17 sell 1.00 EURUSD at 1.06049 ok
2017.05.28 18:20:33.773 2017.02.14 02:15:00 Tester: stop loss #16 at 1.06038 (1.06049 / 1.06059)
2017.05.28 18:20:33.773 2017.02.14 00:20:00 Rulim EURUSD,H1: modify #16 sell 1.00 EURUSD at 1.06056 sl: 1.06038 tp: 0.00000 ok
2017.05.28 18:20:33.773 2017.02.13 21:07:30 Rulim EURUSD,H1: 1.0
2017.05.28 18:20:31.494 2017.01.25 00:00:00 Rulim inputs: Lot1=1; Lot2=0.1; Lot3=0.1; KLot=2; KStep=30; MaxLot=51.2; Step=100; Type=2; TrailingStop=100; TrailingStep=20; Slip=3; Magic1=0; Magic2=123;
Индикаторы не качаются, перезалейте пожалуйста.
//+------------------------------------------------------------------+
//| Sila.mq4 |
//| Copyright 2017, AM2 |
//| http://www.forexsystems.biz |
//+------------------------------------------------------------------+
#property copyright "Copyright 2017, 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 = 2000; // лось
extern int TakeProfit = 3000; // язь
extern int Slip = 30; // реквот
extern int Shift = 1; // на каком баре сигнал индикатора
extern int Magic = 123; // магик
extern string IndName = "Trend Strength";
extern int STPeriod = 13;
extern string IndName1 = "Trend Momentum";
extern int Period1 = 5;
extern int DPeriod1 = 3;
extern int SlowingPeriod1=3;
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,Lots,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 OpenPos()
{
double ao = iAO(NULL,0,Shift);
double ao1 = iAO(NULL,0,Shift+1);
double blue = iCustom(NULL,0,IndName,STPeriod,0,Shift);
double red = iCustom(NULL,0,IndName,STPeriod,1,Shift);
double blue1 = iCustom(NULL,0,IndName1,Period1,DPeriod1,SlowingPeriod1,0,Shift);
double red1 = iCustom(NULL,0,IndName1,Period1,DPeriod1,SlowingPeriod1,1,Shift);
/*
Покупки:
-АО окрашен в зеленый цвет;
-Trend Momentum в синий;
-Trend Strength синяя и выше 16 уровня
Продажи:
-АО окрашен в красный цвет;
-Trend Momentum в красный;
-Trend Strength красная и выше 16 уровня
*/
if(ao1>ao && blue1<1000 && blue>0 && blue>16)
{
PutOrder(0,Ask);
}
if(ao1<ao && red1<1000 && red>0 && red>16)
{
PutOrder(1,Bid);
}
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void ClosePos()
{
double ao = iAO(NULL,0,Shift);
double ao1 = iAO(NULL,0,Shift+1);
double blue = iCustom(NULL,0,IndName,STPeriod,0,Shift);
double red = iCustom(NULL,0,IndName,STPeriod,1,Shift);
double blue1 = iCustom(NULL,0,IndName1,Period1,DPeriod1,SlowingPeriod1,0,Shift);
double red1 = iCustom(NULL,0,IndName1,Period1,DPeriod1,SlowingPeriod1,1,Shift);
//---Выход из сделки когда 2 индикатора АО и Trend Momentum показывают противоположное направление
if((ao<ao1 && blue1<1000) || (ao>ao1 && red1<1000))
{
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);
}
}
}
}
}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
void OnTick()
{
double ao = iAO(NULL,0,Shift);
double blue = iCustom(NULL,0,IndName,STPeriod,0,Shift);
double red = iCustom(NULL,0,IndName,STPeriod,1,Shift);
double blue1 = iCustom(NULL,0,IndName1,Period1,DPeriod1,SlowingPeriod1,0,Shift);
double red1 = iCustom(NULL,0,IndName1,Period1,DPeriod1,SlowingPeriod1,1,Shift);
if(CountTrades()<1 && t!=Time[0])
{
OpenPos();
}
else ClosePos();
t=Time[0];
Comment("\n blue: ",blue,
"\n red: ",red,
"\n blue1: ",blue1,
"\n red1: ",red1);
}
//+------------------------------------------------------------------+
Уважаемый АМ2, немного не понял, как он выстраивает проценты)
double Procent(double p)
{
double proc=(up-dn)*p/100;
return(proc);
}
//+------------------------------------------------------------------+
//| Procent.mq4 |
//| Copyright 2017, AM2 |
//| http://www.forexsystems.biz |
//+------------------------------------------------------------------+
#property copyright "Copyright 2017, AM2"
#property link "http://www.forexsystems.biz"
#property version "1.00"
#property strict
#property indicator_chart_window
input double up=1.12;
input double dn=1.09;
input double pup1=11.5;
input double pup2=23.5;
input double pup3=35.5;
input double pdn1=10.5;
input double pdn2=23.5;
input double pdn3=45.5;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//--- indicator buffers mapping
//---
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,1);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
double Procent(double p)
{
double proc=(up-dn)*p/100;
return(proc);
}
//+------------------------------------------------------------------+
//| 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[])
{
//---
PutHLine("up",up,Red);
PutHLine("dn",dn,Blue);
PutHLine("dn1",dn+Procent(pdn1),Blue);
PutHLine("dn2",dn+Procent(pdn2),Blue);
PutHLine("dn3",dn+Procent(pdn3),Blue);
PutHLine("up1",up-Procent(pup1),Red);
PutHLine("up2",up-Procent(pup2),Red);
PutHLine("up3",up-Procent(pup3),Red);
//--- return value of prev_calculated for next call
return(rates_total);
}
//+------------------------------------------------------------------+
AM2