I will write an advisor free of charge - page 108

 

couldn't resist...

//+------------------------------------------------------------------+
//|                                                        15_20.mq4 |
//|                                               Yuriy Tokman (YTG) |
//|                       https://www.mql5.com/ru/users/satop/seller |
//+------------------------------------------------------------------+
#property copyright "Yuriy Tokman (YTG)"
#property link      "https://www.mql5.com/ru/users/satop/seller"
#property version   "1.00"
#property strict
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---
   while(15-20% в месяц нет)
    {
     зарабатывать!!!
    }
//---   
  }
//+------------------------------------------------------------------+
 
khorosh:

When a Pithecanthropus joked like that, the tribesmen threw stones at him).

Iurii Tokman:

I couldn't resist...

Good, you see, Yuri was able to write, and you're all jokes for three hundred, jokes for three hundred...

 

Please write a script (mt4) to open positions, the task is as follows:

Throw it on the chart, input parameters appear and there are three lines:

  • Buy/Sell
  • Lot size
  • Item quantity

Then we should enter lot=1.86 and quantity=25

The script counts and rounds the lot to the possible, if the lot is less than allowed,
for example, lot 0.12, and the amount of 20, then opens min.lots the maximum possible amount, until it will collectively 0.12 = = 0.12/20 = 0.006, min.lot 0.01, then open at 0.01 lots 12 positions.

If we type in 2.87 lot and number of 25, then 2.87/25=0.1148, rounded down, then open 25 units of 0.11 lot

Thank you!

 
Iurii Tokman:

couldn't resist...

Optimisation a bit: the main code should be moved to OnTimer()... i.e. you should not depend on someone else's mood, exchange/DC/no-exchange working... :-)
 
Vitaly Muzichenko:

Please write a script (mt4) to open positions, the task is as follows:

Throw it on the chart, input parameters appear and there are three lines:

  • Buy/Sell
  • Lot size
  • Item quantity

Then we should enter lot=1.86 and quantity=25

The script counts and rounds the lot to the possible if the lot is less than the allowable,
for example lot 0.12, and the amount of 20, then opens min.lots the maximum possible amount, until it will collectively 0.12 = = 0.12/20 = 0.006, min.lot 0.01, then open at 0.01 lots 12 positions.

If we type in 2.87 lot and number of 25, then 2.87/25=0.1148, rounding down, then open 25 units of 0.11 lot

Thank you!

The hard drugs have gone in.

Vitaly, shall we write the script?
 
Алексей Тарабанов:

The hard drugs have gone to work.

Vitaly, shall we write the script?

Yes, of course write, if you don't mind!

 
Vitaly Muzichenko:

Yes, of course write it down, if it's not too much trouble!

If we enter lot 2.87 and quantity 25, then 2.87/25=0.1148, rounded down, then open 25pcs at 0.11 lot

I will do it tomorrow.

 
Алексей Тарабанов:

If you enter lot 2.87 and quantity 25, then 2.87/25=0.1148, rounded down, then open 25pcs at 0.11 lot

I'll do it tomorrow.

Great, thanks, I'll be waiting!

P.S. If you put in 2.49 lot and number 9 ->>> 2.49/9=0.277 we get 9 positions with 0.27 lot
 

Expert Advisor. x=, y=, z=. if x-y>=z then buy, stoploss, trailing stop. if y-x>=z then sell, stoploss, trailing stop. otherwise x=y. loop it. That's it.

can anyone help? it would be appreciated.

 
smellthemgc:

Expert Advisor. x=, y=, z=. if x-y>=z then buy, stoploss, trailing stop. if y-x>=z then sell, stoploss, trailing stop. otherwise x=y. loop it. That's it.

can anyone help? would appreciate it.

x y z who can help))