mql5 - vertical line after a certain time since the last trade - page 6

 
I think I've got it - I've attached the file :)
The line shifts according to the specified algorithm by the specified number of hours since the last trade was closed. I shifted it not by 1/2/24 hours but by 1/2/12 hours, i.e. whole day is too much for respite. In any case, these variables will be moved to external parameters for convenience. Glitch I announced earlier with ACID_NW not even looked, later in the process of testing and possible detection of new glitches will already understand
 
Then I will display in Comment the time of closing the last trade and the time by which the line is shifted, i.e. when I can resume trading after a break. It looks like it should be quite simple, considering that variables with the necessary data have already been created and calculated - just convert the format from seconds to date, but for some reason it didn't work right away :(
 
renatmt5:
Then I will display in Comment the time of closing the last trade and the time by which the line is shifted, i.e. when I can resume trading after a break. It looks like it should be quite simple, considering that variables with the necessary data have already been created and calculated - just convert the format from seconds to date, but for some reason it didn't work right away :(
TimeToString()
 

Sergey, thank you! That's exactly how I tried it, but for some reason I ended up with zero. Didn't take me long to figure out where I went wrong - I don't think it's going to be much of a problem

 
I read another forum explanation about ACID_NW"If at the end of the trading day the bonus funds remain in the account over the permitted limit, their excess will automatically be transferred to your Bonus account. When transferring, you will see the following abbreviations in the balance transaction comment: _ACID_NW, where ACID stands for Automatic Adjustment and NW for Bonus Funds".
Since I have a problem with the indicator because of this - the indicator resets data on the last trade and last day's result, the easiest option I see is to simply remove bonus money from the account altogether. I understand correctly, then by definition this _ACID_NW will not occur? In the process of trading, new bonus funds will not be credited to the trading account, but they will be credited to the bonus account?
 
renatmt5:
I also read about ACID_NW in forum explanation"If at the end of a trading day the amount of bonus funds in your account exceeds the allowable limit, the excess amount will be automatically transferred to your Bonus account. When transferring, you will see the following abbreviations in the balance transaction comment: _ACID_NW, where ACID stands for Automatic Adjustment and NW for Bonus Funds".
Since I have a problem with the indicator because of this - the indicator resets data on the last trade and last day's result, the easiest option I see is to simply remove bonus money from the account altogether. I understand correctly, then by definition this _ACID_NW will not occur? In the process of trading, new bonus funds will not be credited to the trading account, but they will be credited to the bonus account?

Take your time. Run theHistory Deals and Orders script.

Enter the dates From date and To date. Leave Information output as default (it will be output to File name).

After that, to see and open the text file, you need to

  • Step 1: select the File menu and select Open Data Folder;
  • Step 2: In the explorer that opens, successively go to "MQL5\Files" folder.

Paste all information from the file into the post as code (press Alt+S).

 
Made output for a day - can't put it in code, too many characters. Back up with a file or narrow down the interval to a few hours to capture one transaction and the subsequentACID_NW?
 

Corrected the glitch, which caused the indicator to not calculate the profit of the last deal and the day of the last deal on a new day. It turns out that the matter was not in the_ACID_NW operation, but in the fact that the value of from_date variable(initial date, from which the history of deals was loaded) was set incorrectly. In the code, it was described as "from_date=iTime(Symbol(),PERIOD_D1,0)", i.e., as I understood the starting point - beginning of the current day. And should be downloaded history for 24 hours, otherwise yesterday's results were not included. For simplicity, I did not do it for the last 24 hours, but from the beginning of yesterday. 24 hours, and since the beginning of yesterday, iefrom_date = iTime(Symbol(),PERIOD_D1,1) - all was correctly calculated!

 

Guys, please advise on outputting datatime variable value.

I have a variable with datetime string last_deal_day=time[rates_total-1]-fromlastdeal_seconds;

When I output the value of this variable Comment("last_deal_day = ",last_deal_day) I output date and time like "2019.03.21 02:48:19"
How can I split this value into two variables to output date and time separately?

 
renatmt5:

Guys, please advise on outputting datatime variable value.

My variable is set by datetime last_deal_day=time[rates_total-1]-fromlastdeal_seconds;

When I output the value of this variable Comment("last_deal_day = ",last_deal_day) the date and time like "2019.03.21 02:48:19" is output
How can I split this value into two variables to output the date and time separately?

TimeToString


    Comment(TimeToString(last_deal_day,TIME_DATE)+" "+TimeToString(last_deal_day,TIME_SECONDS)
Reason: