ProRealCode Indicator Link: http://tinyurl.com/yd8cbnz6
In the first line of the code of Andrew Abraham Trend Trader, something is missing (See image attached):
avrTR = weightedaverage[Length](AverageTnueRange[l](close))
When two functions are placed in a statement, there is usually an operator between the functions. in this case, weightedaverage[Length](AverageTnueRange[l] need to tell the parser what action to perform. In the (AverageTnueRange[l](close)) I expected a delimiter so the parser would know when the function name was ended and the (close) property would be assigned.
If the language that is using this doesn’t need the above, a phrase explaining the action the line is intending to produce would be helpful. As it is, I don’t have a clue, without considerable random testing as to what was intended, and even then, my assumption would be based on visual reflection of the image shown above the code area.
Any help as to what the first line intended and how the close in the ATR parathesis is intending will be appreciated.
Thanks.
I’m not sure that I fully understand your problem but I will try to help.
If you download the ITF file from your link and import the strategy then you will get full functionality. If you just cut and paste the code then the variable LENGTH is not defined so just add a first line to the code of:
Length = 21 // Or whatever value you want.
On a seperate note I see that you have typed AverageTnueRange instead of AverageTrueRange but I assume this is just a typo?
<< If you download the ITF file from your link and import the strategy then you will get full functionality. >>
I don’t know how to download the indicator or where to look other than the page referenced above.
You are right about the typo.
I wasn’t looking for the “Length” parameter. Instead, I was hoping to get the missing operators, like + – / * etc. inserted in line 1.
In the AverageTrueRange part of line 1, there is no delimiter like a comma that separates the (AverageTrueRange[l](close)) function from the assigning property (close) that is contained with the parathesis of that part of line 1.
Thank you for your reply.
I would plsce [1] after CLOSE, instead of where it is now in line 1.
Can you write the entire line in a way that shows the operators and the offsets as they should be for error-free execution in the program that would execute the line?
1 avrTR = weightedaverage[Length](AverageTnueRange[l](close))
If no operators are missing in line, please tell me how the two functions know how to interact if the code line doesn’t make it clear?
As for the Close, how does the AverageTrueRange know the (close) is a parameter reference with it being delimited from the function name?
Thank you for the response.
I’d write it
avrTR = weightedaverage[Length](AverageTrueRange(close[1]))
or the equivalent
avrTR = weightedaverage[Length](AverageTrueRange(close)[1])
Moreover, AverageTrueRange is not written AverageTnueRange.
Sorry, the problem was just AverageTrueRange is not written AverageTnueRange.
Ignore the rest!
|
|
avrTR = weightedaverage[Length](AverageTrueRange(close)[1])
|
If the above is correct, the parser recognizes the two functions will add, and when a property follows a function the item is the function’s influencer.
Is that how I should understand the code?
Thanks again for the support.
The code in line 1 was correct, do NOT modify it, just make the correction as I pointed out, this is the correct line as posted in the library
avrTR = weightedaverage[Length](AverageTrueRange[1](close))
OK message is clear. Thank you for your help. I appreciate it.
I don’t know how to download the indicator or where to look other than the page referenced above.
The answers to how to import and export are all on the page you provided the link for.
[attachment file=82138]