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

 
Roman:

Because there are a lot of inconsistencies with current realities.
And you're trying to make excuses for those inconsistencies.
On the contrary, I wrote that a tick does not equal a point!
It's your own internal, invented point.
In view of the fact that Point used to correspond exactly to a point, when there was only a four digit.
But after the introduction of the fifth digit, you started making up names with your excuses.

No, it isn't. You suggested that the distance should be shown not in points, but in tick sizes.

That is nonsense. Distance is distance. And the tick size is the step by which price moves minimally at one time.

That's why you're not asking for the distance from point A to point B, but the number of steps it takes to move that distance.

I'm telling you - it's all mixed up...

Your reality is a bit of a cutthroat one. It doesn't contain half of the accepted concepts. There is something from your head.

 
Roman:

Probably because you have to return the return value from the function.

Thanks for the reply, but still no solution to the problem... I need the function parameter "str" to return to MQL its changed state

extern "C" __declspec(dllexport) wchar_t* __stdcall ToString(wchar_t* &str)
{
        str = L"-- Я изменил параметр str :) --"; // Вот это я хочу получить!
        return L"--- Привет! ---";
}

In MQL4 at this time:

#import  "Win32Project1.dll"
   string ToString(string &str);
#import

Well and the function call itself:

string str = "";
Print("-> Метод: " + ToString( str ));
Print("-> Параметр: " + str);

The result is this:

I.e., the value is passed as a parameter, but it's not correct... How do I solve this problem? :)

 
Vadim Lin:

Thanks for the reply, but still no solution to the problem... I need the function parameter "str" to return to MQL its changed state

In MQL4 at this time:

Well and the function call itself:

The result is this:

I.e., the value is passed as a parameter, but it's not correct... How do I solve this problem? :)

The gentleman rests for 24 hours for trolling.
 
Artyom Trishkin:

If the terminal crashes, it will have to be restarted. The indicator will have to be placed on the chart again, or to run the Expert Advisor, which uses the data of this indicator (then the Expert Advisor will load this indicator itself when accessing it). In this case (and even at normal restart of the terminal with an automatic loading of programs installed on the chart), the indicator will draw all of its lines anew - there is no need to save anything. These lines can be re-read later. Moreover, they have to be read anyway.

For the EA to monitor only lines created by the indicator, it is enough to look at names of lines created by the indicator and try to find the repeating substring in names - the same for all lines. Look for the necessary lines by these substring.

It's simple - just look at the list of objects when the indicator is running.

We are digressing from the subject! The further we discuss, the more off-topic it gets! :)

The man just needed to get the EVENT, when the price crosses the line...

Next, I began to speculate why my example was "problematic"... Although in fact it solves the problem, which in principle was set. Next - the author's imagination, I helped as much as I could))


If it's off-topic... and overload the terminal, the lines won't go anywhere, and there's a chance they'll stay in their places. If they're renamed, or tagged - you can use conventional logic to figure out that these lines have already been triggered at some point, and should be ignored. But that's not the task at hand)) Besides, suppose the indicator re-draws the lines, so what? How will you determine that some of them have already triggered?))

If there's nothing on the chart, except for lines that need to be monitored (as the author says), then they don't even need to be filtered by name.

But of course, the idea is not to draw any lines at all, but save all levels in a file and check which of them have already worked. And overload the terminal, you will remember them without names of objects)).

 
Roman:

Where the hell is the logic in guys.
For this reason it is a gross error, and if done so intentionally, it's a diversion))

Petya: And what is logic, Vasily Ivanovich?

V.I.: Well, it's simple, look, do you have matches?

Petya: I do!

V.I.: So you smoke, and if you smoke, you drink, and if you drink, you go out with girls, understand?

Petya: Yeah, it's simple!

Petyka to a passing Red Army man: do you have matches?

Red Army man: No.

Petya: So you're a "faggot".



LOGIC, well, it's so strange, and under LOGIC, you don't have to adjust your expectations

If a developer built in a new data type ENUM_TIMEFRAMES, he will make further use of it in other parts of the program - that's the logic.


SZS: Of course, it could be argued that MT4 was designed by people who knew what was necessary for trading, while the "other terminal" was written by a group of aliens ..... But we will go beyond the communication format of this forum, that's why we shouldn't talk about subversions - we use what we were given, what we lack - we write it ourselves, thanks to the productivity of the trading terminal is too high

Like this

 
Igor Makanu:


LOGIC, well it's so weird, and under LOGIC, you don't have to adjust your expectations

If the developer built in a new data type ENUM_TIMEFRAMES, it means he built in further use of this type in other parts of the program - this is the logic


SZS: Of course, it could be argued that MT4 was designed by people who knew what was necessary for trading, while the "other terminal" was written by a group of aliens ..... But we will go beyond the communication format of this forum, that's why we shouldn't talk about sabotage - we use what we were given, what we lack - we write it ourselves, thanks to the terminal performance is more than enough

like this

good thing they don't look for logic in syntax so often)))) The logic in the speed is seen in the case of timeframes but I may be wrong)

 
Igor Makanu:

Petya: And what is logic, Vasily Ivanovich?

I've heard another version:

Anka eats herring? Then she drinks water...

The logical conclusion is that she... can.

 
Vadim Lin:



BUT, what if the Bid for some reason crossed the line, and was not equal to the line price, then what...? Provide then at least a variable, in which previous tick is stored, and if there was a new tick crossing your line - then do some action... But in this case do not forget to provide "permissible" crossing, because if the market opens with a large Gap, or there is a large jump in price, you will open on many lines in one go and probably not on the place you want. If the crossing is more than acceptable, you will only get a message...

Thanks for the help, the action takes place when you set the lines manually and crossing these lines, but for some reason the EA does not see the indicator lines and does not perform the action I have specified. All indicator lines have the following phrase in the name @Line (plus the numbering "week-4" which changes) - can this be used somehow?

//+------------------------------------------------------------------+
void OnTick()
  {
//---
        iCustom(Symbol(), 0, "ITS-Level Gun", 0, 0);  
 
        for(int i = ObjectsTotal() - 1; i >=0; i--) {

// все что не горизонтальные линии - игнорируем

        if(ObjectType(ObjectName(i)) != OBJ_HLINE) continue; 

        double PriceLine = NormalizeDouble(ObjectGet(ObjectName(i), OBJPROP_PRICE1), Digits());
        
// измените условие Bid == PriceLine
        
             if(Bid == PriceLine)
             {
  {OrderSend(Symbol(),OP_BUY,0.1,Ask,3,Bid-15*Point,Bid+15*Point);}
        } 
  
  }
  }
//+------------------------------------------------------------------+
Files:
 
Wrongly written: the name of the lines themselves does not change, but all have the common phrase@Line in their name
 
Fib0 RU:
Wrongly written: the name of the lines themselves does not change, but all have the common phrase@Line in their name
if(Bid == PriceLine)

It won't go away.

read

Особенности работы с числами типа double в MQL4
Особенности работы с числами типа double в MQL4
  • www.mql5.com
При программировании на языке MQL4 у новичков порой возникают ситуации, когда результаты некоторых математических вычислений отличаются от ожидаемых. При этом программа компилируется и работает, но не так, как нужно. Они начинают разбираться в программе, находят новые "ошибки" в языке, реализации функций и т.п. В большинстве случаев последующий...
Reason: