stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

The Hidden Pending EA
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=3573
Page 19 of 49
Author:  milanese [ Fri Feb 06, 2015 3:04 pm ]
Post subject:  TheHiddenPendingEA

Over60 » Fri Feb 06, 2015 2:31 pm wrote:Hi Milanese,

Please find attached a screen shut, what I mean (EURUSD, TF = M15).
All open orders were closed, but the pendings green and red remains in their position.

Will stay tuned …

With kind regards
Over60
I see. That would be tricky to code, as the EA is too used to set pendings, with no open positions, so a simpel check if there are no open trades than delete all pendings would not work..
I will take a look if this would be possible to realize...

Cheers :)

Tommaso
Author:  Over60 [ Fri Feb 06, 2015 3:47 pm ]
Post subject:  TheHiddenPendingEA

Hi Milanese,

I trade breakouts and news.

A far as I know, in the past, you did incorporate a security-feature, that during high volatilities periods, due to slippage and/or spread, the EA will not perform to stack orders?
I´m unsecured.

For example: today with the EURUSD, the HP did not execute orders during the 100-150 pips spike short.
In my live account I was fortunately prepared, but I´m wonder, there were no filled trades with the HP in the demo-account? See pic from my previous post.

What did I make wrong, what can I adjust, that it performs as defined?

Over60
Author:  milanese [ Fri Feb 06, 2015 3:57 pm ]
Post subject:  TheHiddenPendingEA

Over60 » Fri Feb 06, 2015 3:47 pm wrote:Hi Milanese,

I trade breakouts and news.

A far as I know, in the past, you did incorporate a security-feature, that during high volatilities periods, due to slippage and/or spread, the EA will not perform to stack orders?
I´m unsecured.

For example: today with the EURUSD, the HP did not execute orders during the 100-150 pips spike short.
In my live account I was fortunately prepared, but I´m wonder, there were no filled trades with the HP in the demo-account? See pic from my previous post.

What did I make wrong, what can I adjust, that it performs as defined?

Over60
the EA has a couple of security functions avoiding to enter in spikes, that is the main advantage the EA has compared with conventional pending orders, I coded this initialy as only pending EA for my own proposes in live account trading.
I use this EA in live trading and it works for me perfect.
The EA will not fill if the price is with a spike outdated this is previsted and the sense of the EA as if you use pending orders you will normally not got them filled 50-150 pips away from your selected entry price..

In general trading with pending orders during major news events is a very dangerous thing, I would never do it..

Cheers :)

Tommaso
Author:  Over60 [ Sat Feb 07, 2015 3:57 pm ]
Post subject:  TheHiddenPendingEA

Hi Milanese,

I´m a daytrader and I have learned to calculate, simulate and deal with losses in worst case scenarios.
I´m not a gambler and I´m prepared and experienced to trade news.

Anyway, no risk no fun.

I did ask questions in my latest post, because in the previous versions there were the attached variables shown in the setup, such as:

Slippage =1
MaxDiffPrice = 4
MaxSpreadAllowedMultiplicator = 1

Now they did not longer appear in the setup, but still contained in the EA.

I did recently already mentioned, that the hidden pending-functionality might be a matter of discussion.

Its clear to me, that some criminals, especially in the past did manipulate.
“Jemook” (GP) mentioned, that brokers sometime cannot influence the price (spread and slippage), because the price will routed from the central banks.

I will not enter deeper in this issue, the hanky panky of the criminals are common known.

With the HP, the hidden pendings actual will not be routed and will execute as market-order,
if the price cross the execution level. So during high-volatility periods, no market-orders might be filled by slippage and spread (by the hidden settings as precaution).

In comparison with my live account, with manually placed pendings in advance and routed,
I become fills.

So the question arise, if it would be an improvement to place the pendings not hidden or an option (true/false) to choose between hidden or not?

It is not my intention to go over the top, but in my imagination, due to RMM-calculations, three pending trades (not hidden, but routed) in advance should be neccessary.

From my point of view, a pending is not dangerous as long as price did not trigger the pendings (anyway welcome). There should be always three pendings created in advance, by stacking one for one, as long price moves in the designated direction.

BTW: I had have problems with a broker (live-account) last year, because pending-trades were not filled, but I could attest, that the trades have been routed and then the broker did substitute the occurred losses by accommodation.

In addition, as “Oli” mentioned, with a Empty4-app, we can trigger alarm just in time, to act mobile.

Because of low spreads and stop-loss-levels ( = 0), it is a general question, if hidden functionalities are still required?

Moving on …

With kind regards

Over60
Author:  milanese [ Sat Feb 07, 2015 4:15 pm ]
Post subject:  TheHiddenPendingEA

@Over60

Hiddenpendings make sense, as with a high impact news event you have the risk to get your Pending Stop Orders filled with prices wide out of the range and maybe if you have set other pending stop orders in a distance from 20 pips all filled with the same price.. for this cases is the HiddenPending EA coded.., if you will have security that the order only for the price, that you want will be filled.
So an adding of not hidden OrderOptions would make no sense, for this you can use the attached script I coded for dudest ..
Place_PendingDudestwTPSL.mq4
Cheers :)

Tommaso
Author:  jauhar [ Sun Feb 08, 2015 6:53 am ]
Post subject:  TheHiddenPendingEA

Hi Tommaso,

Thanks a lot for your another magic piece of software. I recently discovered this thread and am going to use it in my manual trading. I may use it only for buy (or sell) orders at a time depending on the current trend. So there will be no opposite trade. My question is will the PendingPrice trail when the market price goes away from the PendingPrice? Like, if the current market price is 1.5000 and I set SetAutoPendingStopBuy=true; DistancePendingToPrice=50; MoveOppositeOrderWithPrice=true; and OppositeMoveLevel=10. So the PendingPriceBuy will be 1.5050. Now if the market price goes down to 1.4900, will the PendingPriceBuy be now 1.4950? If yes, then this is what I need. But looking at the code, I think the PendingPrice trails only when there is an opposite trade.

Also in the MoveOpposite function (TheHiddenPendingEA_X_Light.mq4) below, both of the if statements are using Bid price. I think the second one should be Ask price.

Code: Select all

void MoveOpposite()

  {
   if(CountBuysScanning(Symbol(),MagicNumber)>0)
     {
      if(Bid>PendingPriceSell+(MinDistanceForOppositeMoveToPrice/factor)+(OppositeMoveLevel/factor))

         PendingPriceSell=PendingPriceSell+(OppositeMoveLevel/factor);
      CreateSellLine();

     }
   if(CountSellsScanning(Symbol(),MagicNumber)>0)
     {
      if(Bid<PendingPriceBuy-(MinDistanceForOppositeMoveToPrice/factor)-(OppositeMoveLevel/factor))

         PendingPriceBuy=PendingPriceBuy-(OppositeMoveLevel/factor);
      CreateBuyLine();

     }
  }
Thanks for your efforts,
Jauhar
Author:  milanese [ Sun Feb 08, 2015 7:37 am ]
Post subject:  TheHiddenPendingEA

jauhar » Sun Feb 08, 2015 6:53 am wrote:Hi Tommaso,

Thanks a lot for your another magic piece of software. I recently discovered this thread and am going to use it in my manual trading. I may use it only for buy (or sell) orders at a time depending on the current trend. So there will be no opposite trade. My question is will the PendingPrice trail when the market price goes away from the PendingPrice? Like, if the current market price is 1.5000 and I set SetAutoPendingStopBuy=true; DistancePendingToPrice=50; MoveOppositeOrderWithPrice=true; and OppositeMoveLevel=10. So the PendingPriceBuy will be 1.5050. Now if the market price goes down to 1.4900, will the PendingPriceBuy be now 1.4950? If yes, then this is what I need. But looking at the code, I think the PendingPrice trails only when there is an opposite trade.

Also in the MoveOpposite function (TheHiddenPendingEA_X_Light.mq4) below, both of the if statements are using Bid price. I think the second one should be Ask price.

Code: Select all

void MoveOpposite()

  {
   if(CountBuysScanning(Symbol(),MagicNumber)>0)
     {
      if(Bid>PendingPriceSell+(MinDistanceForOppositeMoveToPrice/factor)+(OppositeMoveLevel/factor))

         PendingPriceSell=PendingPriceSell+(OppositeMoveLevel/factor);
      CreateSellLine();

     }
   if(CountSellsScanning(Symbol(),MagicNumber)>0)
     {
      if(Bid<PendingPriceBuy-(MinDistanceForOppositeMoveToPrice/factor)-(OppositeMoveLevel/factor))

         PendingPriceBuy=PendingPriceBuy-(OppositeMoveLevel/factor);
      CreateBuyLine();

     }
  }
Thanks for your efforts,
Jauhar
Hi Jauhar,

the actual version of the HP will not trail the not filled orders, with the exception of the opposite orders if you have selected this. What kind of "trailing" would you like to have? If you could specify, maybe I will consider this option for a next update.
About your spot, no it is no glitch I use mostly in the HP the bid price for this type of calculations.

Cheers :)

Tommaso
Author:  jauhar [ Sun Feb 08, 2015 8:35 am ]
Post subject:  TheHiddenPendingEA

milanese » Sun Feb 08, 2015 11:37 am wrote: the actual version of the HP will not trail the not filled orders, with the exception of the opposite orders if you have selected this. What kind of "trailing" would you like to have? If you could specify, maybe I will consider this option for a next update.
Hi Tommaso,

Thanks for the reply. Let me explain the trailing of PendingPrice I need. Suppose the current trend is up and I expect the price will go up. I set HP to put pending buystop 50 pips above the current price (using DistancePendingToPrice). If the price actually goes up and my pending is filled then fine. But if there is a retrace and the price goes down by 100 pips, I would like the pending buy price should also come down by 100 pips so that when the price starts going up, my pending buy is filled after 50 pips (DistancePendingToPrice). With no trailing, the price will need to go up by 150 pips (after the retrace) for the pending buystop to be filled. With trailing, because the order will be filled early, it can win more pips with same price move.

Jauhar
Author:  milanese [ Sun Feb 08, 2015 11:16 am ]
Post subject:  [update!]TheHiddenPendingEA

jauhar » Sun Feb 08, 2015 8:35 am wrote:
Hi Tommaso,

Thanks for the reply. Let me explain the trailing of PendingPrice I need. Suppose the current trend is up and I expect the price will go up. I set HP to put pending buystop 50 pips above the current price (using DistancePendingToPrice). If the price actually goes up and my pending is filled then fine. But if there is a retrace and the price goes down by 100 pips, I would like the pending buy price should also come down by 100 pips so that when the price starts going up, my pending buy is filled after 50 pips (DistancePendingToPrice). With no trailing, the price will need to go up by 150 pips (after the retrace) for the pending buystop to be filled. With trailing, because the order will be filled early, it can win more pips with same price move.

Jauhar
I like your idea and as it was time for an update to the new info box and some fixes I added the function in the latest version Z.
feb. 8, 2015
NewVersion with a new option to "trail" the automatic with DistancePendingToPrice calculated Buy/Sell Stop prices. If you have at exp initial a PendingBuyPrice 1,54000 DistancePendingToPrice is selected with 50 pip (so Price by setting the initial Pending was 1,53500) the PendingBuyPrice will be moved if Price goes down to 1,53000 to 1,53500. This gives the EA again more flessibility.
The inputs for this new option are:

Code: Select all

extern string   dyn="----Dynamic Initial Pending Move Options----";
extern string   dyn1="----This is only working with AutoBuySellStop----";
extern bool    movePendingBuyDownIfPriceMovesDown=false;
extern bool    movePendingSellUpIfPriceMovesUp=false;
Analog to the APTM and all newer EA coded by me the UserDisplay is updated.
new input showDisplayBox=true if you set this to false, you see the user-display in the "old" way, without box and transperency, so tou have now three possibilities:
-NewBoxDisplay Design
-Old fashion style with transperency UserDisplay
-Display will not be shown
The display is too more informativ, to make the use of this EA a little bit easier.
This version includes too some fixes and update to property strict code.

As always you will find latest version Z attached to the first post, not that I do not update the light version, as there is really no big request for this version..

Cheers :)

Tommaso
Author:  jauhar [ Sun Feb 08, 2015 1:47 pm ]
Post subject:  TheHiddenPendingEA

Hi Tommaso,

Millions of thanks for your tremendous work and posting the new version so fast.

Jauhar
All times are UTC Page 19 of 49