♥ 0 |
Basically using in an S/R Alert on Spreads- /ZF-/ZN. I need to convert the Bond Closes close(“ZF”) or close(“ZN”) to a decimal so the following lines work as they do on other spread charts. (These are just few key lines in the code to see why I need them )
input Vposition={default AlertisAbove,AlertisBelow}; def ZFValue= (close(“ZF”) * 1000); def ZNValue= (close(“ZN”) * 1000); CurrentValue = ZFValue – ZNValue; VAlertValue=AlertChartValue*1000; # $1000 for on full pt or 128 ticks AlertOn= if (Vposition == Vposition.AlertisAbove) && (CurrentValue >=VAlertValue) or (Vposition == Vposition.AlertisBelow) && (CurrentValue <=VAlertValue) then yes else no; Alert(AlertOn,”Price Reached”,Alert.BAR,Sound.Chimes); plot PAlertValue = AlertChartValue;
RESOLVED
Marked as spam
|
Please log in to post questions.