Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 220

 
bambastik:

And if we need to reset only 3 buy orders out of 5 buy orders out of all available, the value of which is the biggest, the script is larger artmedia70? And one more question, if I'm not bothering to ask, because these checks take all the time, I wonder which script has a higher probability of overshoot, the one with checks or the one without checks for errors?

Of course, in this case the size of the code will increase. From all available positions that correspond to the type we need, choose three that have the highest profit, enter their tickets into an array and then take tickets in the loop from the array and close them.

Both of them may pass by, irrespective of code size, in the way they are now. To avoid this situation, you need to further refine the scripts - I've shown you only the general concept, not a ready-made script, which you can unashamedly place in a database.

 
spec01:
can you write: a script/advisor to close two opposite orders for profit in n*pips?
I can, no problem. That'll be 100 quid.
 

Hello, help me understand how to average a position.

If an order is opened and it is in deficit, another one is opened in the same direction on the signal. ТР is transferred to the no-loss on these two or more orders.


Or is there a feature that sets TP or SL without losses relative to orders that are set in the same direction?

Please help me, I just can't finish an idea.

 
artmedia70:

Of course, in this case the size of the code will increase. It will be necessary to select three of all available positions, corresponding to the required type, which have the highest profit, enter their tickets in the array and afterwards, take tickets in the loop from this array and close them.

Both of them may pass by, irrespective of code size, in the way they are now. To avoid this situation, you need to further refine the scripts - I just showed you only the general concept, not a ready-made script, which you can unashamedly put in a database.


I've already seen why it's better not to put them in the database. i think i'll sort it out with arrays as well, now i'm itching to use these two scripts, but i don't have a good one yet) if i do figure out the arrays, i'll buy or sell, i also need a ceiling identifier, it would be a perfect set of tools, this is a great forum.
 
bambastik:
Now it's all clear why it's better not to put them in the base. I think I'll figure it out with arrays as well, now I'm itching to use these two scripts, but I don't have a suitable situation yet) I'll do three buy or sell if I figure it out with arrays, I also need a ceiling identifier, it would be a perfect set for me, this forum is great.
Ceiling? What ceiling? And what kind of three-buy and three-sell set are you talking about?
 
artmedia70:
Ceiling? What ceiling? And what buy and sell are you talking about?

i have three orders, 2 buy 1 sell, buy more than sell, i need to get two numbers - one, if the chart will go down, at what point the system will reset the order itself (at least approximate, because i think the system will reset the order at such a point).

If the chart goes down then at what point the system resets the order (at least approximate, because I do not think to get an accurate view of the spread) and the second turns out to be higher than 9.00000, if the second is in the plus - to output 9 and all. and the same for the reverse situation with more sell orders buy ie, when the chart moves up to the reset point and below 9 and all.

i can place a script on the keyboard and i can buy or sell in the amount specified in the script - for example, any)

 

I don't have enough time during working hours to analyse and test it, I would like to do it at weekends. I found information on the forum with examples of implementation of such code. I can't get it to work, if I'm doing it correctly, I open chart on weekends when there is no price movement and put EA on it, it should work, but I get silence, but when I get a tick during working hours it works, please help me to correct it. I would like to thank you in advance so as not to clutter up the forum.

#import "user32.dll"
   int   RegisterWindowMessageA(string lpstring);
   int   PostMessageA(int  hWnd,int  Msg,int  wParam,string lParam);
#import
#define WM_COMMAND      0x0111
//+------------------------------------------------------------------+
void start(){
   Sleep(100);
   PostMessageA(WindowHandle (Symbol(), Period()), 
   RegisterWindowMessageA("MetaTrader4_Internal_Message"), 2, 1);
   GlobalVariableDel(Symbol()+"_Start");
   Alert("обновление прошло");
   return;
}

As far as I'm concerned an alert should go off and confirm everything is correct, but alas.

 
penzacity:

I don't have enough time during working hours to analyse and test it, I would like to do it at weekends. I found information on the forum with examples of implementation of such code. I can't get it to work, if I'm doing it correctly, I open chart on weekends when there is no price movement and drop EA on it, it should work, but I get silence, but when I get a tick during working hours it works, please help me to correct it. I would like to thank you in advance so as not to clutter up the forum.

As far as I am concerned an alert should go off and confirm everything is correct, but alas.

Start() starts when the tick comes. You don't see them on weekends. Look for a tick emulator, it might help.
 
artmedia70:
start() is started when a tick arrives. There are no ticks on weekends. Look for a tick emulator, it may help.

I found on the forum that this is possible: https://www.mql5.com/ru/forum/141467

And where can I find a tick emulator?

So, it is not possible to implement tick emulation during weekend with MQL4?

 
penzacity:

I found on the forum that this is possible: https://www.mql5.com/ru/forum/141467

And where can I find a tick emulator?

So it's not possible to implement tick emulation at weekends with MQL4???

It's on the page you linked to in your post. Read it carefully.