Hello,
I require assistance please? I have basic strategy which I wish to automate but unfortunately the True Strength Indicator is “not available in ProBuilder language”. I have been using the the following code obtained from a previous forum:
a = (ExponentialAverage[13](ExponentialAverage[25](ROC[1](close))))
b = (ExponentialAverage[13](ExponentialAverage[25](ABS(ROC[1](close)))))
TSI = 100 * (a/b)
Please will you assist with code for TSI(1) and TSI(2)?
This is my strategy:
a = (ExponentialAverage[13](ExponentialAverage[25](ROC[1](close))))
b = (ExponentialAverage[13](ExponentialAverage[25](ABS(ROC[1](close)))))
TSI = 100 * (a/b)
// Conditions to enter long positions
c1 = TSI < -20
c2 = TSI > TSI(1) and TSI(1)>TSI(2)
IF c1 and c2 THEN
BUY 1 lot AT MARKET
ENDIF
Thanks
> For clarity of messages on ProRealCode’s forums, please use the “insert code PRT” button to separate the text of the code part! Thank you! <<
At line 8 replace parenthesis with brackets to get TSI[1] & TSI[2].
Ai, silly me. Thanks Roberto.
Hello, i am wondering how do we write a[1] in this exemple?
Is it this?
a[1] = (ExponentialAverage[13](ExponentialAverage[25](ROC[1](close))))[1]
Please use the ‘Insert PRT Code’ button when putting any code in your posts.
a = (ExponentialAverage[13](ExponentialAverage[25](ROC[1](close))))
defines what the value of ‘a’ is for every bar.
a[1] on its own will just return the value for ‘a’ one bar back from the last bar on the chart.
Thanks for your answer so a[1] should be this right?
a = (ExponentialAverage[13](ExponentialAverage[25](ROC[1](close))))
a[1] = (ExponentialAverage[13](ExponentialAverage[25](ROC[1](close[1]))))
Thanks for your answer so a[1] should be this right?
I ask this because i want to find the close X such as
(ExponentialAverage[13](ExponentialAverage[25](ROC[1](close[1]))))-(ExponentialAverage[13](ExponentialAverage[25](ROC[1](X))))=0
Do you have a way to calculate that X?
You cannot assign a value to a past event.
a[1] is the result of an assignment occurred the previous candle and is read-only.