Cross Over Indicator HELP please

Forums ProRealTime English forum ProBuilder support Cross Over Indicator HELP please

  • This topic has 45 replies, 3 voices, and was last updated 1 year ago by avatarJS.
Viewing 15 posts - 1 through 15 (of 46 total)
  • #56777

    Hi Nicolas and all,

    I have tried to create a simple EMA crossover indicator where it gives me an Arrow up or down once crossover happened. I really want to add somthing to this..

    all in 15 min chart.. lets say after the crossover i would wait until 5 bars on 15 min and enter 5 pips below the low or 5 pips above the high within that 5 candles sticks?  please see the attached pic!!

    I just need a small line (with the price if possible).. 5 pips below the lowest point 0f that 5 candles (once 9 cross under 40) on 15 min chart!!! see the pic attached!!

    please if you can kindly check this below and help me creating this.. i’d really appreciate it..

    fast = ExponentialAverage[9](close)
    slow = ExponentialAverage[40](close)

    //first arrow is blueish
    if fast crosses over slow then
    cross = slow[1]
    DRAWARROWUP(barindex,LOW-5*pointsize) COLOURED(0,255,10)
    endif

    //next arrows are purple and semi transparent
    if fast>slow AND slow<>cross then
    DRAWTEXT(“*”,barindex, slow) COLOURED(0,204,0)
    endif

    //first arrow is blueish
    if fast crosses under slow then
    cross = slow[1]
    DRAWARROWDOWN(barindex,HIGH+5*pointsize) COLOURED(255,0,10)
    endif

    //next arrows are purple and semi transparent
    if fast<slow AND slow<>cross then
    DRAWTEXT(“*”,barindex, slow) COLOURED(255,0,0)
    endif

    RETURN

    #56783

    >> For clarity of messages on ProRealCode’s forums, please use the “insert PRT code” button to separate the text of the code part! Thank you! <<

     

    #56787

    😉

     

    #56826

    Sorry still new to this!

    is it possible to creatvthe the line to 5pips below the lowest of 5 candles??

    #56829

    I modified the above code so that it does not display dots and does not display lines if more than one arrow occurs before 5 candles have elapsed (no matter what direction they are):

    Roberto

    1 user thanked author for this post.
    #56881

    Nice work Robertogozzi but it gets a bit confusing to work out which is the top line and which is the bottom line when they are the same colour – better to make them green and red for easier identification I think.

    1 user thanked author for this post.
    #56885

    You can select any colour from this table, just change the RGB  values in the code

    https://www.prorealcode.com/documentation/coloured/

    1 user thanked author for this post.
    #56893

    Hi Roberto,

    Thanks very much for this.. I was trying to get this right for the past three weeks!! i thnk you made a better version too.. i think i can change the colours,  EMAs etc..!! thank you!!

    is there a place that I can learn about cording?

    #56918

    You can browse documentation and topics for subjects of interest to you with lots of example code.

    Nicolas made a few videos but I think they are in French.

    You can alsotry to search YouTube or the web for video lessons.

    Luckily PRT uses a very simple Language, compared to common computer languages and you should find it not too difficult to find out how to use, and when, constructs like IF…ENDIF or FOR…NEXT.

    1 user thanked author for this post.
    #56920

    Another way to learn is just…. asking this forum, like you did!

    #56921

    I learnt a lot from this forum… Thanks again! 🙂

     

    #57194

    Hi Roberto,

    I have managed to create a screener for this but not sure it’s 100% correct?  I wanted to get the signal when it’s crossover or under saying EMA X 15 or -15  as an up trend (15)or down trend (-15)..

    also just wanted to know is there a was when its cross over or under.. we get an arrow up or down on the screener?

    problem with my screener is… (lets say if it crossover? and then cross under with few candles.. it will still for and crossover)

    please if I can get your expertise would be great!

    Thanks

    RO

     

     

     

     

    #57212
    1. a screener can only contain the keyword SCREENER once, so line 6 must be removed
    2. lines 8-9 are duplicates and can be removed
    3. line 10 sould use c2 instead of c1
    4. line 13 should read ‘SCREENER[c1 or c2] ( c1 or c2 AS “EMA X”)’
    5. lines 6 and 13 are not so clear, what do you mean by EMA X and what do you expect those expressions to return?
    6. what use is number 10 within brackets in lines 3 and 10?  It means that the last 10 candlesticks are scanned to verify a matching condition, but C1 and C2 could both be true… is that what you want?

    I need those details to show you something working, but I can anticipate something

    Also, screener cannot draw any graphics. It can only display numbers. In such a case we can tell OVER from UNDER by 1, -1 or 2 when c1 AND c2 are both true.

     

    #57824

    Hi Roberto,

    sorry for the late and thank you for your support again!

    c1 = summation [10] is for past 10 candles sticks. I think the one you made is for past 5 candles? and when 5 candles gone the screener will disappear i guess?  i want it to be on the screen for 10 bars.. is the below one correct for that?

    let’s say it cross over to go up and it will show on the screener as 1 and then will stay for next 10 bars? if it crosses back under to go down again within that 10 bars will show as 2? and if after 10 bars if it crosses under to go down will show as -1?

    thanks for your patience.

    RO

     

     

     

    #57831

    Yes, when both crossings have occurred within the last “Bars” (5, 10 or whatever 0ther number you want) bars 2 will be returned; when only the crossing upwards occured it will return 1, -1 when it’s southbound and Zero when no crossing occurred at all.

     

Viewing 15 posts - 1 through 15 (of 46 total)

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