Uploading a custom indicator.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #223106 quote
    CharlesF1
    Participant
    New

    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.

    #223107 quote
    GraHal
    Participant
    Master

    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.

    #223109 quote
    CharlesF1
    Participant
    New

    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.

    #223110 quote
    JC_Bywan
    Moderator
    Master

    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

    #223111 quote
    JC_Bywan
    Moderator
    Master

    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.

    GraHal thanked this post
    #223119 quote
    CharlesF1
    Participant
    New

    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

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.

Uploading a custom indicator.


Platform Support: Charts, Data & Broker Setup

New Reply
Author
author-avatar
CharlesF1 @charlesf1 Participant
Summary

This topic contains 5 replies,
has 3 voices, and was last updated by CharlesF1
2 years, 3 months ago.

Topic Details
Forum: Platform Support: Charts, Data & Broker Setup
Language: English
Started: 11/01/2023
Status: Active
Attachments: No files
Logo Logo
Loading...