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

The Hidden Pending EA
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=3573
Page 46 of 49
Author:  milanese [ Mon Feb 22, 2016 2:21 pm ]
Post subject:  The Hidden Pending EA

Heraclees » Mon Feb 22, 2016 2:08 pm wrote:Dear Tommaso,
SLMinDistanceToPriceJS=45.0
Work.
Only SLMinDistanceToPriceBE doesn't work.
I plug old version to check and report asap.

Thanks

Hai
you should deactivate the partclose in your setfile, than all should work as aspected..

Cheers :)

Tommaso
Author:  Heraclees [ Mon Feb 22, 2016 2:57 pm ]
Post subject:  The Hidden Pending EA

ok but is it something illogical in my set file with part-close or something else?
Just for not dying too dummy :)
regard,

Hai
Author:  milanese [ Mon Feb 22, 2016 4:01 pm ]
Post subject:  The Hidden Pending EA

Heraclees » Mon Feb 22, 2016 2:57 pm wrote:ok but is it something illogical in my set file with part-close or something else?
Just for not dying too dummy :)
regard,

Hai
this settings are incopatible, that is all, the EA can very much handle, but not all :smile:
Author:  Heraclees [ Tue Feb 23, 2016 8:12 am ]
Post subject:  The Hidden Pending EA

hehe ok noted Tommaso,

HPEA is really a great help tools. I was wondering about :
If you can consider to add function like :
"----After First Fill Options----"
AddOppositeAfterFill=true/false

The reason why is my strategy is to put and auto pending stop order in 1 direction and let it manage with movePendingBuyDownIfPriceMovesDown/movePendingSellUpIfPriceMovesUp and took the trade only on reversal of PA..
IF I choose auto-trade in both direction, hard to manage the move Pending order with price and I don't want to trigger to opposite first as it should reverse soon refer on my guess.
But If my analyse is wrong I would like the AddOppositeAfterFill cover my shirt with FixedDistanceToOpposite/FixedDistanceOppositePips so I can manage the hedge position as usual.

I don't know if it doable but anyway thank you for your advise.

Hai
Author:  milanese [ Tue Feb 23, 2016 9:54 am ]
Post subject:  The Hidden Pending EA

Heraclees » Tue Feb 23, 2016 8:12 am wrote:hehe ok noted Tommaso,

HPEA is really a great help tools. I was wondering about :
If you can consider to add function like :
"----After First Fill Options----"
AddOppositeAfterFill=true/false

The reason why is my strategy is to put and auto pending stop order in 1 direction and let it manage with movePendingBuyDownIfPriceMovesDown/movePendingSellUpIfPriceMovesUp and took the trade only on reversal of PA..
IF I choose auto-trade in both direction, hard to manage the move Pending order with price and I don't want to trigger to opposite first as it should reverse soon refer on my guess.
But If my analyse is wrong I would like the AddOppositeAfterFill cover my shirt with FixedDistanceToOpposite/FixedDistanceOppositePips so I can manage the hedge position as usual.

I don't know if it doable but anyway thank you for your advise.

Hai
I don't see your point sorry, you can let the HPEA set pendings in both directions with the existing versions, or let an opposide order kill when the other one is filled..
Best is, you check this EA with different settings on demo out, to getting familiar with it's potent functions..

Cheers :)

Tommaso
Author:  drunka [ Thu Feb 25, 2016 2:01 pm ]
Post subject:  The Hidden Pending EA

milanese » 08 Feb 2016, 17:17 wrote: The EA does for itself caclculate the average spread, as this is used for the spread filter, too the EA fills BUYS only if the bid is higher than the hidden pending price and uses the ask for SELLS so the spread is already integrated...(indirect but it is a well runnning system)

Cheers :)

Tommaso
Hallo Tommaso,

I struggle to understand why the ask price is used to trigger sells instead of bid price. Doesn't it mean I end up in a situation where I pay double spread (self placed spread at entry and broker spread at exit)?
Or simply put I enter at a lower price than actually planned.

Cheers
drunka
Author:  milanese [ Thu Feb 25, 2016 2:50 pm ]
Post subject:  The Hidden Pending EA

drunka » Thu Feb 25, 2016 2:01 pm wrote:
Hallo Tommaso,

I struggle to understand why the ask price is used to trigger sells instead of bid price. Doesn't it mean I end up in a situation where I pay double spread (self placed spread at entry and broker spread at exit)?
Or simply put I enter at a lower price than actually planned.

Cheers
drunka
This is a security feature you won't pay double spread with this feature, you simply don't get wrong entries, when price would only be touched .. Let the EA run for time with different settings and you will get familiar with it
Cheers :)

Tommaso
Author:  Heraclees [ Wed Mar 02, 2016 8:25 am ]
Post subject:  The Hidden Pending EA

milanese » Tue Feb 23, 2016 4:54 pm wrote: I don't see your point sorry, you can let the HPEA set pendings in both directions with the existing versions, or let an opposide order kill when the other one is filled..
Best is, you check this EA with different settings on demo out, to getting familiar with it's potent functions..

Cheers :)

Tommaso
Dear Tommaso,
Sorry for not being clear so let me reformule if you don't mind.:)
My use of HPEA set pending in both directions is more for hedging strategy once my wished pending order is filled. First I let HPEA set auto pending order in one direction(for example pending buy stop), price can go down so HPEA will "movePendingBuyDownIfPriceMovesDown". I don't want HPEA set pending in both directions at sight because sometimes price can trigger the opposite wished pending order before getting on my favour so i lost the advantage of my trading plan :)
On another hand, once my wished order triggered, HPEA can set stacking pending orders and opposite pending order for hedging with "FixedDistanceOppositePips". So I can manage like what FxFoil mentionned

At Present, with my 2 cents coding skills (never code before :D) I made 2 instances of HPEA (1 for autoBuy and 1 for Auto Sell), for each I've just removed 1 condition on each :

Code: Select all

   if(movePendingSellUpIfPriceMovesUp)// && SetAutoPendingStopSell)
or
   if(movePendingBuyDownIfPriceMovesDown) //&& SetAutoPendingStopBuy)
Then HPEA works like I describe above. It set 1 pending order 1 one direction, once filled set both pendings. But I not sure to measure de consequences so I still testing it or if you can update with correct code

Secondly, I was thinking to request if it's "FixedDistanceOppositePips" could be calculate with ATR.
However, I was reading within the code and find easy to understand for my simple mind so I add it my self.
Could you please correct if It's wrong ?

Code: Select all

extern bool    FixedDistanceToOpposite=true;
extern bool    useATRForFixedDistanceToOpposite=true;
extern ENUM_TIMEFRAMES     atrDistanceToOppositeTF=PERIOD_H4;
extern double  atrMultiplicatorDistanceToOpposite=0.8;
extern int     atrPeriodDistanceToOpposite=14;
And function declaration :

Code: Select all

   if(useATRForFixedDistanceToOpposite==true)
     {

      adr=GetAtr(Symbol(),atrDistanceToOppositeTF,atrPeriodDistanceToOpposite,0);
      if(CloseEnough(adr,0))adr=MathAbs(iHigh(OrderSymbol(),PERIOD_W1,1)-iLow(OrderSymbol(),PERIOD_W1,1));
      FixedDistanceOppositePips=NormalizeDouble((atrMultiplicatorDistanceToOpposite*adr*factor),0);
     }
Thank you for your feedback,

Hai
Author:  milanese [ Wed Mar 02, 2016 8:40 am ]
Post subject:  The Hidden Pending EA

Heraclees » Wed Mar 02, 2016 8:25 am wrote:
Dear Tommaso,
Sorry for not being clear so let me reformule if you don't mind.:)
My use of HPEA set pending in both directions is more for hedging strategy once my wished pending order is filled. First I let HPEA set auto pending order in one direction(for example pending buy stop), price can go down so HPEA will "movePendingBuyDownIfPriceMovesDown". I don't want HPEA set pending in both directions at sight because sometimes price can trigger the opposite wished pending order before getting on my favour so i lost the advantage of my trading plan :)
On another hand, once my wished order triggered, HPEA can set stacking pending orders and opposite pending order for hedging with "FixedDistanceOppositePips". So I can manage like what FxFoil mentionned

At Present, with my 2 cents coding skills (never code before :D) I made 2 instances of HPEA (1 for autoBuy and 1 for Auto Sell), for each I've just removed 1 condition on each :

Code: Select all

   if(movePendingSellUpIfPriceMovesUp)// && SetAutoPendingStopSell)
or
   if(movePendingBuyDownIfPriceMovesDown) //&& SetAutoPendingStopBuy)
Then HPEA works like I describe above. It set 1 pending order 1 one direction, once filled set both pendings. But I not sure to measure de consequences so I still testing it or if you can update with correct code

Secondly, I was thinking to request if it's "FixedDistanceOppositePips" could be calculate with ATR.
However, I was reading within the code and find easy to understand for my simple mind so I add it my self.
Could you please correct if It's wrong ?

Code: Select all

extern bool    FixedDistanceToOpposite=true;
extern bool    useATRForFixedDistanceToOpposite=true;
extern ENUM_TIMEFRAMES     atrDistanceToOppositeTF=PERIOD_H4;
extern double  atrMultiplicatorDistanceToOpposite=0.8;
extern int     atrPeriodDistanceToOpposite=14;
And function declaration :

Code: Select all

   if(useATRForFixedDistanceToOpposite==true)
     {

      adr=GetAtr(Symbol(),atrDistanceToOppositeTF,atrPeriodDistanceToOpposite,0);
      if(CloseEnough(adr,0))adr=MathAbs(iHigh(OrderSymbol(),PERIOD_W1,1)-iLow(OrderSymbol(),PERIOD_W1,1));
      FixedDistanceOppositePips=NormalizeDouble((atrMultiplicatorDistanceToOpposite*adr*factor),0);
     }
Thank you for your feedback,

Hai
It looks at the first glance ok, best is always test it out and make always sure that you have enough history data in all TFs dispobible, if you use ATR .

Cheers :)

Tommaso
Author:  Niani [ Mon Mar 07, 2016 11:41 am ]
Post subject:  The Hidden Pending EA

Hello Tommaso,


have you ever thought of adding a time settings in order to stop the pendings outside of the london trading session for example.


Good day.
All times are UTC Page 46 of 49