Hi mladenmladen wrote:
Please,
Can you explain in plain words what was the exact intention (what was the indicator supposed to do) so that we can check if we can help?
Excuse my bad English, it is not my native language.
I will try to explain what I try to accomplish:
First:
Original code:
Code: Select all
extern string TimeFrame = "Current time frame"; // Time frame to use
Try to modify the Timeframe selection in the parameters, simply to make it simpler
Code: Select all
extern ENUM_TIMEFRAMES TimeFrame = PERIOD_CURRENT; // Time frame
//---------------------------------------------------------------------
Second:
Try to modify the original code, the power to select different moving averages to apply to the smoothing.
Code: Select all
if (Close[i]>iMA(NULL,0,SmoothPeriod,0,MODE_SMA,PRICE_CLOSE,i)) volume = (double) Volume[i];
Code: Select all
extern maTypes MaMethod = 19;
Code: Select all
enum maTypes
{
ma_sma, // simple moving average - SMA
ma_ema, // exponential moving average - EMA
ma_dsema, // double smoothed exponential moving average - DSEMA
ma_dema, // double exponential moving average - DEMA
ma_tema, // tripple exponential moving average - TEMA
ma_smma, // smoothed moving average - SMMA
ma_lwma, // linear weighted moving average - LWMA
ma_pwma, // parabolic weighted moving average - PWMA
ma_alxma, // Alexander moving average - ALXMA
ma_vwma, // volume weighted moving average - VWMA
ma_hull, // Hull moving average
ma_tma, // triangular moving average
ma_sine, // sine weighted moving average
ma_linr, // linear regression value
ma_ie2, // IE/2
ma_nlma, // non lag moving average
ma_zlma, // zero lag moving average
ma_lead, // leader exponential moving average
ma_ssm, // super smoother
ma_smoo // smoother
};
Also try to modify the original code the calculation based on that price (closing, maximum, minimum ... etc).
Code: Select all
if (Close[i]>iMA(NULL,0,SmoothPeriod,0,MODE_SMA,PRICE_CLOSE,i)) volume = (double) Volume[i];
Code: Select all
extern enPrices Price = pr_close;
Code: Select all
enum enPrices
{
pr_close, // Close
pr_open, // Open
pr_high, // High
pr_low, // Low
pr_median, // Median
pr_typical, // Typical
pr_weighted, // Weighted
pr_average, // Average (high+low+open+close)/4
pr_medianb, // Average median body (open+close)/2
pr_tbiased, // Trend biased price
pr_tbiased2, // Trend biased (extreme) price
pr_haclose, // Heiken ashi close
pr_haopen , // Heiken ashi open
pr_hahigh, // Heiken ashi high
pr_halow, // Heiken ashi low
pr_hamedian, // Heiken ashi median
pr_hatypical, // Heiken ashi typical
pr_haweighted, // Heiken ashi weighted
pr_haaverage, // Heiken ashi average
pr_hamedianb, // Heiken ashi median body
pr_hatbiased, // Heiken ashi trend biased price
pr_hatbiased2 // Heiken ashi trend biased (extreme) price
};
Compare the original code, with the attempt that I make.
I hope you understand what I intended to do.
A greeting
Hermo