Final line of code syntax error.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #97379 quote
    coolusername
    Participant
    New

    Hi,

    I am in the process of converting my expert from metastock into an indicator to use in prorealtime and have been scratching my head on the last bit for awhile now.

    This section is looking for a short upper or lower wick ( on a candle dominant candle ).

    I have the Dominant candle portion of the code working fine but need to add in a condition for a short leading wick to reflect the Metastock system accurately.

    This is the guts of what I am working on at the moment

     

    Wick = 0
    candlength=High-Low
    bodylength=Abs(open-close)
    upperwick=high-close
    lowerwick=Close-low
    
    IF (bodylength/candlength) > 0.6 AND (upperwick/candlength) <0.25 then
    Wick = open-close
    R = 0
    G = 128
    endif
    
    IF (bodylength/candlength) > 0.6 AND (lowerwick/candlength) <0.25 then
    Wick = open-close
    R = 128
    G = 0
    ENDif
    
    return Wick coloured(R,G,0) Style(histogram ,2) as "Dominant"

     

    I keeping getting a syntax error for the final line of code?

    Can anyone help with what I might be missing ?

    #97388 quote
    Vonasi
    Moderator
    Master

    coolusername– Welcome to the forums. There are a few simple rules that you need to follow when starting topics. Please give your topic a meaningful title and not something like ‘Help needed’. I have changed your topic title to more accurately reflect the topic.

    Also please always use the ‘Insert PRT Button’ when posting code as it makes it far more readable for others. I have tidied up your post. 🙂

    As far as your code is concerned I can see no syntax error in it and so have to guess that you are writing indicator code in a strategy code window. RETURN can only be used in indicator coding. When I create your code as an indicator I get no error.

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

Final line of code syntax error.


ProBuilder: Indicators & Custom Tools

New Reply
Author
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by Vonasi
6 years, 9 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 04/30/2019
Status: Active
Attachments: No files
Logo Logo
Loading...