Coding Basics in ProRealTime

So with regard to relative strength, how is a basis established whereby an RS value can be said to be out/under performing the index. I assumed it was a straight ratio between stock price and index value but that's too simplistic.
 
So with regard to relative strength, how is a basis established whereby an RS value can be said to be out/under performing the index. I assumed it was a straight ratio between stock price and index value but that's too simplistic.

Im not sure I understand the question..i think though your basis is the result of one relative performance to another?

conisder the attached, relative to whatever you like its your call...
this is currently above zero and could be said to be outperforming its base, ie the denominator

now you compare another, and that is negative, so its underperforming..the basis is exactly the same, however one is outperforming and another underpeforming. which would you choose

now consider two where one has a higher relative strength than the other..which again would you choose? if both were outperforming the same basis..

again not sure i have answered, but hope it makes sense
 

Attachments

  • MRS.JPG
    MRS.JPG
    43.3 KB · Views: 350
OK, I think I'm getting head round it now, thanks again. I was trying to approach it as if I were to code it from scratch. When I mentioned a basis I was referring to the fact that the indicator oscillates either side of a zero line and was confused as to how this zero line is calculated. Having found a bit more info online, I think i am right in saying that the zero is set at a certain point back in time and the value of the indicator reflects a stocks relative strength with reference to this point.
 
I'm not getting anywhere with the screener based on relative strength. In my version of PRT, I don't think there's any way of referencing the indicator directly in the code. There's no way of referencing the index when coding from scratch either - so I reckon this one's a dead duck.(n) Any suggestions?
 
I thought I'd share the code for a moving average I've been playing with recently. It's a EMA smoothed by a second EMA. I hope you'll all remember me when you become mawty-miw-yon-aires.
 

Attachments

  • SSV.png
    SSV.png
    11.3 KB · Views: 403
  • SS.png
    SS.png
    19 KB · Views: 331
...How is this MA an improvement over the standard EMA?

If you half the setting compared to the standard EMA you get a similar line, in a similar place... But, it's a much smoother line. So, if for example you used the gradient of your MA to indicate a trend, you would have less whipsaws. Likewise for MA crosses etc.
 

Attachments

  • STDEMA.png
    STDEMA.png
    52.2 KB · Views: 348
  • Supersmooth.png
    Supersmooth.png
    54.6 KB · Views: 332
...How is this MA an improvement over the standard EMA?

If you half the setting compared to the standard EMA you get a similar line, in a similar place... But, it's a much smoother line. So, if for example you used the gradient of your MA to indicate a trend, you would have less whipsaws. Likewise for MA crosses etc.

Agreed. Have you looked at weighted average rather than EMA?. even smoother i find
wma of a wma
alternatively, and where the smoothing works really well is on those typical indicators such as bull/bear power, and stochastics. you can still have smaller settings without the whipsaw
 
Had to google WMAs! Never used them, but I see your point and will check them out(y)
 
In post #15 I coded a very basic trading system that involved a lot of curve fitting. Back testing it again shows it still to be profitable - I'm beginning to wish I'd thrown some money at it! Anyway, here's an update if you're interested, it runs from 16th August 2016 (where we left off) to the present...
 

Attachments

  • Update1.png
    Update1.png
    181.7 KB · Views: 358
  • Update2.png
    Update2.png
    83.8 KB · Views: 423
  • Update3.png
    Update3.png
    43.6 KB · Views: 343
In post #15 I coded a very basic trading system that involved a lot of curve fitting. Back testing it again shows it still to be profitable - I'm beginning to wish I'd thrown some money at it! Anyway, here's an update if you're interested, it runs from 16th August 2016 (where we left off) to the present...

Its done good mate, not much % drawdown. I reckon you can sell it now on the black box market £297!
 
Top