Code to buy/sell on a colour indicator

Forums ProRealTime English forum ProOrder support Code to buy/sell on a colour indicator

Viewing 12 posts - 1 through 12 (of 12 total)
  • #56788

    I want to test an indicator that changes colour when going long or short.  How can I program it with reference to the colour change to buy or sell a contract.

     

     

     

     

    #56789

    Need more information / parameters  , code for indicators would help  , i will give it a go

    #56791

    The indicator I am testing is Ron Blacks Swing Line Indicator. Thanks

    #56792

    Here is the code:

    //PRC_SwingLine Ron Black | indicator
    //20.09.2017
    //Nicolas @ http://www.prorealcode.com
    //Sharing ProRealTime knowledge

    if upsw=1 then
    if high>hH then
    hH=high
    endif
    if low>hL then
    hL=low
    endif

    if high<hL then
    upsw=0
    lL=low
    lH=high
    endif
    endif

    if upsw=0 then
    if low<lL then
    lL=low
    endif
    if high<lH then
    lH=high
    endif

    if low>lH then
    upsw=1
    hH=high
    hL=low
    endif
    endif

    if upsw=1 then
    swingline=hL
    r=0
    g=255
    b=255
    else
    swingline=lH
    r=255
    g=0
    b=255
    endif

    return swingline coloured(r,g,b) style(line,2) as “Swing Line”

    #56793

    use the <> symbol to post code and a screenshot of indi on a chart would be nice  , Some clear definition of EXACTLY what you require would be nice as well

     

    If you require a sell/buy on indicator colourchange you will need more than just an indicator also  >> a pro order code required

     

    Hint its pretty hard to produce an accurate precision pro order code on ambiguous non existant plan    … details required

    #56794

     

    #56796

    The magenta and green lines weaving through the candles are the indicator

    #56799

    The magenta and green lines weaving through the candles are the indicator

    Still not a precise request but ive assumed this is what you require  , you need to get better at defining parameters , still very ambiguous . Anyway as i expected what ive written chops you up in all but strong trending periods . More filter required imo

     

    #56801

    Thanks very much for your help.  I will include other parameters to strengthen the code, as I am aware how to do that.  It was the colour changes that had me confused. Sorry for the ambiguity, will try and be clearer next time.

    #56802

    This is probably a better easier way to produce code

     

    #56805

    Or even go a step further . Just trying to reduce lines and characters in code , this is all good practice for me

     

    1 user thanked author for this post.
    #56848

    Colours don’t exist, they are just a graphical way to make prices/lines clearer.

    If a candlestick is blue (or green or white)  you know it’s a BULLish one. A piece of code can only tell it because you let it compare the closing price to the opening one, if it’s greater it must be BULLish!

    So to know if a n SMA line is green you simply have to test whether the current closing price is greater than the one of the previous candlestick

    1 user thanked author for this post.
Viewing 12 posts - 1 through 12 (of 12 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login