Quote:
|
Originally Posted by awu
Here is a section of TSD code(in all versions) insider Filter() to update
buy/sell decision variables using WPR filter:
if (Mode == FILTER_WPR) {
Value = iWPR(TradeSymbol, PeriodTrade, WilliamsP, 1);
if (Value < WilliamsH) okBuy = true;
if (Value > WilliamsL) okSell = true;
return ("iWPR: " + DoubleToStr(Value, 2));
}
where WilliamsH was set to -25, WilliamsL was set to -75.
This means if Value is between -25 & -75 then both okBuy & okSell will be
set to true. This doesn't seem to be right.
The right logic may look :
if (Value > WilliamsH) okSell = true
else if (Value < WilliamsL) okBuy = true;
Can someone verify that?
Thanks.
|
I just looked at the code of TSD 0.25 and TSD 0.36 versions. I think that TSD 0.34 should be with the same logic.
According to my understanding of the code the logic is the following:
1. We may choose which indicator to use to estimate the rend and which indicator to use as a filter:
Code:
#define DIRECTION_MACD 1
#define DIRECTION_OSMA 2
#define FILTER_WPR 1
#define FILTER_FORCE 2
And
Code:
// which indicators to use
int DirectionMode = DIRECTION_MACD, FilterMode = FILTER_WPR;
I spoke with Mindaugas some time ago (he is the coder of almost all the versions of TSD) and he said that we may select the indicator for direction (MACD or OSMA) and indicator for filter (WPR or FORCE) by simple changing in the code.