If I understand well the definition of the ATR ("The true range indicator is taken as the greatest of the following: current high less the current low; the absolute value of the current high less the previous close; and the absolute value of the current low less the previous close"), it's a comparison between 3 values and the highest is used.
Your script just takes in account one of these 3 values, which makes it unprecise for stocks that are gaping.
Do you think it could be possible to go closer to the real definition of the ATR ?
sure. any variable you use has to be visible there. if it has 0 then go to the source. also make sure you have latest dastrader version to be able to read the indicator values
oh yes that is the problem. I am using the script as hot button and if you are trying to do it as a hotkey the HI and LO are properties of the montage window so you need to read them differently using either
Focuswindow MONTAGE1;
at the start of the script. You need to name your montage window as MONTAGE1
or you can call it as
$HOD=GetWindowObj("MONTAGE1").HI;
$LOD=GetWindowObj("MONTAGE1").Lo;
I will update the article accordingly. Thanks for reminding me of this.
Great stuff here Pete, thanks for sharing! I would love to have a hotkey for a pop up text box to show how much I am risking vs my stop (or some other number that das can reference). Ex. take my shares, average and stop order, hit a hotkey and it show my $ or R risk. Thanks.
that is easy to accomplish in several ways. one way is to display it in the variables window which can now be part of your desktop so you can see it all the time. it can be static - once you open the position or dynamic - updated constabtly to the current price. (this is basically unrealized profit visible on your account size) the other way is to display it on a keypress as you mentioned which is more universal. PM me for the details if you like and I will cover it in the next post.
Would it be possible to draw a line 10% from the open?
sure, send me a PM
Hi Peter,
If I understand well the definition of the ATR ("The true range indicator is taken as the greatest of the following: current high less the current low; the absolute value of the current high less the previous close; and the absolute value of the current low less the previous close"), it's a comparison between 3 values and the highest is used.
Your script just takes in account one of these 3 values, which makes it unprecise for stocks that are gaping.
Do you think it could be possible to go closer to the real definition of the ATR ?
Thank you
Hi Silean, I am not following your definition, but whatever you want to calculate you can calculate and use.
For that we would need in the script to get de previous day close value, is it possible ?
yes we can get any candle value
Hello Peter,
How do you to to delete these ATR lines if you want to re-draw them ? Right click + remove is quite annoying.
Is it possible to have a hotkey that deletes just these ATR lines (without touching other lines that I might have drawn) ? Thank you
so far only the trend lines can have names so those can be deleted by names.
otherwise i do
FocusWindow MY1MIN;
RemoveALLLines;
Is it possible now with 5.8.0.2 ?
If yes could you explain quickly how to do ? Thanks a lot
i have not tried yet but i do not like this version and not going to use it as it breaks important stuff for me
Hi Peter,
It would be a great idea if you can create a post on how to actually use this in a real trade. I managed to get the hotkey to work.
Does it matter when you click to draw the line during the trading day? as it takes the HOD and LOD values.
it shows you where you can expect the end of the move to the other side. obviously if the stock is breaking the highs of the day the bottom line gets
redrawn higher and higher. I use it for finding areas for reversal
so the best time to draw the lines as in the first 5 minutes I assume ?
i do it on demand as it makes little sense to draw them on every symbol i have a look at.
Nice idea but I can't make it work.... When I go to "variable", $HITGT and $LOTGT are equal to 0. It looks like the calculation doesn't work 😕
i use it every day so i know it works :)
There is probably something I do wrong. Do you see values in "variable" for $HITGT and $LOTGT after you hit the hotkey ?
sure. any variable you use has to be visible there. if it has 0 then go to the source. also make sure you have latest dastrader version to be able to read the indicator values
Yes it reads the indicator value correctly.
In variable for "$HOD", I see type "string" and value "HI" (instead of the value). Is that normal ?
oh yes that is the problem. I am using the script as hot button and if you are trying to do it as a hotkey the HI and LO are properties of the montage window so you need to read them differently using either
Focuswindow MONTAGE1;
at the start of the script. You need to name your montage window as MONTAGE1
or you can call it as
$HOD=GetWindowObj("MONTAGE1").HI;
$LOD=GetWindowObj("MONTAGE1").Lo;
I will update the article accordingly. Thanks for reminding me of this.
So do be clear, if we just want to use a hotkey [not a montage button], then the below? Thanks in advance Peter
$HOD=GetWindowObj("MONTAGE1").HI;
$LOD=GetWindowObj("MONTAGE1").Lo;
$MYRVOL=RVOL;
$HITGT=Round($LOD+$MYATR,2);
$LOTGT=Round($HOD-$MYATR,2);
$TOHATR=$HITGT-LAST;
$TOLATR=LAST-$LOTGT;
MsgBox($HITGT +" to Hi ATR: "+$TOHATR +"\n" +$LOTGT +" to Lo ATR: "+$TOLATR +"\n RVOL:" +$MYRVOL +"%" );
Brilliant, it works now. Thank you !
Great stuff here Pete, thanks for sharing! I would love to have a hotkey for a pop up text box to show how much I am risking vs my stop (or some other number that das can reference). Ex. take my shares, average and stop order, hit a hotkey and it show my $ or R risk. Thanks.
that is easy to accomplish in several ways. one way is to display it in the variables window which can now be part of your desktop so you can see it all the time. it can be static - once you open the position or dynamic - updated constabtly to the current price. (this is basically unrealized profit visible on your account size) the other way is to display it on a keypress as you mentioned which is more universal. PM me for the details if you like and I will cover it in the next post.