The Hidden Pending EA

MPTM's new home
Post Reply
User avatar
milanese
TechAdmin
Posts: 3293
Joined: Wed Jan 09, 2013 9:02 am
Location: btr rdx, r8 +

The Hidden Pending EA

Post by milanese »

neorage30 » Fri Nov 20, 2020 3:49 am wrote:I just want to thank Tomasso and members of SHF for contributing so much useful stuffs and letting you guys know that I will use it, learn from it & edit it to my need.

Although it may sound common and everyone were taught to do it, but my belief require me to ask/let the owner know that I'm using their stuff. So, here I am.
you are very welcome!

Cheers :)

Tommaso
User avatar
forexgeeker
Trader
Posts: 77
Joined: Fri Oct 18, 2013 7:52 am
Location: Bandar Ramai-Ramai Sandakan, Sabah

The Hidden Pending EA

Post by forexgeeker »

Hi guys, I have a question. :smile:
Screenshot_1.png
I'm using this EA for stacking order. From my understanding, the "movePendingBuyDownIfPriceMovesDown" and "movePendingSellUpIfPriceMovesUp" only works if there's not yet first order filled, am i right?

Because i notice that even if i set, "movePendingBuyDownIfPriceMovesDown= true", after the first order has been filled the next buystop order won't move down if the price move down.

Is there any way to make the buystop order to also move down if price goes down even after the first fill?

I'm bad at explaining things, so this is what i'm trying to achieve;
Screenshot_3.png
You do not have the required permissions to view the files attached to this post.
lemur6666
Trader
Posts: 69
Joined: Mon Nov 27, 2017 8:29 am

The Hidden Pending EA

Post by lemur6666 »

You got it right,
If you have any order opened than procedure will not reach CreateBuyLine - condition for Count Orders is in line 4 (line 1502 in the code):

Code: Select all

if(movePendingBuyDownIfPriceMovesDown && SetAutoPendingStopBuy)
     {
      if(CountBuysScanning(Symbol(),MagicNumber)==0 && CountSellsScanning(Symbol(),MagicNumber)==0)
        {
         if((PendingPriceBuy-Bid)>DistancePendingToPrice/factor)
           {

            PendingPriceBuy=Bid+(DistancePendingToPrice/factor);
            CreateBuyLine();

           }

        }
     }
User avatar
forexgeeker
Trader
Posts: 77
Joined: Fri Oct 18, 2013 7:52 am
Location: Bandar Ramai-Ramai Sandakan, Sabah

The Hidden Pending EA

Post by forexgeeker »

lemur6666 » Wed Apr 28, 2021 10:01 am wrote:You got it right,
If you have any order opened than procedure will not reach CreateBuyLine - condition for Count Orders is in line 4 (line 1502 in the code):

}[/code]

Hi, thank you for your guide. I tried to 'modify' the code but it just didn't work. :arrrg:

Not really 'modify' to be honest. All i did was just deleting and removing the code. I have no idea what to add in. :mrgreen:

Code: Select all

if(CountBuysScanning(Symbol(),MagicNumber)==0 && CountSellsScanning(Symbol(),MagicNumber)==0)
If i remove this line, after the first order is filled, the next pending order will continuosly trailing the price if it move against and it won't stop trailing until it return back to it's original position.

Code: Select all

if(movePendingBuyDownIfPriceMovesDown && SetAutoPendingStopBuy)
     {
      if(CountBuysScanning(Symbol(),MagicNumber)==0 && CountSellsScanning(Symbol(),MagicNumber)==0)
        {
         if((PendingPriceBuy-Bid)>DistancePendingToPrice/factor)
           {

            PendingPriceBuy=Bid+(DistancePendingToPrice/factor);
            CreateBuyLine();

           }

        }
     }
   if(movePendingSellUpIfPriceMovesUp && SetAutoPendingStopSell)
     {
      if(CountSellsScanning(Symbol(),MagicNumber)==0 && CountBuysScanning(Symbol(),MagicNumber)==0)
        {
         if((Bid-PendingPriceSell)>DistancePendingToPrice/factor)
           {

            PendingPriceSell=Bid-(DistancePendingToPrice/factor);
            CreateSellLine();

           }
Then if i remove this entire command line, the order is still triggered but won't jump like i need it to.

hhmmm...definitely need to add some code. Any idea?
yangmulia
Posts: 1
Joined: Mon Nov 01, 2021 3:58 pm

The Hidden Pending EA

Post by yangmulia »

hello, is this thread still alive?
thepcyber
Posts: 1
Joined: Wed May 25, 2022 5:17 pm

The Hidden Pending EA

Post by thepcyber »

Thank you
Post Reply

Return to “Utilities Indicators and Scripts”