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

 
Vladimir Simakov:

IMHO of course, but there is an opinion and I stand by it.

Learning from videos, examples, forums, shouting help mi etc is a direct path to moncey coder. Only textbooks, only docs, only sleepless nights and litres of coffee in search of a solution will make a coder a developer.

I wasn't shouting anything. I'm just asking why c++ algorithm doesn't work here and also to start learning how to write datasets in c++ (which I need to interact with mql, I'd like to see a live example, because it's impossible to understand how it works. In principle such examples should be in the help, otherwise why talk about how to connect dll to mql if you don't have comprehensive information. There are no instructions in help, what do you need to do on the++ side to exchange datitime and color?

 
Seric29:

I wasn't shouting anything. I'm just asking why c++ algorithm doesn't work here, and to start learning how to write datasets in c++ (which I need to interact with mql, I'd like to see a live example, because it's impossible to understand how it works. In principle such examples should be in the help, otherwise why talk about how to connect dll to mql if you don't have comprehensive information. There are no instructions in help, what to do on the part of c++ to exchange datitime and color?

Look. I apologize if I was offended. Regarding writing dll, mql lives in windows ecosystem, the dll you write for windows, windows has a different time format. The link to the official docks I gave you. You can google examples up to ... If you want to learn - learn, if you want to copy, then

The following example converts the Windows API time into Unix time.

#include <windows.h>
#include <wchar.h>

#define  WINDOWS_TICKS_PER_SEC 10000000
#define  EPOCH_DIFFERENCE 11644473600 LL

long long WindowsTicksToUnixSeconds(long long);

int wmain(void) {

    FILETIME ft = {0};
  
    GetSystemTimeAsFileTime(&ft);

    LARGE_INTEGER li = {0};    

    li.LowPart = ft.dwLowDateTime;
    li.HighPart = ft.dwHighDateTime;

    long long int hns = li.QuadPart;
    
    wprintf(L"Windows API time: %lli\n", hns);

    long long int utm = WindowsTicksToUnixSeconds(hns);

    wprintf(L"Unix time: %lli\n", utm);

    return 0;
}

long long int WindowsTicksToUnixSeconds(long long windowsTicks) {

     return (windowsTicks / WINDOWS_TICKS_PER_SEC - EPOCH_DIFFERENCE);
}

Googled it, didn't check it.

 

Example

Hello all! I'm trying to write my EA from my knees. I know my way around scripts intuitively, thanks to google. I even found a script to change the colour of the terminal and candlesticks.

I would also like to instal my own name and logo but there is nothing similar. Maybe there's one for more advanced users but I'm not too keen on writing it myself.

I would be grateful for help. I don't know who to turn to...

 
dmitriikirov43:

Hello all! I'm trying to write my EA from my knees. I know my way around scripts intuitively, thanks to google. I even found a script to change the colour of the terminal and candlesticks.

I would also like to instal my own name and logo but there is nothing similar. Maybe there's one for more advanced users but I'm not too keen on writing it myself.

I would be grateful for help. I don't know who to turn to anymore...

Study object types. There are examples at the links on object types.

Note OBJ_LABEL and OBJ_BITMAP_LABEL

Документация по MQL5: Графические объекты / ObjectCreate
Документация по MQL5: Графические объекты / ObjectCreate
  • www.mql5.com
[in]  Номер подокна графика. 0 означает главное окно графика. Указанное подокно должно существовать, в противном случае функция возвращает false. Возвращает true при успешной постановке команды в очередь указанного графика, иначе false. Если объект был уже создан ранее, то производится попытка изменить его координаты. При вызове ObjectCreate...
 
Artyom Trishkin:

Study the object types. There are examples by the links on object types.

Pay attention to OBJ_LABEL and OBJ_BITMAP_LABEL.

You should know how much I try to integrate and compile this information. It does not work, well, it just won't. That is why I decided to write here. I was saved at some point by a video on youtube and nothing happened in this respect.

 
dmitriikirov43:

If you only knew how long I've been trying to understand this information and compile it. I can't get it to work. That's why I decided to write here. I was saving a video on YouTube for some reason, but in this respect I'm at a complete loss.

There are even examples...

Just copy it into an editor, compile and run it... And then practice changing anything in it and watch the changes...
 
Artyom Trishkin:

There are even examples...

Just copy it into an editor, compile and run it... And then practice changing anything in it and watch the changes...
I looked at that too, it didn't work to connect it to the main robot script. I am new at this, or maybe I cannot put a lot of things in one EA, I have no idea.
 
dmitriikirov43:

Hello all! I'm trying to write my EA from my knees. I know my way around scripts intuitively, thanks to google. I even found a script to change the colour of the terminal and candlesticks.

I would also like to instal my own name and logo but there is nothing similar. Maybe there's one for more advanced users but I'm not too keen on writing it myself.

I would be grateful for help. I don't know who to turn to...

It's funny...

Does the Expert Advisor make profit? Or the most important thing in it is the logo and the trinkets?

Basically: Start by making an attempt, show the code with as much detail as possible and then we'll have a substantive discussion. Otherwise, there's nothing to add to what Artyom said.

 

Hurrah, hurrah hurrah .... Somehow I magically googled an abandoned forum.

Turned out to be easy, as it turns out. Maybe it will be useful for someone...

Insert it in int OnInit() in line ObjectSetText, change it for your parameters, and all done!

All we have to learn how to place logo in bottom right corner, and somehow it should load

bmp file from MQL4\Images folder, who might know it?

{

   // сейчас мы создадим текстовую метку.

   // для этого, как всегда, используем функцию ObjectCreate.

   // координаты указывать не нужно

   ObjectCreate("signal",OBJ_LABEL,0,0,0,0,0);

 

   // изменяем координату х

   ObjectSet("signal",OBJPROP_XDISTANCE,610);

 

   // изменяем координату у

   ObjectSet("signal",OBJPROP_YDISTANCE,10);

 

   // чтобы указать текст метки, используем эту функцию

   ObjectSetText("signal","Scalper",18,"Arial Black",Black);

   // "signal" - название объекта

   // "lambada" - текст метки

   // 14 - размер шрифта

   // Gold - цвет

 

   return(0);

}
 
Alexey Viktorov:

That's funny...

Is the advisor profitable? Or is the most important thing about it the logo and the frills?

In essence: Start by making an attempt, show the code with as much detail as possible and then there will be a substantive conversation. Otherwise, there's nothing to add to what Artem said.

Glad you found it funny. Since I'm just starting out, I'm trying to learn how to do the look as well. As far as profits and strategy,

There are a lot of scripts available and it is easier to write and change later. This is where I try to find the answers

I can't find the answers to on the Internet or I can't figure out how to implement it. Above I wrote how I solved one of the 2 questions.

I think a dummy like me will understand how to use it)))