Reply

Custom Indicator Help

3 replies

mkjones320

Customer, bbp_participant, community, sq-ultimate, 20 replies.

Visit profile

5 years ago #235765

Hi,

I have the Divergence Indicator from Point Zero Trading.  It has some iCustom functionality.  Wondering how best to implement this code into an ea?

//—- Define constants
#define OP_REGULAR_BUY 0
#define OP_REGULAR_SELL 1
#define OP_HIDDEN_BUY 2
#define OP_HIDDEN_SELL 3
//—- Declare indicator type
enum Indi_Type
{
RSI = 0, // RSI
CCI = 1, // CCI
MACD = 2, // MACD
OSMA = 3, // OSMA (MACD Histogram)
STOCH = 4, // Stochastic
AWESOME = 5, // Awesome Oscillator
ACCELERATOR = 6, // Accelerator Oscillator
MOMENTUM = 7, // Momentum
WILLIAMS = 8, // Williams Percent Range
RVI = 9, // Relative Vigor Index
MFI = 10, // Money Flow Index
OBV = 11, // On Balance Volume
};
//—- Declare divergence type
enum Div_Type
{
Regular_And_Hidden = 0,
Regular = 1,
Hidden = 2,
};
//+———————————————–+
//| Custom indicator iteration function
//+———————————————–+
int start()
{
// Assign indicator to use
Indi_Type type = AWESOME;
// Assign divergence type
Div_Type div = Regular_And_Hidden;
// Declare breakout period
int breakout_period = 2;
// Read divergence
double divergence = iCustom(Symbol(), Period(),
“PZ_DivergenceTrading_LICENSE”,
“–“, type, div, breakout_period, 5, 1);
// Read breakout
double breakout = iCustom(Symbol(), Period(),
“PZ_DivergenceTrading_LICENSE”,
“–“, type, div, breakout_period, 4, 1);
// Actions on divergences (these can expand and repaint)
if(divergence == OP_REGULAR_BUY) { /* Your code for regular bullish divergence */ }
if(divergence == OP_REGULAR_SELL) { /* Your code for regular bearish divergence */ }
if(divergence == OP_HIDDEN_BUY) { /* Your code for hidden bullish divergence */ }
if(divergence == OP_HIDDEN_BUY) { /* Your code for hidden bearish divergence */ }
// Actions on breakouts (these almost never repaint)
if(breakout == OP_BUY) { /* Your code for bullish breakout (blue arrow) */}
if(breakout == OP_SELL) { /* Your code for bearish breakout (red arrow) */}
// Exit
return(0);
}

Thanks,

mkjones320

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

5 years ago #235770

Can you share the ex4 or mq4 for the Wizard setup?

0

mkjones320

Customer, bbp_participant, community, sq-ultimate, 20 replies.

Visit profile

5 years ago #235779

Here you go.  I started to define some parameters for it.  Not sure if I was headed the right way or not.

Attachments:
You must be logged in to view attached files.

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

5 years ago #235834

This custom indicator seems to be incompatible. It gives unknown return type error on the import. Do you have any other version?

0

Viewing 3 replies - 1 through 3 (of 3 total)