V 1d is in post 1. The bot was not reacting as intended to the FollowAdverseMarketWithStopOrders input aqnd I have fixed this.
Watch the default inputs; they are effectively my setfile and may not suit you.
DIYers, the easiest way to add the fix is to copy this over the top of the existing void FillGapsWithStopOrders() function starting at line1117:
Code: Select all
void FillGapsWithStopOrders()
{
//Fill in the gaps between the market price and the most recent trade
//when the market is above the PH or below the PL.
bool result = true;
double price = 0;
double SendLots = Lot;
double stop = 0, take = 0;
//Sell stops
if (LatestTradeTicketNo > -1)
if (BetterOrderSelect(LatestTradeTicketNo, SELECT_BY_TICKET, MODE_TRADES))
if (OrderType() == OP_SELL || OrderType() == OP_SELLSTOP)
if (Bid - OrderOpenPrice() >= (MarketDistance / factor) )
{
price = NormalizeDouble(OrderOpenPrice() + (MarketDistance / factor) / 2, Digits);
if (!DoesStopOrderExist(OP_SELLSTOP, price))
{
stop = CalculateStopLoss(OP_SELL, price);
take = OrderTakeProfit();
//Lot size calculated by risk
if (!CloseEnough(RiskPercent, 0)) SendLots = CalculateLotSize(price, NormalizeDouble(stop + (HiddenPips / factor), Digits) );
result = SendSingleTrade(Symbol(), OP_SELLSTOP, TradeComment, SendLots, price, stop, take);
}//if (!DoesTradeExist(OP_SELLSTOP, price))
}//if (Bid - OrderOpenPrice() >= (MarketDistance / factor) )
//Buy stops
if (LatestTradeTicketNo > -1)
if (BetterOrderSelect(LatestTradeTicketNo, SELECT_BY_TICKET, MODE_TRADES))
if (OrderType() == OP_BUY || OrderType() == OP_BUYSTOP)
if (OrderOpenPrice() - Bid >= (MarketDistance / factor) )
{
price = NormalizeDouble(OrderOpenPrice() - (MarketDistance / factor) / 2, Digits);
if (!DoesStopOrderExist(OP_BUYSTOP, price))
{
stop = CalculateStopLoss(OP_BUY, price);
take = OrderTakeProfit();
//Lot size calculated by risk
if (!CloseEnough(RiskPercent, 0)) SendLots = CalculateLotSize(price, NormalizeDouble(stop + (HiddenPips / factor), Digits) );
result = SendSingleTrade(Symbol(), OP_BUYSTOP, TradeComment, SendLots, price, stop, take);
}//if (!DoesTradeExist(OP_BUYSTOP, price))
}//if (Bid - OrderOpenPrice() >= (MarketDistance / factor) )
}//End void FillGapWithStopOrders()
Compare the two and you will see the changes I have made.

Read the effing manual, ok?
Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.
I still suffer from OCCD. Good thing, really.
Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.
To see The Weekly Roundup of stuff you guys might have missed
Click here
My special thanks to Thomas (tomele) for all the incredible work he does here.