OS Win 7 Ultimate 64-bit
I noticed some odd behavior on a chart, so I did a test:
Code: Select all
input: len(5);
vars:
filename("C:\Users\user\Desktop\" + NumToStr(len,0) + " & " + NumToStr(maxbarsback,0) + ".txt"),
plus(0),
minus(0);
if barstatus=2 and currentbar<21 then begin
DirMovement(High, Low, Close, len, plus, minus, value1, value2, value3, value4);
print(file(filename),currentbar," ",date," ",time," ",plus," ",minus);
end;
- With len=5 and Max Bars Back = 5
...
6.00 1070702.00 500.00 21.63 20.28
7.00 1070702.00 600.00 16.87 22.11
8.00 1070702.00 700.00 31.98 14.63
9.00 1070702.00 800.00 52.10 9.83
10.00 1070702.00 900.00 44.76 8.44
...
- Len=5 and MBB=10
1.00 1070702.00 500.00 9.38 21.88
2.00 1070702.00 600.00 7.36 23.31
3.00 1070702.00 700.00 25.38 15.56
4.00 1070702.00 800.00 47.41 10.51
5.00 1070702.00 900.00 40.80 9.05
...
Unlike, say, SMA, the DMI calculation returns different values for the same hour when the Max Bars Back is different. Two questions:
1. Why is this? (As of yet I haven't found a reason in the DirMovement code.)
2. In MC, you can set a different MBB for each indicator (or Auto-detect will do that if necessary). But when using Portfolio Trader, only one Max Bars Back can be set. This means if I have a signal using one indicator with a length of 10, and DMI with length 5, I have to set MBB=10, which will apparently screw up the DMI. Is there a solution?