rjhicks
Jul 20 2004, 12:15 PM
I am programming a TS that requires the DMI System indicator for comparisons to permit or reject trades.
Results weren't comparable to manual effort. When I installed the VT DMI system as an indicator to compare with the effort from coding I noticed that the DMI System in code was not starting at the proper time reference.
This of course resulted in trades not congruent with program.
Does anyone know what is causing this and how to correct?
Thanks much!
rjhicks
See Screen Shot.
Code (standard code from indicators):
TH:=if(Ref(C,-1) > H,Ref(C,-1),H);
TL:=if(Ref(C,-1) < L,Ref(C,-1),L);
TR:=TH-TL;
PlusDM:=if(H>Ref(H,-1) AND L>=Ref(L,-1), H-Ref(H,-1),if(H >Ref(H,-1) AND L<Ref(L,-1) AND H-Ref(H,-1)> Ref(L,-1)-L, H-Ref(H,-1),0));
PlusDI:=100*Wilders(PlusDM,Pr)/Wilders(Tr,Pr);
MinusDM:=if(L<Ref(L,-1) AND H<=Ref(H,-1), Ref(L,-1)-L,if(H>Ref(H,-1) AND L<Ref(L,-1) AND H-Ref(H,-1)<Ref(L,-1)-L, Ref(L,-1)-L,0));
MinusDI:=100*Wilders(MinusDM,Pr)/Wilders(Tr,Pr);
DIDif:=Abs(PlusDI-MinusDI);
DISum:=PlusDI+MinusDI;
ADXFinal:=100*Wilders(DIDif/DISum,Pr);
ADXRCustom:= (ADXFinal+Ref(ADXFinal,1-Pr))/2;
_ADX := if( cT=0,ADXFinal,ADXRCustom);
cskidmore
Jul 20 2004, 08:24 PM
Hello,
The shifting of indicators that are included in trading systems is a known VT bug and is being worked on. You can try attaching/dettaching the trading system from the chart a few times to see if it will align itself. You could also instead turn off the indicator output for the additional indicator in the ADX system and manually add just the indicator file to the chart. It should be noted, however, that even though the indicator doesn't line up properly with the chart, the signals do align properly.
Regards,
Chris
Morseradio
Dec 11 2009, 03:56 PM
[size=3]
Hello,
I was also trying to display ADX and ADXR in the same window for a better view. The only way I managed to do this was by going to ->(ADX) edit code : display : on the price screen instead of a seperate screen.
->(ADXR) edit code : display : on the price screen instead of a seperate screen.
Then, after clicking an extra price window, I can see the combination of the two graphs on one screen.
There must be a more subtle way? putting it in a normal indicator screen?
differences :
-------------
--->ADX code
ADXFinal:= 100*Wilders(DIDif/DISum,Pr);
ADXRCustom:=(ADXFinal+Ref(ADXFinal,1-Pr))/2;
_ADX:= if(cT=0,ADXFinal,ADXRCustom);
--->ADXR code
ADXFinal:= 100*Wilders(DIDif/DISum,SmPeriods);
_ADXR:= (ADXFinal + Ref(ADXFinal, 1-SmPeriods))/2
I donīt know how to combine those two formulas into one. ADXFinal is different. If the greatest part of the formula, like listed in the previous post can stay the same? Thanks for advice!
cskidmore
Dec 11 2009, 05:33 PM
Hello,
QUOTE
Hello,
I was also trying to display ADX and ADXR in the same window for a better view. The only way I managed to do this was by going to ->(ADX) edit code : display : on the price screen instead of a seperate screen.
->(ADXR) edit code : display : on the price screen instead of a seperate screen.
Then, after clicking an extra price window, I can see the combination of the two graphs on one screen.
There must be a more subtle way? putting it in a normal indicator screen?
differences :
-------------
--->ADX code
ADXFinal:= 100*Wilders(DIDif/DISum,Pr);
ADXRCustom:=(ADXFinal+Ref(ADXFinal,1-Pr))/2;
_ADX:= if(cT=0,ADXFinal,ADXRCustom);
--->ADXR code
ADXFinal:= 100*Wilders(DIDif/DISum,SmPeriods);
_ADXR:= (ADXFinal + Ref(ADXFinal, 1-SmPeriods))/2
I donīt know how to combine those two formulas into one. ADXFinal is different. If the greatest part of the formula, like listed in the previous post can stay the same? Thanks for advice!
I apologize, but I'm not sure I understand exactly what you're trying to accomplish. Were you trying to put both the ADX and ADXR indicators into the same indicator frame? If this is the case, there's an easier way in this situation. First, add the ADX indicator to the chart. Then, right-click the mouse while the cursor is positioned over the ADX's label. Choose "Attach Indicator" from the menu and select "ADXR" from the list of available indicators. Since the ADXR has no "price" input you can just adjust the Periods inputs as needed and then click "OK". You'll be asked to choose the frame to place the ADXR indicator into. Choose the frame that already includes the ADX indicator. Note: Frames are numbered "Price Frame", "Frame 1", "Frame 2", etc. from the top-down in the chart window.
Regards,
Chris
Morseradio
Dec 12 2009, 04:48 AM
Thanks a lot! They are overlaying now, thatīs really a practical tool!
cskidmore
Dec 12 2009, 06:46 PM
You're welcome.
Regards,
Chris