Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1320

 
Aleksei Stepanenko:

Uh...

that?

Yeah. Sort of. The brain is nonetheless one-dimensional, even with Lobachevsky curves)))) One-dimensional arrays are named, but multidimensional arrays need to remember what is what. and in a structure, the name is separated by a point with another name, there are more letters... ))) Yes it is, structures don't want yet. Later)))))

Thanks)

 
MakarFX:

There are a lot of unnecessary brackets in the code to begin with

and to see what the problem is without reading the code, you need to run it in the tester

about unnecessary brackets - I have rewritten it all in this way

if(ao_buy!=EMPTY_VALUE && OrdersTotal()==0)
  {
  OrderSend(Symbol(),OP_BUY,lot,Ask,slippages,Bid-sl*Point,Bid+tp*Point,"ДИВЕРГЕНЦИЯ НА БАЙ ao"); // ОТКРЫВАЕМ БАЙ ОРДЕР
  }
if(ao_sell!=EMPTY_VALUE && OrdersTotal()==0)
  {
  OrderSend(Symbol(),OP_SELL,lot,Bid,slippages,Ask+sl*Point,Ask-tp*Point,"ДИВЕРГЕНЦИЯ НА СЕЛ СТОХАСТИК"); // ОТКРКЫВВАЕМ СЕЛ ОРДЕР
  }
  
  //- СТОХАСТИК ПОЗИЦИИ
  if(stohastic_buy!=EMPTY_VALUE && OrdersTotal()==0)
  {
  OrderSend(Symbol(),OP_BUY,lot,Ask,slippages,Bid-sl*Point,Bid+tp*Point,"ДИВЕРГЕНЦИЯ НА БАЙ ao"); // ОТКРЫВАЕМ БАЙ ОРДЕР
  }
if(stohastic_sell!=EMPTY_VALUE && OrdersTotal()==0)
  {
  OrderSend(Symbol(),OP_SELL,lot,Bid,slippages,Ask+sl*Point,Ask-tp*Point,"ДИВЕРГЕНЦИЯ НА СЕЛ СТОХАСТИК"); // ОТКРКЫВВАЕМ СЕЛ ОРДЕР
  }

If the condition is true, we do not open the position and pass control further on in the code. If the condition is false, we simply pass control further in the code.

About the tester. I launch it in the tester. If I set "ao" to "yes", the orders are opened well. But if I set no Ao and yes to stochastic, nothing happens. I thought it was a problem, I added a stochastic on the chart with the same parameters as in the EA. I have also added stochastic lines, but nothing happens anyway :-( I can't figure out what kind of magic happens((((

 
Andrey Sokolov:
DanilaMactep, perhaps you should shorten the question considerably. I'm guessing that not many people would want to "clean it up" for free.

I've recorded an abbreviated version of the question in a video and posted it, but no one has given me any good advice. I'm posting the video again, maybe you can give me a hint.


P/S I'm not high, I'm not stoned, I'm not drunk. My voice is like this because of the effects of a stroke and a 1.5-month coma.

 
DanilaMactep:

about unnecessary brackets - I rewrote it all in this way

If the condition is true, we don't open the position and pass control further in the code. If the condition is false, we simply pass control further in the code.

About the tester. I launch it in the tester. If I set "ao" to "yes", the orders are opened well. But if I set no Ao and yes to stochastic, nothing happens. I thought it was a problem, I added a stochastic on the chart with the same parameters as in the EA. I drew the stochastic line, but nothing happens anyway :-( I can't understand what kind of magic happens((((

i see, you have a signal indicator ? try to put your indicator name in the EA

Files:

Exp_FilterSignal.mq432 kb yellow highlight where you should enter the name of your indicator

input string   _Orders_="------ Parameters Order ------"; //
input double   TakeProfit       = 500;           // Take Profit
input double   TrailingStop     = 300;           // Фиксированный размер трала
input double   TrailingStep     = 50;            // Шаг трала
input string   short_name       = "FilterSignal";// Name Indicators
input bool     InpOnlyOne       = false;         // Close opposite
input bool     ObjRevers        = false;         // Revers
 
SanAlex:

I see, you have a signal indicator? try to put your indicator name in this EA

Files:

Exp_FilterSignal.mq432 kb marked in yellow where you should enter the name of your indicator

I downloaded the Expert Advisor. Inserted the name of the indicator. I compiled it and put it on a chart - nothing happened.

I ran it in the tester, the test runs, but I don't see any data in the comments or in the logframe. That's why I don't understand what all this manipulation was for and what can I do or get with this EA?

p/s I can not understand other people's code because of serious limitations after the stroke (texts from the screen myself do not read, and reads me the extension in the browser, and if the Russian words are still normally understandable. If Russian words are still understandable, then the code is not clear at all(((((((), so I do not understand the essence of the Expert Advisor Exp_FilterSignal.mq4. Can you explain in words what to do with the Expert Advisor?

 
DanilaMactep:

Downloaded the expert. Entered the name of the indicator where it was shown. I compiled it and threw it on the chart - nothing happened.

I ran it in the tester - the test is running, but I do not see any data anywhere - nothing in comments or in the log. That's why I don't understand what all this manipulation was for and what can I do or get with this EA?

p/s I can not understand other people's code because of serious limitations after the stroke (texts from the screen myself do not read, and reads me the extension in the browser, and if the Russian words are still normally understandable. If Russian words are still understandable, then the code is not clear at all(((((((), so I do not understand the essence of Expert Advisor Exp_FilterSignal.mq4. Can you explain in words what to do with the Expert Advisor?

If it hasn't opened from your Indicator in the Strategy Tester, it means you don't need it.

I just saw that the indicator has arrows and these arrows transmit a signal.

-------------------------------------------------------------------

to understand how it works - try it with this indicatorhttps://www.mql5.com/ru/code/7361

SilverTrend_Signal
SilverTrend_Signal
  • www.mql5.com
StepMA_v6 Индикатор торговой системы pabloski. SmPriceBend-T01 Индикатор первой производной изменения цены или попросту индикатор скорости и знака тренда.
 
Hi all!

How to implement the following task:
1) Allow trading only within a pattern that I have somehow drawn on the chart (rectangle, inside a channel, triangle, ellipse)?
2) A manually defined (drawn) line and above it e.g. sell, below it buy.

MA or iSAR should not be considered, it is a graphic indication that interests me. How to implement? I know mql basics but not much else.
 
Порт-моне тв:
Hello all!

How to implement the following task:
1) Allow trading only within a pattern that I have somehow drawn on the chart (rectangle, inside a channel, triangle, ellipse)?
2) A manually defined (drawn) line and above it e.g. sell, below it buy.

MA or iSAR should not be considered, it is a graphic indication that interests me. How to implement? I know the basics of mql but not much more.

All shapes have properties that allow you to see if the price is within the shape at any time.

OBJPROP_TIME

Time coordinate

datetime modifier=number of anchor point

OBJPROP_PRICE

Price coordinate

double modifier=number of anchor point

 
Aleksey Mavrin:

All shapes have properties, which can be used to determine if the price is inside or outside a shape at any time.

OBJPROP_TIME

Time coordinate

datetime modifier=number of anchor point

OBJPROP_PRICE

Price coordinate

double modifier=number of anchor point

Thank you, that's how I imagined it. And then how? I couldn't find any information on the solution on the net. If you are able to do so, please send me a link to examples or code.
 
Hello! In the chart settings there is an option to "show trading history". How is it implemented in the code? I cannot remove it programmatically. Thank you.
Reason: