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.
Not really 'modify' to be honest. All i did was just deleting and removing the code. I have no idea what to add in.
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?