Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 79

 
Why are offline charts opened by the tester NOT saved as other charts when the terminal is closed? So much information is lost... :(
 

Guys, help... I've recently started to learn mql4, I've never been good at programming... So, this question may seem a little silly... I decided to create an EA, I wrote it myself:

int start()
{
int type;
double max;
double min;

if(type==2)
{
min=Low[iLowest(Symbol(),0,MODE_LOW,6,1)]; // calculate the minimum price of the last 6 candles
}
if(type==1)
{
max=High[iHighest(Symbol(),0,MODE_HIGH,6,1)]; // calculate the maximum price of the last 6 candles
}


OrderSend(), OP_BUYSTOP, 0.1,max,3,min,max+0.0022, NULL,0,0, Red);// placing a pending Buy Stop
OrderSend ( Symbol (), OP_SELLSTOP, 0.1,min,3,max,min-0.0022, NULL,0,0, Yellow); // placing a pending Sell Stop

return(0);
}

The idea of it: keeps track of last 6 bars, and puts a pending order at max price buystop and max sellstop, at a certain time. My example didn't want to recognize price and stoploss, so it didn't logically understand "min'' ''max'' but I defined it and it should have calculated in type 1 and type 2.I don't quite understand the function description, but I still can't get it right (((((

Thanks for reading this and thinking on how to explain the problem here =))

 
ex1m:

Guys, help... I've recently started to learn mql4, I've never been good at programming... So, this question may seem a little silly... I decided to create an EA, I wrote it myself:

int start()
{
int type;
double max;
double min;

if(type==2)
{
min=Low[iLowest(Symbol(),0,MODE_LOW,6,1)]; // calculate the minimum price of the last 6 candles
}
if(type==1)
{
max=High[iHighest(Symbol(),0,MODE_HIGH,6,1)]; // calculate the maximum price of the last 6 candles
}


OrderSend(), OP_BUYSTOP, 0.1,max,3,min,max+0.0022, NULL,0,0, Red);// placing a pending Buy Stop
OrderSend ( Symbol (), OP_SELLSTOP, 0.1,min,3,max,min-0.0022, NULL,0,0, Yellow); // placing a pending Sell Stop

return(0);
}

The idea of it: keeps track of last 6 bars, and puts a pending order at max price buystop and max sellstop, at a certain time. The given example I cited does not want to recognize price and stoploss, so logically based does not understand "min'' ''max'' but I declare a variable, the value should have calculated in type 1 and type 2.I can not get it figured out yet, maybe I should add a Select order somewhere or what is needed for this? I do not quite understand the function description, although I've read it everywhere, but I still do not understand it. (((((

Thanks for reading this and thinking on how to explain the problems here))

1. There is a button SRC for pasting code - it appears when you write a post.

2. Try to explain algorithm in words, maybe you will understand what you may miss. Hint highlighted ;)

int start()
{
int type;//????????????????????????
double max;
double min;

if(type==2)// откуда значение ?
{
min=Low[iLowest(Symbol(),0,MODE_LOW,6,1)]; // вычисляем минимальную цену последних 6 свечей
}
if(type==1)// откуда значение ?
{
max=High[iHighest(Symbol(),0,MODE_HIGH,6,1)]; // вычисляем максимальную цену последних 6 свечей
}


OrderSend ( Symbol (), OP_BUYSTOP, 0.1,max,3,min,max+0.0022, NULL,0,0, Red);// выставление отложенного байстопа
OrderSend ( Symbol (), OP_SELLSTOP, 0.1,min,3,max,min-0.0022, NULL,0,0, Yellow); // выставление отложенного селлстопа

return(0);
}
 
VladislavVG:

1. there is an SRC button for inserting code - it appears when you write a post.

2. try to describe the algorithm in words, maybe you will understand what is missing. Hint highlighted ;)



Thanks Vladislav!


The hints helped a lot to get the point across!!!

 

Help. What do I need in this indicator to draw lines (in plural) from each fractal to all subsequent ones? From the top ones to the top ones and from the bottom ones to the bottom ones.

Thank you)

Files:
lfv1_3.mq4  5 kb
 
how do I teach my Expert Advisor to identify the nearest local minimum and maximum? But it is the nearest one, not the highest price for a specified number of bars. Maybe the indicator can also be used (which draws points)? But how can it be done? In the iCustom function, the shift parameter indicates only the specified bar. I don't know what to do, please help.
 
webip:
how do I teach my Expert Advisor to identify the nearest local minimum and maximum? But it is the nearest one, not the highest price for a specified number of bars. Maybe the indicator can also be used (which draws points)? But how can it be done? In the iCustom function, the shift parameter indicates only the specified bar. I don't know what to do, please help.
And what should we consider as the nearest minimum/maximum if we don't tie it to bars/time? Is it the previous tick?
 
webip:
how to teach the Expert Advisor to identify the nearest local minimum and maximum? The nearest one, however, is not the highest price for the specified number of bars. Maybe, the indicator (that draws points) can also be used? But how can it be done? In the iCustom function, the shift parameter indicates only the specified bar. I don't know what to do, please help.

Are we clear on the concepts? What is a local minimum/maximum? It is nothing more than the price extremum closest to the current price, either upper or lower.

What is an extremum? An upper one, for example. It is a fractal formed by three candlesticks, with the three candlesticks in a row, and the High of the middle candlestick being higher than the High of the candlestick to the right and to the left of the middle candlestick. To find the nearest fractal, you need to organize the cycle on the bars, starting from the first bar (the zero bar is not yet formed) deep into the history. Once you find the required extremum, you will memorize the number of the bar and the high of its central candle. These two values will be used for further calculations.

 
lottamer:
I want to assign a price value to a variable.



But for some reason, the price is drawn with a four-digit value at 1.3360

Can you tell me the error?
Where is it being drawn?
 
PapaYozh:
Where is it drawn?
You should have offered a brush to draw with: DoubleToStr() and not asked "where?"
Reason: