|
0 registered members (),
1,459
guests, and 9
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Donchian Channel Indicator
[Re: Spirit]
#410049
10/27/12 10:03
10/27/12 10:03
|
Joined: Oct 2012
Posts: 75
hughbriss
OP
Junior Member
|
OP
Junior Member
Joined: Oct 2012
Posts: 75
|
Hmm I see nothing wrong in your code and dont see why you think you need to use [1], but maybe you wanted a crossOver() of the price instead of just comparing it? Your comparing will enter trades all the time on every bar, but crossover only enters it when the price crosses over the border. Using the [1] will compare the previous value of the DChannel rather than the current one which by necessity will have risen or fallen in line with the price and therefore will never be exceeded. The trade count criteria prevent multiple trades being opened.
Last edited by hughbriss; 10/27/12 10:04.
|
|
|
Re: Donchian Channel Indicator
[Re: jcl]
#410239
10/30/12 23:59
10/30/12 23:59
|
Joined: Sep 2012
Posts: 99
TankWolf
Junior Member
|
Junior Member
Joined: Sep 2012
Posts: 99
|
Well, according to the algorithm the +DI & -DI crossing is just the zero crossing of the DX, so you should be able to use those strategies. That's probably the reason why the TA-Lib author did not care to store +DI & -DI separately. 775 /* Generated */ if( !TA_IS_ZERO(prevTR) ) 776 /* Generated */ { 777 /* Generated */ minusDI = round_pos(100.0*(prevMinusDM/prevTR)); 778 /* Generated */ plusDI = round_pos(100.0*(prevPlusDM/prevTR)); 779 /* Generated */ tempReal = minusDI+plusDI; 780 /* Generated */ if( !TA_IS_ZERO(tempReal) ) 781 /* Generated */ { 782 /* Generated */ tempReal = round_pos(100.0*(std_fabs(minusDI-plusDI)/tempReal));
jcl Ive tried to work out how to use the +DI and -DI values but I just cant seem to work it out, its a vital aspect to one of my strategies that I check that the +DI and -DI have crossed before a trade can be taken. Any further help would be appreciated or anyone for that matter.
|
|
|
Re: Donchian Channel Indicator
[Re: jcl]
#410259
10/31/12 09:14
10/31/12 09:14
|
Joined: Sep 2012
Posts: 99
TankWolf
Junior Member
|
Junior Member
Joined: Sep 2012
Posts: 99
|
Im trying that and no trades are excuteing at all now. The DX value reads: DX(int TimePeriod): var Directional Movement Index by Welles Wilder (the guy who claimed that "the interaction of sun, moon, and earth is the basis of all market movement"). If sun, moon, and earth don't work, use this indicator. The values range from 0 to 100, but rarely get above 60. A high return value is supposed to indicate a strong trend, a low value a weak trend.
So if the DX value can only return a value between 0 and 100 how can it ever cross under or over 0?
|
|
|
|
|
|