I wish to be able to use peakbar and troughbar as bar references for comparison with changes in price at the same bar locations defined by these series. I have probably made a basic error with syntax, but I would appreciate some help.
e.g. Having defined a dataseries "troughbar", I would have thought that I could then find the int at "bar" from this series. If I include "int TB = troughbar[bar];" below, the code doesn't compile.
The intention of defining this int is to use it in some sort of price comparison such as "if( Low[TB] < Low[LB], SellAt etc )". I am wondering what I am missing?
Also, if there is a more sophisticated way of looking at a peak which was "n" peaks ago, I would appreciate the suggestion.
CODE:
Please log in to see this code.