Re: No Nonsense Forex - Indicators

171
Centaur wrote: Sat Feb 25, 2023 6:04 pm Cong Adaptive Moving Average (CAMA)

https://in.tradingview.com/script/hOCmX ... g-Average/

Code: Select all

//+------------------------------------------------------------------+
//| Cong Adaptive Moving Average (CAMA)                              |
//+------------------------------------------------------------------+
int maCongAdaptive(const int rates_total,
                   const int prev_calculated,
                   const int value_length, // min val: 1; default val: 10
                   const double &source_price[],
                   const double &source_high[],
                   const double &source_low[],
                   const double &source_close[],
                   double &temp_true_range[],
                   double &result_value[],
                   double &result_color[])
  {
//--- bar index start
   int bar_index;
   if(prev_calculated == 0)
      bar_index = 0;
   else
      bar_index = prev_calculated - 1;
//--- main loop
   for(int i = bar_index; i < rates_total && !_StopFlag; i++)
     {
      temp_true_range[i] = i < 1 ? source_high[i] - source_low[i] : fmax(source_high[i] - source_low[i], fmax(fabs(source_high[i] - source_close[i - 1]), fabs(source_low[i] - source_close[i - 1])));
      if(i < value_length)
        {
         result_value[i] = source_price[i];
         result_color[i] = EMPTY_VALUE;
        }
      else
        {
         double denom = 0.0, hh = -DBL_MAX, ll = DBL_MAX;
         for(int k = 0; k < value_length; k++)
           {
            denom += temp_true_range[i - k];
            hh = source_high[i - k] > hh ? source_high[i - k] : hh;
            ll = source_low[i - k] < ll ? source_low[i - k] : ll;
           }
         double num = hh - ll;
         double alpha = num / denom;
         result_value[i] = alpha == 1.0 ? alpha * source_price[i] : alpha * source_price[i] + (1.0 - alpha) * result_value[i - 1];
         result_color[i] = StringToDouble(DoubleToString(result_value[i], _Digits)) > StringToDouble(DoubleToString(result_value[i - 1], _Digits)) ? 0.0 : StringToDouble(DoubleToString(result_value[i], _Digits)) < StringToDouble(DoubleToString(result_value[i - 1], _Digits)) ? 1.0 : result_color[i - 1];
        }
     }
   return(rates_total);
  }
Nice job!
These users thanked the author mrtools for the post (total 2):
Chickenspicy, Banzai


Re: No Nonsense Forex - Indicators

172
Supertrend Averages

Request from @pfxi for a Supertrend Averages with arrows, please let me know if other average types are required.

Changes made:
1.) True Range Calculation = ​max [(high − low), abs(high − previous close​), abs(low – previous close)]
2.) Average True Range Calculation = first ATR value is the SMA(TR, n) then becomes [(Prior ATR x(n-1)) + Current TR]/n
These users thanked the author Centaur for the post (total 6):
Chickenspicy, kvak, rudiarius, tradd, pfxi, eduarescobar
半人馬座
Bàn rénmǎzuò

If you enjoy my work please hit the like button, to show some support.
All comments, criticism, advise or general ideas are more than welcome. In fact its crucial to have a continues learning / developing mechanism not just for me but all fellow market enthusiasts.

Re: No Nonsense Forex - Indicators

173
Centaur wrote: Tue Feb 28, 2023 5:57 am Supertrend Averages

Request from @pfxi for a Supertrend Averages with arrows, please let me know if other average types are required.

Changes made:
1.) True Range Calculation = ​max [(high − low), abs(high − previous close​), abs(low – previous close)]
2.) Average True Range Calculation = first ATR value is the SMA(TR, n) then becomes [(Prior ATR x(n-1)) + Current TR]/n
Image

Image

Image
Hello Centaur,

G Channel trend average could be. By the way, G channels indicator sometimes doesn't appear. After changing channel lenght, indicator appears.

Re: No Nonsense Forex - Indicators

174
tradd wrote: Wed Mar 01, 2023 5:40 pm Hello Centaur,

G Channel trend average could be. By the way, G channels indicator sometimes doesn't appear. After changing channel lenght, indicator appears.
@tradd apologies for this, I've noticed this as well. Will fix and yes I agree a G-Channel Averages will be interesting. Will make work of it.
These users thanked the author Centaur for the post:
sylvester21
半人馬座
Bàn rénmǎzuò

If you enjoy my work please hit the like button, to show some support.
All comments, criticism, advise or general ideas are more than welcome. In fact its crucial to have a continues learning / developing mechanism not just for me but all fellow market enthusiasts.

Re: No Nonsense Forex - Indicators

175
Centaur wrote: Wed Mar 01, 2023 7:46 pm @tradd apologies for this, I've noticed this as well. Will fix and yes I agree a G-Channel Averages will be interesting. Will make work of it.
Just an open question to the community: (1) would averages applied to the price as a price filter be more effective? (2) Or alternatively averages applied to the final indicator output be more effective? (3) Or thirdly averages applied to both 1 and 2? And if 3 is chosen would one need to control both ends separately, as an input?

Please keep in mind with the addition of every average lag is introduced.
半人馬座
Bàn rénmǎzuò

If you enjoy my work please hit the like button, to show some support.
All comments, criticism, advise or general ideas are more than welcome. In fact its crucial to have a continues learning / developing mechanism not just for me but all fellow market enthusiasts.


Re: No Nonsense Forex - Indicators

176
Moving average filter applied to price with a lookback period of 1 before calculating an indicator in mql4

I've converted numerous of mql4 indicators to mql5, and I always pickup that the coder filters price with a standard simple moving average with a lookback period of 1.

Why would one do this, is a SMA with a lookback period of 1 not price itself? The only possible reason I can think of is to prevent any unforeseen price anomalies with metatrader, are these anomalies possible in metatrader?
半人馬座
Bàn rénmǎzuò

If you enjoy my work please hit the like button, to show some support.
All comments, criticism, advise or general ideas are more than welcome. In fact its crucial to have a continues learning / developing mechanism not just for me but all fellow market enthusiasts.

Re: No Nonsense Forex - Indicators

177
Centaur wrote: Thu Mar 02, 2023 7:42 pm Moving average filter applied to price with a lookback period of 1 before calculating an indicator in mql4

I've converted numerous of mql4 indicators to mql5, and I always pickup that the coder filters price with a standard simple moving average with a lookback period of 1.

Why would one do this, is a SMA with a lookback period of 1 not price itself? The only possible reason I can think of is to prevent any unforeseen price anomalies with metatrader, are these anomalies possible in metatrader?
Hello.
I read a post somewhere, but I can't find it anymore.....I think it was from Mr. Mladen. How easily handle prices.... Yes, simply 1 period ma of price is price.....

Code: Select all

input ENUM_APPLIED_PRICE MAPrice     = PRICE_CLOSE;     // Ma price to use

Code: Select all

iMA(NULL,0,1,0,MODE_SMA,MAPrice,i)
These users thanked the author kvak for the post:
Centaur

Re: No Nonsense Forex - Indicators

178
Centaur wrote: Thu Mar 02, 2023 7:34 pm Just an open question to the community: (1) would averages applied to the price as a price filter be more effective? (2) Or alternatively averages applied to the final indicator output be more effective? (3) Or thirdly averages applied to both 1 and 2? And if 3 is chosen would one need to control both ends separately, as an input?

Please keep in mind with the addition of every average lag is introduced.
It's hard to say what would be effective, it depends what you want, low lag outputs, but nervous, or smoothed, but lagged.....
These users thanked the author kvak for the post (total 2):
Centaur, Krunal Gajjar

Re: No Nonsense Forex - Indicators

179
Braid Filter
This indicator was first introduced in 2006 in the Stocks and Commodities Magazine by a gentleman named Robert Hill also known as “Mr.Pips”. The “braid” is formed by intersections of lines based on different moving averages. The difference between the two is then plotted as a histogram. Filter line is based on a percentage of the ATR value.
These users thanked the author Centaur for the post (total 2):
Krunal Gajjar, eduarescobar
半人馬座
Bàn rénmǎzuò

If you enjoy my work please hit the like button, to show some support.
All comments, criticism, advise or general ideas are more than welcome. In fact its crucial to have a continues learning / developing mechanism not just for me but all fellow market enthusiasts.

Re: No Nonsense Forex - Indicators

180
Linear Regression Candles and UT Bot Arrows



https://in.tradingview.com/v/n8ss8BID/

https://in.tradingview.com/v/hMaQO1FX/
These users thanked the author Centaur for the post (total 6):
thomdel, LittleCaro, global, tradd, RodrigoRT7, Sutatong
半人馬座
Bàn rénmǎzuò

If you enjoy my work please hit the like button, to show some support.
All comments, criticism, advise or general ideas are more than welcome. In fact its crucial to have a continues learning / developing mechanism not just for me but all fellow market enthusiasts.


Who is online

Users browsing this forum: cheer4u, IBM oBot [Bot] and 8 guests