Added next code to OnInit()
Code: Select all
MinimumDistanceBetweenSignals = MinimumDistanceBetweenSignalsPips;Code: Select all
//We need to check that the market is sufficient distance from the highest/lowest open trade
if (OpenTrades > 0)
{
//Buy signal. Market must be above the highest open buy price or below the lowest.
if (FbStatus == fbuparrowtradable)
if (Bid <= HighestBuyPrice + (MinimumDistanceBetweenSignals / factor) ||
Bid >= LowestBuyPrice - (MinimumDistanceBetweenSignals / factor) )
FbStatus = fbuparrowuntradable;
//Sell signal. Market must be above the lowest open sell price or above the highest.
if (FbStatus == fbdownarrowtradable)
if (Bid >= LowestSellPrice - (MinimumDistanceBetweenSignals / factor) ||
Bid <= HighestSellPrice + (MinimumDistanceBetweenSignals / factor) )
FbStatus = fbdownarrowuntradable;
}//if (OpenTrades > 0)
Code: Select all
//We need to check that the market is sufficient distance from the highest/lowest open trade
if (OpenTrades > 0)
{
//Buy signal. Market must be above the highest open buy price or below the lowest.
if (FbStatus == fbuparrowtradable)
if ( (Bid <= HighestBuyPrice + (MinimumDistanceBetweenSignals / factor) && Bid > HighestBuyPrice) ||
(Bid >= LowestBuyPrice - (MinimumDistanceBetweenSignals / factor) && Bid < LowestBuyPrice) )
FbStatus = fbuparrowuntradable;
//Sell signal. Market must be above the lowest open sell price or above the highest.
if (FbStatus == fbdownarrowtradable)
if ( (Bid >= LowestSellPrice - (MinimumDistanceBetweenSignals / factor) && Bid < LowestSellPrice) ||
(Bid <= HighestSellPrice + (MinimumDistanceBetweenSignals / factor) && Bid > HighestSellPrice) )
FbStatus = fbdownarrowuntradable;
}//if (OpenTrades > 0)