Nice spot Wayne. Thanks.ecodesign » Fri Jan 16, 2015 3:15 am wrote: **********************************************************************************
I was checking out the code in v2m for RAD trades within the function called:
CalculateTakeProfit(int type, double price, string comment). There may be a bug....check it out here
//Rad trades <----------------------------------------line 1879
if (comment == RadTradeComment)
{
//Atr take profit
if (RadAtrPeriod > 0)
{
RadTakeProfit = (GetAtr(Symbol(), RadAtrTimeFrame, RadAtrPeriod, 0) * factor) *RadAtrTpMultiplier;
}//if (RadAtrPeriod > 0)
if (!CloseEnough(RadTakeProfit, 0) )
{
take = price + (RadTakeProfit / factor);
HiddenTakeProfit = take;
}//if (!CloseEnough(RadTakeProfit, 0) )
}//if (comment == RadTradeComment)
//Rad trades <-----------------------------appears a second time
if (comment == RadTradeComment)
if (!CloseEnough(RadTakeProfit, 0) )
{
take = price + (RadTakeProfit / factor);
HiddenTakeProfit = take;
}//if (!CloseEnough(RadTakeProfit, 0) )
//Rad Multi trades <---------------------------------------- I think it should be rad multi (like this)
if (comment == RadMultiTradeComment)
if (!CloseEnough(RadMultiTakeProfit, 0) )
{
take = price + (RadMultiTakeProfit / factor);
HiddenTakeProfit = take;
}//if (!CloseEnough(RadMultiTakeProfit, 0) )
Hope this helps...
Wayne
This must be something I balsed up when making the most recent changes. Fix in post 1 (2n) but you do not need it if your rad multi-trades are going out with the correct take profit.
