Another nice spot. Thanks.acostafulano » Tue Feb 10, 2015 4:31 pm wrote:Steve, I think the following is missing from line 2297;
//Only allow 1 trade per candle
if (WaveMostRecentBuyTime >= iTime(Symbol(), TradingTimeFrame, 0) )
return(false);
And Line 2316:
//Only allow 1 trade per candle
if (WaveMostRecentSellTime >= iTime(Symbol(), TradingTimeFrame, 0) )
return(false);
Which may be causing some multiple Wave trades per candle
(Same for TrendWave)
2w in post 1 or copy this over the top of bool CanWeWaveTrade(int type)
Code: Select all
bool CanWeWaveTrade(int type)
{
//Returns true if the filters pass, else false
//Are trend trading?
if (!WaveTradingAllowed)
return(false);
//Maximum trades
if (OpenTrades >= MaxOverallTrades)
return(false);
if (WaveBuyTotalTrades + WaveSellTotalTrades >= WaveMaxTradesAllowed)
return(false);
if (type == OP_BUY)
{
//Only allow 1 trade per candle
if (WaveMostRecentBuyTime >= iTime(Symbol(), TradingTimeFrame, 0) )
return(false);
//Hedging
if (SellOpen)
if (!BrokerAllowsHedging)
return(false);
//Minimum distance between trades
if (WaveMinDistanceBetweenTradesPips > 0)
if (MathAbs(WaveMostRecentBuyPrice - Ask) < (WaveMinDistanceBetweenTrades / factor) )
return(false);
}//if (type == OP_BUY)
if (type == OP_SELL)
{
//Only allow 1 trade per candle
if (WaveMostRecentSellTime >= iTime(Symbol(), TradingTimeFrame, 0) )
return(false);
//Hedging
if (BuyOpen)
if (!BrokerAllowsHedging)
return(false);
//Minimum distance between trades
if (WaveMinDistanceBetweenTradesPips > 0)
if (MathAbs(WaveMostRecentSellPrice - Bid) < (WaveMinDistanceBetweenTrades / factor) )
return(false);
}//if (type == OP_SELL)
//Got this far, so trade is ok
return(true);
}// CanWeWaveTrade(int type)
Code: Select all
bool CanWeTrendWaveTrade(int type)
{
//Returns true if the filters pass, else false
//Maximum trades
//if (OpenTrades >= MaxOverallTrades)
// return(false);
if (TrendWaveBuyTotalTrades + TrendWaveSellTotalTrades >= TrendWaveMaxMultiTrades)
return(false);
if (type == OP_BUY)
{
//Only allow 1 trade per candle
if (TrendWaveMostRecentBuyTime >= iTime(Symbol(), TradingTimeFrame, 0) )
return(false);
//Hedging
if (SellOpen)
if (!BrokerAllowsHedging)
return(false);
}//if (type == OP_BUY)
if (type == OP_SELL)
{
//Only allow 1 trade per candle
if (TrendWaveMostRecentSellTime >= iTime(Symbol(), TradingTimeFrame, 0) )
return(false);
//Hedging
if (BuyOpen)
if (!BrokerAllowsHedging)
return(false);
}//if (type == OP_SELL)
//Got this far, so trade is ok
return(true);
}//bool CanWeTrendWaveTrade(int type)