[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 633

 
7777877:

Can you tell me if there is any way to dump more than 4 MB of code here (or to dump it here in parts?) ?

All my code I created in five years is 22 megabytes. That's several thousand indicators, expert advisors and scripts
 
My code is 15 kB( mq4file size ), but when I try to send it (using the srs link in the string with the tools), I get a message that my message exceeds the size and the message is not sent. Since it says at the bottom that the maximum file size is 4 MB, I figured that somehow the processing of my question is increasing the size of the file
 
7777877:
My code is 15 kB (mq4 file size), but when I try to send it (using the srs link in the string with the tools), I get a message that my message exceeds the size and the message is not sent. The line below says that the maximum file size is 4 MB, so I figured that somehow the processing of my question, there is an increase in the size of the file.

Use the link below Attach file
 
Vinin:

Use the link below Attach file
Files:
rsis.mq4  16 kb
 
TarasBY:

This task requires clarification:

  • Your input parameters (STPOLOSS, TAKEPROFIT, etc.) must be entered with 4\2 digits in mind!!!

Igor and Viktor, thank you very much!
 
7777877:
Read about arrays in the documentation. One option is to make a static array, i.e. an array with a predefined size: double a[55443]; another option is to make a dynamic array, i.e. to declare an array of undefined size double a[], and then determine/calculate the size we need in the program code: ArrayResize(a,N)
 

Please, help me to understand:)
How to move a pending order?
Tried deleting it first and putting a new one in, but it doesn't work

int NewOrder(int Cmd,double Lot){

...

TP=PR+TakeProfit*Point;

SL=PR-StopLoss*Point;

Proverka();

tic=OrderSend(Symbol(),Cmd,Lot,PR,5,TP,SL,0,1,0,CLR_NONE);

if(tic<0) {Print("Order open error: ",GetLastError());

return(0);}

//+------------------------------------------------------------------+

void Proverka()

{

for(int i=1; i<=OrdersTotal(); i++) // Order loop

{

if (OrderSelect(i-1,SELECT_BY_POS)==true)

{

if (OrderSymbol()!= Symbol()) continue;

if (OrderType() == OP_BUY || OrderType() == OP_SELL) continue;

int tic=OrderTicket();

OrderDelete(tic); Print("Delet",tic);

}

}


}

//+------------------------------------------------------------------+

 
Ali007:

Please help me to understand:)
How do I move a pending order?
I tried to delete and put a new one, but it didn't work.

If your order type does not change, you can move it by selecting it by OrderTicket(), using the OrderModify() function, where you specify the new open and STOP prices.

...And the values of variables passed to trading functions need to be normalized (price, STOP). And this loop of order enumeration:

for(int i=1; i<=OrdersTotal(); i++) // Цикл перебора ордер

it would be better to replace it with the reverse one:

for(int i=OrdersTotal() - 1; i >= 0; i--) // Цикл перебора ордер
{
   if (OrderSelect (i, SELECT_BY_POS)==true) 

StopLosses are also not organized correctly:

TP=PR+TakeProfit*Point;
SL=PR-StopLoss*Point;

Stops will be calculated differently for different types of pending orders.

TIP: If you still have difficulties yourself, get ANY kind of Expert Advisor working with pending orders and take from it either functions for working with orders or calculations of their STOPPs.

 
TarasBY:

If your order type does not change, it can be moved by selecting OrderTicket() with the OrderModify() function, where you specify the new opening price and STOP values.

...And the values of variables passed to trading functions need to be normalized (price, STOP). And this loop of order enumeration:

it would be better to replace it with the reverse one:

StopLosses are also not organized correctly:

Stops will be calculated differently for different types of pending orders.

Thanks, got it)))
 

Hello! Please help me to understand:

How does the virtual trailing stop work?

How is it better than a regular trailing stop?

Can I prescribe a virtual trailing stop in my Expert Advisor if there are many orders at the same time for each pair, and will that be rational?

Reason: