Uploading a custom indicator.
Forums › ProRealTime English forum › ProRealTime platform support › Uploading a custom indicator.
- This topic has 5 replies, 3 voices, and was last updated 1 year ago by CharlesF1.
-
-
11/01/2023 at 11:38 AM #223106
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.
11/01/2023 at 11:58 AM #22310711/01/2023 at 2:52 PM #223109Thanks.
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 IfRETURN
All help will be greatly appreciated.
11/01/2023 at 2:58 PM #223110Hi, you can try these lines instead:
123456789If myH > fHigh Then // If we found a higher highfHigh = myH // Record new highEndIfIf L < fLow Then// If we found a lower lowfLow = L // Record new lowEndIf//EndIfRETURNMore details why in next post
11/01/2023 at 3:07 PM #223111Several 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.
1 user thanked author for this post.
11/01/2023 at 5:53 PM #223119Hi,
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
-
AuthorPosts
Find exclusive trading pro-tools on