I am attempting to upload a custom indicator. The code has been written into the appropriate window in Pro-RealTime. When I press the ‘add to chart’ button I receive the error message – “An indicator code must end with the keyword RETURN to define what to display”. My code DOES end with the word RETURN. Am I missing something? Thanks, Charles.
If you don’t want to post the full code then post the last 5 or 6 lines; somebody may then have ideas as to source of the problem.
Thanks.
The last few lines of code read:
If H > fHigh Then ‘ If we found a higher high
fHigh = H ‘ Record new high
End If
If L < fLow The ‘ If we found a lower low
fLow = L ‘ Record new low
End If
End If
RETURN
All help will be greatly appreciated.
Hi, you can try these lines instead:
If myH > fHigh Then // If we found a higher high
fHigh = myH // Record new high
EndIf
If L < fLow Then// If we found a lower low
fLow = L // Record new low
EndIf
//EndIf
RETURN
More details why in next post
Several errors prevented the code to understand it in PRT, and the return word in the end couldn’t be read as such in the wake of all preceding errors.
List of errors:
– using ‘ instead of // to add comments at end of lines, makes it read the words of the attempted comments as coding language with errors
– using H which is an old reserved word for hours even if not used now, you can replace it elsewhere too in the code with “myH” or another name if you don’t like myH
– there are 3 endif for 2 if, I have commented out one of them (unless it was associated to a third “if” not given in the copy paste adding to the confusion, in which case you can leave it in instead…
Chances are: it wasn’t a PRT code to start with, and if that’s the case, there’s a high probability to have several more errors inside the rest of your code still preventing it from working despite fixing these few lines.
Hi,
Many thanks for your two responses.
You’re right, it’s not PRT code originally. I tried your alternative lines which did not work, so I think there must be other errors. I think I’m going to have to get a coder to help with this problem.
Thank you very much for your prompt assistance.
Charles