[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 1103

 
IgorM:


Glance at the code, try to create an external variable and use it to change in this line:

datetime cDay = iTime(NULL,PERIOD_D1,0) + (GMT-Period()/60.0)*3600;

instead of zero, this variable

Zero is the last bar. I thought you wanted to set the bar number yourself.

I tried it but no reaction, in my opinion there is a simple comparison of type if it is not equal.

datetime cDay = iTime(NULL,PERIOD_D1,0) + (GMT-Period()/60.0)*3600;
if (cDay != prevDay || fTime)

{

and at the end, there's no more cDay in the code.

prevDay = cDay;
}

return(0);

}

It seems to me that this part of the code has an effect on coordinates, there is an external variable GMT, although I could be wrong.

for (shift=0;shift<=CountDays;shift++)
{
ny_time[shift] = iTime(NULL,PERIOD_D1,shift) + (GMT-Period()/60.0)*3600;
ny_shift[shift] = iBarShift(NULL,0,ny_time[shift]);
ny_close[shift] = iClose(NULL,0,ny_shift[shift]);


int t = iTime(NULL,PERIOD_D1,shift+1) + (GMT-Period()/60.0)*3600;
int s = iBarShift(NULL,0,t);
ny_open[shift] = iOpen(NULL,0,s-1);

}

Thanks anyway, for your attention).

 
IgorM:


everything can be done, if only to understand what needs to be done )).

Here's an Exel search of the forum https://www.mql5.com/ru/search\

output to a file, also not difficult https://book.mql4.com/ru/functions/files

If you exchange data between indicators/experts of one terminal, it may be simpler - via global variables

you cannot draw tables but you can ;) https://www.mql5.com/ru/code/8724

Well, look around, everything has been already invented before you ))))

Well, let's go, it's quite a load!!! Perhaps a meeting soon, if I start to be stupid again.


I wish you all the best

 
Eliza:

I tried it but there is no reaction, I think it's just a comparison of type if not equal.

It is true, I looked again at the code, it is much more complicated, the CountDays variable is used, and from the current bar to this variable several cycles will run, that draw the lines

this indicator probably cannot be rewritten for your purposes

 
drknn:


The server does not let you trade - it must be a holiday, or there is no checkbox in the terminal settings to allow trading. Put it like this (Service - Settings):

If your replies show that you know many things, may I close all orders and deals at once? My question is as follows: i have 5 open deals, 10 pending deals. T/P for one of 5 deals triggers. At this moment we need to cancel all pending orders and close 4.

 
Danil93:

I see that you know a lot of things, but is it possible to close all orders and deals at once? Here's the problem: 5 deals and 10 pending deals have been opened, T/P for one of 5 deals has triggered. At this moment we have to cancel all pending orders and close 4.


It takes some time to close the market and delete the pending ones.

But all this can be done within a limited time (unless the orders are in the freeze zone of course)

 
Danil93:

is it possible to close all orders and trades at once?

there was some discussion here yesterday https://www.mql5.com/ru/forum/131030

and search the forum there should be scripts in kodobase to close everything

 
I need help, four days walking around the forums, no one gives an answer to my questions, maybe someone here will answer, I'm a beginner and just starting to work in forex, I downloaded an EA hepard3,2,1 and graal, copied, pasted into the folder eykspert, opened, compiled, reloaded the terminal, EAs appeared in the terminal, attached to the chart, they work, I decided to try other EAs, I followed the same path, I tried to put them on other terminals, but there was no result. And another question--I putthe EA on one account and on one chart--it appears on all the charts of other accounts, when I put another EA on another account--on all accounts appear on the last EA, how to do that on different accounts there are different EAs?i can install different EAs on different terminals--I downloaded MT4 terminal again from the same brokerage company, i passed the installation, but on the desktop i had the same terminal shortcut--and i still have, advise what to do?
 
delic:
I need help, four days walking around the forums, no one gives an answer to my questions, maybe someone here will answer, I'm a beginner and just starting to work in forex, I downloaded an EA hepard3,2,1 and graal, copied, pasted into the folder eykspert, opened, compiled, reloaded the terminal, EAs appeared in the terminal, attached to the chart, they work, I decided to try other EAs, I went the same way, I tried to put them on other terminals, but there was no result. And another question--I put the EA on one account and on one chart and it showed on all of the charts of other accounts, when I put another EA on another account, in all accounts I again see the latest EA, how should I do that on different accounts there are different EAs?i can install different EAs on different terminals--I downloaded MT4 terminal again from the same brokerage company, i passed the installation, but on the desktop i had the same terminal shortcut--and i still have, advise what to do?
I think even on this forum will not help you.
 
Where to look for a solution to the following problem: buy position, no loss. If the price went down by 20 points, the loss is set at the opening price, if the price went further, and reached -40 points, the loss is set: the opening price - 20. like this? if not difficult how would the code look like?
 
Danil93:
where to look for a solution of the following problem: buy trade, no loss. If the price went down by 20 pips, the loss is set at the open price, if the price moved further and reached -40 pips, the loss is set at open price -20. like this? if not hard, how would the code look like?

Maybe it's because I'm sleepy, but I don't understand the conditions...

A Buy trade, its profit is equal to 10 pips OrderStopLoss() is equal to 0. When the price falls 20 points, the position's profit will be -10 points (we do not take the spread into account). At the same time, we cannot place StopLoss, because a stop order can be placed at a distance of at least the opening price minus the StopLoss level.

Your conditions are somehow wrong - always the stop position is higher than the Ask price while the open price is even higher.
To put it this way:
open price = 100, Ask price = 110 - no stop on position,
price has fallen by 20 pips: Ask = 90, stop should be set at open price = 100, but the stop level is already higher than the current price, which is at 90...
... and so on - you try to keep the stop not below but above the current price...

What's the trick?

Reason: