Paul,Baluda wrote:Alex,
I came across this code in the LookForD1TrendTrade() function:This sets up triggers for long trades based on the Bid price. Shouldn't this be the Ask price?Code: Select all
//Buy trigger if (type == OP_BUY) { //Find the relevant ma to cross target = GetHighestMovingAverage(PERIOD_D1); if (Bid > target && bias == up && VerifyCrossOver(Bid, target)) { if (iLow(NULL, PERIOD_D1, 0) < target || iLow(NULL, PERIOD_D1, 1) < target) { SendLong = true; TradeOrigin = D1TrendTrade;//TradeOrigin is used by CalculateTakeProfit() magic = D1TrendTradeMN; comment = D1TrendTradeComment; }//if (iOpen(NULL, PERIOD_D1, 0) < D1BlueMaVal || iOpen(NULL, PERIOD_D1, 1) < D1BlueMaVal) }//if (Bid > target) //Find a monthly pivot cross if (Bid > MonthlyPivot && bias == up && VerifyCrossOver(Bid, MonthlyPivot)) { if (iLow(NULL, PERIOD_D1, 0) < MonthlyPivot || iLow(NULL, PERIOD_D1, 1) < MonthlyPivot) { SendLong = true; TradeOrigin = D1TrendTrade;//TradeOrigin is used by CalculateTakeProfit() magic = D1TrendTradeMN; comment = D1TrendTradeComment; }//if (iLow(NULL, PERIOD_D1, 0) < MonthlyPivot || iLow(NULL, PERIOD_D1, 1) < MonthlyPivot) }//if (Bid > target && bias == up) }//if (type == OP_BUY)
Paul
Since we are using Bid charts and all the indicators are based on Bid data, the convention has been to trigger trades off of the Bid as well. I assume that these are correctly filled at Ask prices when the time comes to pull the trigger....
George
