Experiments ... - page 81

 
mladen:
Post your iCustom() call so that it can be revised (and helped) if necessary

Ok, I will post iCustom here for check

Thanks,

Goran  

 
roccobarocco:

Ok, I will post iCustom here for check. 

Thanks,

Goran  

hi, 

I have defined variables and icustom. Can you please check and help me to define this correctly. 

extern ENUM_TIMEFRAMES TimeFrame1  = PERIOD_CURRENT;

extern int        ExternTimeFrame1 = 0; 

extern int        period1          = 2;

extern int        average_method1        = 0; 

extern int        price_to_use    = 0;

extern bool       double_smooth  = false;

extern bool       adaptive_average = false; 

extern enCalcType Type1            = st_atr;         

extern double     filter1         = 0.0; 

extern int        atr_period      = 1;             

extern double     atr_multiplier  = 1.1;

extern int        display_type    = 0;

extern int        line_width      = 3;

extern int        bars_width      = 1;           

extern bool       alertsOn        = false;    

 

double green1 = iCustom(symbol,timeframe,"SuperTrend averages 2.6",TimeFrame1,ExternTimeFrame1,period1,average_method1,price_to_use,double_smooth,adaptive_average,Type1,filter1,atr_period,atr_multiplier,display_type,line_width,bars_width,alertsOn,2,bar)

 
roccobarocco:

hi, 

I have defined variables and icustom. Can you please check and help me to define this correctly. 

extern ENUM_TIMEFRAMES TimeFrame1  = PERIOD_CURRENT;

extern int        ExternTimeFrame1 = 0; 

extern int        period1          = 2;

extern int        average_method1        = 0; 

extern int        price_to_use    = 0;

extern bool       double_smooth  = false;

extern bool       adaptive_average = false; 

extern enCalcType Type1            = st_atr;         

extern double     filter1         = 0.0; 

extern int        atr_period      = 1;             

extern double     atr_multiplier  = 1.1;

extern int        display_type    = 0;

extern int        line_width      = 3;

extern int        bars_width      = 1;           

extern bool       alertsOn        = false;    

 

double green1 = iCustom(symbol,timeframe,"SuperTrend averages 2.6",TimeFrame1,ExternTimeFrame1,period1,average_method1,price_to_use,double_smooth,adaptive_average,Type1,filter1,atr_period,atr_multiplier,display_type,line_width,bars_width,alertsOn,2,bar)

Here is a complete code that allows you ta have proper enums and correct parameters for the SuperTrend averages - version 2.6

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
};
enum enCalcType
{
   st_atr, // Use atr
   st_std, // Use standard deviation
   st_ste, // Use standard error
   st_sam, // Custom strandard deviation - with sample correction
   st_nos  // Custom strandard deviation - without sample correction
};
enum enMaTypes
{
   ma_adxvma,  // Adxvma
   ma_ahr,     // Ahrens moving average
   ma_alxma,   // Alexander moving average - ALXMA
   ma_dema,    // Double exponential moving average - DEMA
   ma_dsema,   // Double smoothed exponential moving average - DSEMA
   ma_emas,    // Ema derivative - EMAD
   ma_ema,     // Exponential moving average - EMA
   ma_hull,    // Hull moving average - HMA
   ma_ie2,     // IE/2
   ma_ilinr,   // Integral of linear regression slope
   ma_itl,     // Instantaneous trendline
   ma_lagg,    // Laguerre filter
   ma_lead,    // Leader exponential moving average
   ma_linr,    // Linear regression value - LSMA
   ma_lwma,    // Linear weighted moving average - LWMA
   ma_mcg,     // McGinley Dynamic
   ma_mcma,    // McNicholl ema
   ma_nlma,    // Non lag moving average
   ma_pwma,    // Parabolic weighted moving average - PWMA
   ma_rmta,    // Recursive moving trendline - RMTA
   ma_sma,     // Simple moving average - SMA
   ma_sid,     // Simple decycler - SDEC
   ma_sine,    // Sine weighted moving average
   ma_smma,    // Smoothed moving average - SMMA
   ma_smoo,    // Smoother
   ma_ssm,     // Super smoother
   ma_b3p,     // Three pole Ehlers Butterworth
   ma_s3p,     // Three pole Ehlers smoother
   ma_tma,     // Triangular moving average - TMA
   ma_tema,    // Tripple exponential moving average - TEMA
   ma_b2p,     // Two pole Ehlers Butterworth
   ma_s2p,     // Two pole Ehlers smoother
   ma_vema,    // Volume weighted ema - VEMA
   ma_vwma,    // Volume weighted moving average - VWMA
   ma_zldema,  // Zero lag dema
   ma_zlma,    // Zero lag moving average
   ma_zltema   // Zero lag tema
};
enum enTimeFrames
{
   tf_cu  = 0,              // Current time frame
   tf_m1  = PERIOD_M1,      // 1 minute
   tf_m5  = PERIOD_M5,      // 5 minutes
   tf_m15 = PERIOD_M15,     // 15 minutes
   tf_m30 = PERIOD_M30,     // 30 minutes
   tf_h1  = PERIOD_H1,      // 1 hour
   tf_h4  = PERIOD_H4,      // 4 hours
   tf_d1  = PERIOD_D1,      // Daily
   tf_w1  = PERIOD_W1,      // Weekly
   tf_mb1 = PERIOD_MN1,     // Monthly
   tf_cus = 12345678        // Custom time frame
};
enum enIterpolation
{
   int_noint, // No interpolation
   int_line,  // Linear interpolation
   int_quad   // Quadratic interpolation
};
enum enDisplay
{
   en_lin,  // Display line
   en_his,  // Display colored bars
   en_all,  // Display colored lines and bars
   en_lid,  // Display lines with dots
   en_hid,  // Display colored bars with dots
   en_ald,  // Display colored lines and bars with dots
   en_dot   // Display dots
};

extern enTimeFrames   TimeFrame       = tf_cu;     // Time frame
extern int            TimeFrameCustom = 0;         // Custom time frame to use (if custom time frame used)
extern int            avgPeriod       = 10;        // Average period
extern enMaTypes      avgMethod       = ma_ema;    // Average method    
extern enPrices       appliedPrice    = pr_median; // Price to use
extern bool           Double          = false;     // Double smoothed average?
extern bool           Adaptive        = false;     // Adaptive average?
extern enCalcType     Type            = st_atr;    // Calculate using :
extern double         Filter          = 0;         // Filter to use for filtering (<=0 - no filtering)
extern int            atrPeriod       = 50;        // Atr/err/dev period
extern double         atrMultiplier   = 2.0;       // Atr/err/dev multplier
extern enDisplay      DisplayType     = en_lin;    // Display type
extern int            LinesWidth      = 3;         // Lines width (when lines are included in display)
extern int            BarsWidth       = 1;         // Bars width (when bars are included in display)
extern bool           alertsOn        = true;      // Turn alerts on
extern bool           alertsOnCurrent = false;     // Alerts on current (still opened) bar
extern bool           alertsMessage   = true;      // Alerts should show pop-up message
extern bool           alertsSound     = false;     // Alerts should play alert sound
extern bool           alertsPushNotif = false;     // Alerts should send push notification
extern bool           alertsEmail     = false;     // Alerts should send email
extern int            ArrowCodeUp     = 159;       // Arrow code up
extern int            ArrowCodeDn     = 159;       // Arrow code down
extern double         ArrowGapUp      = 0.5;       // Gap for arrow up        
extern double         ArrowGapDn      = 0.5;       // Gap for arrow down
extern bool           ArrowOnFirst    = true;      // Arrow on first bars
extern enIterpolation Interpolate     = int_line;  // Interpolating method when using multi time frame mode
 
mladen:

Here is a complete code that allows you ta have proper enums and correct parameters for the SuperTrend averages - version 2.6


Dearest MLADEN

:) :) :)

If too much more efforts needs to complete a simple EA of this ver,i guess a big body Elephant passed and only a tail is behind.

regards

 
mladen:

Here is a complete code that allows you ta have proper enums and correct parameters for the SuperTrend averages - version 2.6

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
};
enum enCalcType
{
   st_atr, // Use atr
   st_std, // Use standard deviation
   st_ste, // Use standard error
   st_sam, // Custom strandard deviation - with sample correction
   st_nos  // Custom strandard deviation - without sample correction
};
enum enMaTypes
{
   ma_adxvma,  // Adxvma
   ma_ahr,     // Ahrens moving average
   ma_alxma,   // Alexander moving average - ALXMA
   ma_dema,    // Double exponential moving average - DEMA
   ma_dsema,   // Double smoothed exponential moving average - DSEMA
   ma_emas,    // Ema derivative - EMAD
   ma_ema,     // Exponential moving average - EMA
   ma_hull,    // Hull moving average - HMA
   ma_ie2,     // IE/2
   ma_ilinr,   // Integral of linear regression slope
   ma_itl,     // Instantaneous trendline
   ma_lagg,    // Laguerre filter
   ma_lead,    // Leader exponential moving average
   ma_linr,    // Linear regression value - LSMA
   ma_lwma,    // Linear weighted moving average - LWMA
   ma_mcg,     // McGinley Dynamic
   ma_mcma,    // McNicholl ema
   ma_nlma,    // Non lag moving average
   ma_pwma,    // Parabolic weighted moving average - PWMA
   ma_rmta,    // Recursive moving trendline - RMTA
   ma_sma,     // Simple moving average - SMA
   ma_sid,     // Simple decycler - SDEC
   ma_sine,    // Sine weighted moving average
   ma_smma,    // Smoothed moving average - SMMA
   ma_smoo,    // Smoother
   ma_ssm,     // Super smoother
   ma_b3p,     // Three pole Ehlers Butterworth
   ma_s3p,     // Three pole Ehlers smoother
   ma_tma,     // Triangular moving average - TMA
   ma_tema,    // Tripple exponential moving average - TEMA
   ma_b2p,     // Two pole Ehlers Butterworth
   ma_s2p,     // Two pole Ehlers smoother
   ma_vema,    // Volume weighted ema - VEMA
   ma_vwma,    // Volume weighted moving average - VWMA
   ma_zldema,  // Zero lag dema
   ma_zlma,    // Zero lag moving average
   ma_zltema   // Zero lag tema
};
enum enTimeFrames
{
   tf_cu  = 0,              // Current time frame
   tf_m1  = PERIOD_M1,      // 1 minute
   tf_m5  = PERIOD_M5,      // 5 minutes
   tf_m15 = PERIOD_M15,     // 15 minutes
   tf_m30 = PERIOD_M30,     // 30 minutes
   tf_h1  = PERIOD_H1,      // 1 hour
   tf_h4  = PERIOD_H4,      // 4 hours
   tf_d1  = PERIOD_D1,      // Daily
   tf_w1  = PERIOD_W1,      // Weekly
   tf_mb1 = PERIOD_MN1,     // Monthly
   tf_cus = 12345678        // Custom time frame
};
enum enIterpolation
{
   int_noint, // No interpolation
   int_line,  // Linear interpolation
   int_quad   // Quadratic interpolation
};
enum enDisplay
{
   en_lin,  // Display line
   en_his,  // Display colored bars
   en_all,  // Display colored lines and bars
   en_lid,  // Display lines with dots
   en_hid,  // Display colored bars with dots
   en_ald,  // Display colored lines and bars with dots
   en_dot   // Display dots
};

extern enTimeFrames   TimeFrame       = tf_cu;     // Time frame
extern int            TimeFrameCustom = 0;         // Custom time frame to use (if custom time frame used)
extern int            avgPeriod       = 10;        // Average period
extern enMaTypes      avgMethod       = ma_ema;    // Average method    
extern enPrices       appliedPrice    = pr_median; // Price to use
extern bool           Double          = false;     // Double smoothed average?
extern bool           Adaptive        = false;     // Adaptive average?
extern enCalcType     Type            = st_atr;    // Calculate using :
extern double         Filter          = 0;         // Filter to use for filtering (<=0 - no filtering)
extern int            atrPeriod       = 50;        // Atr/err/dev period
extern double         atrMultiplier   = 2.0;       // Atr/err/dev multplier
extern enDisplay      DisplayType     = en_lin;    // Display type
extern int            LinesWidth      = 3;         // Lines width (when lines are included in display)
extern int            BarsWidth       = 1;         // Bars width (when bars are included in display)
extern bool           alertsOn        = true;      // Turn alerts on
extern bool           alertsOnCurrent = false;     // Alerts on current (still opened) bar
extern bool           alertsMessage   = true;      // Alerts should show pop-up message
extern bool           alertsSound     = false;     // Alerts should play alert sound
extern bool           alertsPushNotif = false;     // Alerts should send push notification
extern bool           alertsEmail     = false;     // Alerts should send email
extern int            ArrowCodeUp     = 159;       // Arrow code up
extern int            ArrowCodeDn     = 159;       // Arrow code down
extern double         ArrowGapUp      = 0.5;       // Gap for arrow up        
extern double         ArrowGapDn      = 0.5;       // Gap for arrow down
extern bool           ArrowOnFirst    = true;      // Arrow on first bars
extern enIterpolation Interpolate     = int_line;  // Interpolating method when using multi time frame mode
mladen
:

So? What stops you? You do not need mq4 file to use an indicator from the EA. In any EA all you need is an ex4 file (in fact any EA does not know to work with mq4 file). Regards

hi Mladen,

thats just perfect. Thanks a lot.   

Regards,

Goran 

 
roccobarocco:

hi Mladen,

thats just perfect. Thanks a lot.   

Regards,

Goran 

Update:

hi Mladen,

just wanted to thanks again for really quick response and help. I have already implemented it in my robot and it works like charm.

 Regards,

Goran 

 
roccobarocco:

Update:

hi Mladen,

just wanted to thanks again for really quick response and help. I have already implemented it in my robot and it works like charm.

 Regards,

Goran 

Good. Happy trading :)
 
mladen:
Good. Happy trading :)

hi Mladen, 

I have one question. Is it possible to have or enable grey lines that are implemented in supertrend (experimental) 1.3 in averages 2.6 indicator?

 Regards,

Goran  

 
roccobarocco:

hi Mladen, 

I have one question. Is it possible to have or enable grey lines that are implemented in supertrend (experimental) 1.3 in averages 2.6 indicator?

 Regards,

Goran  

How do you mean "enable"?
 
mladen:
How do you mean "enable"?

hi, 

I mean if those grey lines are already implemented in average 2.6 version. 

Goran