AlexandrL: Reinstalling the OS. How to restore after OS reinstallation MT4 to the state it was in before reinstallation. Indicators, Expert Advisors, scripts; templates, profiles; accounts
Before reinstallation copy the folder of the terminal on a flash drive. If the version is a 7 or higher, then the shared folder as well. Further details are available here
Sell on the upper fractal, buy on the lower one. In work max. 1 order. But there is an error somewhere, because the Expert Advisor does not take into account the fractals and opens only in buy. Or it won't open at all (if we change the offset in iCustom). I have tried to insert a different condition into the Expert Advisor (on the crossover of the arrow). Everything works, but it does not take data from the arrow indicator.
indicator:
//+------------------------------------------------------------------+//| MI_Fractal.mq4 |//| Орешкин А.В. |//| http://www.vk.com/mtforex |//+------------------------------------------------------------------+#property copyright"Орешкин А.В."#property link"http://www.vk.com/mtforex"#property indicator_chart_window#property indicator_buffers2#property indicator_color1 Aqua
#property indicator_color2 Yellow
#property indicator_width1 2#property indicator_width2 2//--- input parametersexternint leftBars=10;
externint rightBars=2;
externint difference=10;
//extern int maximumBars=1000;externbool showUp=true;
externbool showDown=true;
bool UP_Fractal,DOWN_Fractal;
double DEF,up[],down[];
int init()
{
DEF=NormalizeDouble(difference*Point,Digits);
SetIndexBuffer(0,up);
SetIndexBuffer(1,down);
SetIndexStyle(0,DRAW_ARROW);
SetIndexStyle(1,DRAW_ARROW);
SetIndexArrow(0,217);
SetIndexArrow(1,218);
return(0);
}
int deinit(){return(0);}
int start()
{
//for (int i=maximumBars;i>rightBars;i--)for (int i=Bars-IndicatorCounted()-leftBars-1;i>rightBars;i--)
{//3
UP_Fractal=true;DOWN_Fractal=true;
for (int x=i+leftBars;x>=i-rightBars;x--)
{//0if (x==i) continue;
if (High[i]-High[x]<DEF) UP_Fractal=false;
if (Low[x]-Low[i]<DEF) DOWN_Fractal=false;
}//0
up[i]=EMPTY;
down[i]=EMPTY;
if (showUp)
if (UP_Fractal && !DOWN_Fractal) up[i]=High[i];
if (showDown)
if (!UP_Fractal && DOWN_Fractal) down[i]=Low[i];
}//3return(0);
}
Code from the owl:
double upFr=iCustom(Symbol(),0, "MI_Fractal",leftBars,rightBars,difference,showUp,showDown,0,1);
double downFr=iCustom(Symbol(),0, "MI_Fractal",leftBars,rightBars,difference,showUp,showDown,1,1);
if (upFr!=EMPTY_VALUE)
//if (upFr<2) //if (upFr>0)
{
Alert(upFr);
Opn_S=true;
//Cls_B=true;
}
if (downFr!=EMPTY_VALUE)
//if (downFr<2)// if (downFr>0)
{
Opn_B=true;
//Cls_S=true;
}
Tried all sorts of solutions already, it's not working. Please tell me where the error is.
#property description "Expert Advisor trades on market surges without using any indicators."
#property description "The idea of the Expert Advisor is that stop orders are moved discretely in time at a given distance from the current price."
#property description "If the price has moved sharply enough in one direction, the EA simply does not have time to move the order and it becomes a market order."
#property description "Then a trall order is triggered."
Looks like MetaTrader glitches: has anyone experienced a hang-up when trying to enter a procedure?
Here is a simple code
void OnInit()
{
...
Print("Outside procedure");
StartBuy(Price, Take, Stop, Lot);
...
}
Stop trading in the inite, that's what it means. How many times have I told that inite must have a minimum of code with the fastest termination of execution, but still there is someone who is too lazy to read. There are standard predefined functions to run a program.
And the inite is like an int, not an input, with return of the reason for termination, by the way, I recommend to use it that way.
#property description "Expert Advisor trades on market surges without using any indicators."
#property description "The idea of the Expert Advisor is that stop orders are moved discretely in time at a given distance from the current price."
#property description "If the price has moved sharply enough in one direction, the EA simply does not have time to move the order and it becomes a market order."
#property description "Then a trall order is triggered."
Отставить торговать в ините, вот что значит. Сколько уже повторяли что в ините должен быть минимум кода с максимально быстрым завершением исполнения, всё равно найдется кто-нибудь, кому лень читать. Есть же стандартные предопределенные функции для работы программы.
Да и инит типа инт, а не войд, с возвратом причины прекращения работы, между прочим, рекомендую так им и пользоваться.
Sorry! Of course everything happens in void OnTick(). I wrote myself)
Reinstalling the OS. How to restore after OS reinstallation MT4 to the state it was in before reinstallation.
Indicators, Expert Advisors, scripts; templates, profiles; accounts
Afternoon.
An adviser based on an arrow indicator.
Sell on the upper fractal, buy on the lower one. In work max. 1 order. But there is an error somewhere, because the Expert Advisor does not take into account the fractals and opens only in buy. Or it won't open at all (if we change the offset in iCustom). I have tried to insert a different condition into the Expert Advisor (on the crossover of the arrow). Everything works, but it does not take data from the arrow indicator.
indicator:
Code from the owl:
Tried all sorts of solutions already, it's not working. Please tell me where the error is.
Good afternoon.
Help me find the opening price of the first bar on Tuesday and fix it so that I can calculate from it all week.
Thank you.
Hello, I would be grateful if somebody could tell me what to put here so that the EA stops opening pending orders after they trigger.
//+------------------------------------------------------------------+Good afternoon.
Help me find the opening price of the first bar on Tuesday and fix it so that I can calculate from it all week.
Thank you.
Looks like MetaTrader glitches: has anyone experienced a hang-up when trying to enter a procedure?
Here is a simple code
void OnInit()
{
...
Print("Outside procedure");
StartBuy(Price, Take, Stop, Lot);
...
}
void StartBuy(double Price, double Take, double Stop, double Lot)
{
Print("Inside procedure");
....
}
It produces one line Outside procedure and then the tester hangs. What is it?
Looks like MetaTrader glitches: has anyone experienced a hang-up when trying to enter a procedure?
Here is a simple code
void OnInit()
{
...
Print("Outside procedure");
StartBuy(Price, Take, Stop, Lot);
...
}
Stop trading in the inite, that's what it means. How many times have I told that inite must have a minimum of code with the fastest termination of execution, but still there is someone who is too lazy to read. There are standard predefined functions to run a program.
And the inite is like an int, not an input, with return of the reason for termination, by the way, I recommend to use it that way.
Hello, I would be grateful if somebody could tell me what to put here so that the EA stops opening pending orders after they trigger.
//+------------------------------------------------------------------+datetime TimeBarB,TimeBarS;
TradingAllowed = true;
{
b++;
TradingAllowed = false;
s++;
TradingAllowed = false;
}
if (b == 0 && s == 0) TradingAllowed = true;
Somehow...
Отставить торговать в ините, вот что значит. Сколько уже повторяли что в ините должен быть минимум кода с максимально быстрым завершением исполнения, всё равно найдется кто-нибудь, кому лень читать. Есть же стандартные предопределенные функции для работы программы.
Да и инит типа инт, а не войд, с возвратом причины прекращения работы, между прочим, рекомендую так им и пользоваться.