How do you define a Custom Indicator?

Forums ProRealTime English forum ProOrder support How do you define a Custom Indicator?

  • This topic has 0 replies, 1 voice, and was last updated 6 years ago by avatarBard.
Viewing 1 post (of 1 total)
  • #85534

    Hi, I had an indicator I was using in a strategy, the Belkhayate Centre of Gravity found here:
    https://www.prorealcode.com/topic/center-of-gravity/#post-19219
    and it says “the variable needs to be defined” when I use the name of the indicator in the code.

    1) But how do you define it? I mean it’s in my list of indicators and so I thought it would “turn green” when added in the code like when you use an indicator like “average,” but apparently not… and so I’m not sure how to include it other than “calling” it and using some c1’s and c2’s etc.

    2) It doesn’t like lines 19 and 20 from the code pasted here below (with and without ” ” ).

    3) What I’m trying to do is define the best way (hence Idea #1 and #2) to determine the “slope” of the CoG so I can trade in that direction (albeit entering on some extreme std deviations on price).

    Paper trading this CoG line has been profitable, (even though it repaints because of the Detrended Price Oscillator), making a decision on the last bar available as to what is going to happen on the next bar and in conjunction with using the Mesa Trendline and Kalman Filter and Ehler’s CoG, seems effective. See CoG screenshot.

    4) It would also be nice to know what’s the best way not to trade when the market’s flat? Maybe using the MBFX Timing Indicator mid region or the ADX) but I also read the following on a forum post about “slopes” where Nicolas said: “It has already been discussed, it’s a common request since it should give an information about the trend slope. But the inclination (slope) of a moving average is nothing more than its percentage gain or loss since X periods. But you can get an error rate of the linear regression on a moving average like this:

    If the correlation is high, the moving average tends to be more similar to a straight trend line. Otherwise, I know there is this kind of indicator for mt4 (see attached screenshot), I think I could help to translate it. Lot of people are looking for a moving average angle indicator .. I don’t know how it’s calculated and its relevancy but we could give it a try?” (pls see screenshot).

    The thing is you can still have a shallow angled but relatively straight trend line so it’s not that easy to gain any great insight.

    Cheers for any thoughts in how to get this strategy coded.

     

Viewing 1 post (of 1 total)

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