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

 
Artyom Trishkin:

There are a lot of people here who can achieve almost any results.

The important thing is that you try to do it yourself, and not beg others to do it for you. They are always ready to help, but to help, not to do it for you.

I've done as much as I could, I've tried it a bunch of times. I realized that my writing is not correct at all, and I don't know how to get it right, so I'm asking for some help.

 
vebster005:

I've done as much as I could, I've tried it a bunch of times. I realized that I have not written it correctly at all, and I do not know how to do it correctly, I'm asking you to help me at least in some way.

You need to be clear about what you want - the right question is half the solution.

I, for example, did not understand either the code or the questions, what was supposed to be...

 
Maxim Kuznetsov:

Write down exactly what you want - the right question is half the solution.

I, for example, did not understand either the code or the questions, what was supposed to be...

ok, the server time should be displayed! but the code should be put in the button
The button should be pressed and the server time should be shown on the screen, but as soon as you want to hide it, press the button and it disappears (disappears or is deleted, does not matter), and the server time should be displayed and work correctly (ie, so that there was no delay)


Tonight, I'm trying to achieve this effect, and I understand that if you do not add code to Oncalculator, then the time freezes (and does not go), but as soon as we add it when you click the button (to hide it), it disappears and then displayed, and I do not know how to solve this problem
 
vebster005:

OK, the server time should be displayed on the screen! But the code should be put into the button
and the button should be pressed and the server time should be displayed, but as soon as you need to hide it, press the button and it disappears (disappears or is deleted, not the point), but the server time should be displayed and work correctly (so there should be no delay)


Tonight I'm trying to achieve this effect, and so I understand that if we do not add code to Oncalculator then time freezes (and does not go), but as soon as we add it, when you click on the button (hide it) it hides and immediately displayed, and I do not know how to solve this problem

Create button, as you did, then in timer (OnTimer) change text (OPJPROP_TEXT) to calculated time. When you press it, delete it (or off screen like you did), but don't forget to return it later, otherwise you'll have a "button missing" theme

Why do you need OnCalculate? it may be called once per minute, for example - no ticks, nothing to count

 
Maxim Kuznetsov:

You create a button like you did, then in the timer (OnTimer) you change its text (OPJPROP_TEXT) to the calculated time. When pressed, delete it (or behind the screen as you did), just don't forget to return it later, otherwise there will be a "missing button" theme

Why do you need OnCalculate ? it can be called once a minute for example - no ticks, nothing to count

DONE! Thank you very much!

 
Maxim Kuznetsov:

Create a button, as you did, then in the timer (OnTimer), change the text (OPJPROP_TEXT) to the calculated time. When the button is pressed, you delete it (or off-screen as you did), but don't forget to return it later, otherwise there will be a "button missing" theme

Why do you need OnCalculate? It can be called once a minute for example - no ticks, nothing to count

Could you also help, similar problem, but instead of time you need to put Balance, i.e. to change balance with each tick.

here's the code:
//--- Мани
   double tu = GetProfitOpenPosInPoint();
   double tp = GetProfitOpenPos();
   double tr = tp * 100.0 / AccountBalance();

   string text = DoubleToStr(tu,1) + " пп";
   text += " | " + DoubleToStr(tp,2) + " " + AccountCurrency();
   text += " | " + DoubleToStr(tr,1) + "%";

      SetLabel1("Баланс", text, ColorOnSign(tp), 6, 18, 3, 9);
//--- Мани
I insert it into Oninit and OnCalculate (so that it would update on every tick) and respectively on pressing the button I put X coordinate 7000 to hide and 5 to show, but .... does not update on tick, why?
 
vebster005:

Could you also help with the same problem, but instead of time you need to put Balance, i.e. with every tick the balance changes.

Here is the code:
I put it in Oninit and OnCalculate (in order to be updated with each tick) and, respectively, when you click on the button to put the coordinate on the X 7000 to hide and 5 to show, but .... does not update on tick, why?
If you are using this code, why reinvent the wheel?
i-Profit
i-Profit
  • www.mql5.com
Реальный автор: Ким Игорь В. aka KimIV Этот индикатор показывает прибыль в пунктах и в валюте депозита: текущую, за сегодня, за вчера, за три предыдущих дня раздельно за каждый, за текущую неделю, за текущий месяц, за текущий квартал, за текущий год и начиная с некоторой пользовательской даты. Значения прибыли и убытка индикатор показывает...
 
vebster005:

Could you also help, similar problem, but instead of time you need to put Balance, i.e. with every tick the balance changes.

Here's the code:
I put it in Oninit and OnCalculate (to be updated at every tick) and respectively on pressing the button put coordinate X 7000 to hide and 5 to show, but .... does not update on tick, why?

I'm watching your problems with the messages and they remind me of this.

Well, you can not set tasks like that.

Проблема XY
Проблема XY
  • www.mql5.com
Что за «Проблема XY»?Это ошибка, которая зачастую приводит к бессмысленной трате времени как просящего о помощи, так и тех, кто пытается ему отвечать. Её ещё называют «Проблемой Молотка». Суть её
 

Hello. I am new to this business. I am using an EA that simultaneously trades all currency pairs using martingale. Gradually the total profit increases and I need to close all trades and start again from the starting lot, as the total profit is received, but for that I have to manually change the magic numbers on all 30 windows, as after closing the orders manually and starting auto trading the EA starts to continue the previous session and opens new orders with the same large multipliers. Is there any easy way to get the EA to start trading with a clean slate?

***

 
gifrom:
Hello. I'm new to this business. I am using an EA that simultaneously trades all currency pairs using martingale. The total profit is gradually increasing and I have to close all trades and restart from the starting lot, as the total profit is received, but for that I have to manually change magic numbers on all 30 windows because after I close orders manually and start autotrading the EA starts to continue the previous session and opens new orders with the same high multipliers. Is there any easy way to get the EA to start trading with a clean slate?

Try removing the EA from the chart rather than just turning auto-trading on/off.

Reason: