Scripts: Pending orders UP

 

Pending orders UP:

The scripts places multiple pending orders higher than the current price.

Author: Vladimir Karputov

Pending orders UP
Pending orders UP
  • www.mql5.com
The "Pending orders UP" script sets a grid of orders above the current price. Input Parameters Gap for pending orders UP from the current price (in pips) - the distance from the current price to place the first pending order. Step between orders UP (in pips) - distance between pending orders. Type of pending orders UP - the type of the pending...
 
Automated-Trading:

Pending orders UP:

Author: Vladimir Karputov

Hello.

Needed a script for grid orders, yours turned out to be the only working one of all that I could find.

But only causes confusion such a moment, in the description of the script setting parameter:Gap for pending orders UP from the current price (in pips) - should make a step from the current price for the first pending order,

in reality, this parameter is responsible for the step between orders,

and the parameter that should be responsible for the step between orders Step between orders UP (in pips) does not change anything at all :-(

Has something changed in metatrader and the script started to work incorrectly or was it originally designed that way?


 
s22aa:

Hello.

I needed a script for a grid of orders, yours turned out to be the only working one I could find.

The only thing that causes confusion is that in the description of the script, the setting parameter:Gap for pending orders UP from the current price (in pips) - should make a step from the current price for the first pending order,

in reality, this parameter is responsible for the step between orders,

and the parameter that should be responsible for the step between orders Step between orders UP (in pips) does not change anything at all :-(

Has something changed in metatrader and the script started to work incorrectly or was it originally designed that way?


Indeed, the "step" parameter was lost in the code and the grid was set with a step equal to "the step from the current price for the first pending order". While the code is being published, I am posting the corrected version 1.002

Pending orders UP.mq5
version "1.002"

Files:
 
Vladimir Karputov:

Indeed, the "step" parameter was lost in the code and the grid was set with a step equal to the "offset from the current price for the first pending order". While the code is being published, I am posting the corrected version 1.002

Pending orders UP.mq5
version "1.002"

Thank you very much!
 

There is an error in the script because it does not changes the volume only opens 0.01 lot

Could someone help with this.

 
emmysq :

There is an error in the script because it does not changes the volume only opens 0.01 lot

Could someone help with this.

Version 1.003 is published (the new version is available only on the Russian forum )

 
Published version 1.003: Lot (from input parameters) is now taken into account.
 
I am testing with ICMarkets demo which allows maximum 200 pending orders. When running this script, the maximum pending orders it will submit is 60? Any ideas why?
 
ericy :
I am testing with ICMarkets demo which allows maximum 200 pending orders . When running this script, the maximum pending orders it will submit is 60? Any ideas why?

So the current character has a limitation. Or you already have pending orders on your trading account. In any case, you need to read the "Journal" tab of the terminal.

And pay attention that:

Forum on trading, automated trading systems and testing trading strategies

Scripts: Pending orders UP

Vladimir Karputov, 2019.07.22 09:27

Version 1.003 is published (the new version is available only on the Russian forum )


 
There was no error in the journal. However when I put Sleep(500) before m_trade and now it allowed 79 orders and the rest with error [Position limit reached]. Can you test with 100 quantity and you may see the same.
 
ericy :
There was no error in the journal. However when I put Sleep(500) before m_trade and now it allowed 79 orders and the rest with error [Position limit reached]. Can you test with 100 quantity and you may see the same.

" Position limit reached" - the trading server informs you that you are very rashly bombarding the server with trade requests. You are trying to place VERY MUCH pending orders. Therefore, the trading server hits your hands.