I have a strategy but no coding knowledge

Avatar
  • updated
  • Can't be answered


indicators needed are
1. Moving Average Period 12, Method (Linear weighted), Apply to (Close)
2. Moving Average Period 40, Method (Linear weighted), Apply to (High)
3. Moving Average Period 40, Method (Linear weighted), Apply to (Low)
4. Commodity channel Index(CCI), Period 50, Apply to (close) Levels: (0)
5. Commodity channel Index(CCI), Period 20, Apply to (close) Levels: (100, -100, 200, -200)
6. Relative Strength Index(RSI), Period 7, Apply to (weighted Close(HLCC/4), Levels: 30, 70
7. Stochastic Oscillator %K (100), %D (100), Slowing (5), Price field (Close/Close), Method (Exponential), Levels: 20, 80

conditions for buy
1. Linear weighted Moving Average 12 closed above Linear weighted Moving average 40 Low and Linear weighted Moving average 40 High
2. RSI value must be above 70.00
3. CCI (Period 50) value must be above 0.00
4. CCI (Period 20) value must be above 100.00
5 The stochastic oscillator main line value greater than signal value
6. Buy at the closure of the candle that meet up with the 1 to 5 conditions above
7. Stop loss below the low of bull candle that meet up with the 1 to 5
8. Exit trade when RSI < 70.00, CCI (20) < 0.00, Bearish Candle formed below Moving Average 12

Condition for Sell
Will be opposite of the buying conditions

Avatar
2
Andrey Khatimlianskyi
  • Can't be answered

It doesn't work that way. Don't expect to be spoon-fed.

Start with the simple set from forum, learn documentation, and try new options. Tester is your friend.


Come back when you have specific questions about one of the parameters.

Good luck!

Avatar
0
ajayi oluwaseun
Quote from ajayi oluwaseun

ANOTHER NEW STRATEGY 

i need mql5 robot coded with the details below

indicators used are
1. Moving Average Period 20, Method (exponetial), Apply to (Close)
2. Moving Average Period 40, Method (exponetial), Apply to (Close)
3. Moving Average Period 35, Method (exponetial), Apply to (Close)
4. Moving Average Period 200, Method (exponetial), Apply to (Close)
5. Beginner indicator 30, 50
6. CCI Dot indicator 60 Close 90
7. Commodity channel Index(CCI), Period 14, Apply to (close) Levels: (100, -100, 200, -200)
8. Relative Strength Index(RSI), Period 20, Apply to (weighted Close(HLCC/4), Levels: 30, 70
9. Relative Strength Index(RSI), Period 50, Apply to (weighted Close(HLCC/4), Levels: 30, 70
10. Stochastic Oscillator %K (150), %D (1), Slowing (3), Price field (Close/Close), Method (Exponential), Levels: 20, 80

Conditions for buy
1.the confirmation candle should be above MA 20, MA 40 and MA 35 but may be less than or greater than MA 200
2. Beginners and CCI dot signals buy either on same candle or next candle
3. RSI value must be above 50.00
4. CCI (Period 14) value must be above 100.00
5. The stochastic oscillator main line value and signal value must be greater than 20
6. Buy at the closure of the candle that meet up with the 1 to 5 conditions above
7. Stop loss below the low of the two previous bullish candle before the confirmation candle
8. Exit trade when RSI(20) < 50.00, stochastic < 80.00, Bearish Candle formed closed below Moving Average 20, 40 and 35

Condition for Sell
1.the confirmation candle should be below MA 20, MA 40 and MA 35 but may be less than or greater than MA 200
2. Beginners and CCI dot signals sell either on same candle or next candle
3. RSI value must be below 50.00
4. CCI (Period 14) value must be below -100.00
5. The stochastic oscillator main line value and signal value must be less than 80
6. sell at the closure of the candle that meet up with the 1 to 5 conditions above
7. Stop loss above the low of the two previous bearish candle before the confirmation candle
8. Exit trade when RSI(20) > 50.00, stochastic > 20.00, bullish Candle formed closed above Moving Average 20, 40 and 35

I still await for someone who can help to create either a robot or an indicator

Avatar
0
ajayi oluwaseun
Quote from jay hu

ok, I will try and share it with the community.

thanks bro..... i will be expecting 

Avatar
0
jay hu
Quote from ajayi oluwaseun

ANOTHER NEW STRATEGY 

i need mql5 robot coded with the details below

indicators used are
1. Moving Average Period 20, Method (exponetial), Apply to (Close)
2. Moving Average Period 40, Method (exponetial), Apply to (Close)
3. Moving Average Period 35, Method (exponetial), Apply to (Close)
4. Moving Average Period 200, Method (exponetial), Apply to (Close)
5. Beginner indicator 30, 50
6. CCI Dot indicator 60 Close 90
7. Commodity channel Index(CCI), Period 14, Apply to (close) Levels: (100, -100, 200, -200)
8. Relative Strength Index(RSI), Period 20, Apply to (weighted Close(HLCC/4), Levels: 30, 70
9. Relative Strength Index(RSI), Period 50, Apply to (weighted Close(HLCC/4), Levels: 30, 70
10. Stochastic Oscillator %K (150), %D (1), Slowing (3), Price field (Close/Close), Method (Exponential), Levels: 20, 80

Conditions for buy
1.the confirmation candle should be above MA 20, MA 40 and MA 35 but may be less than or greater than MA 200
2. Beginners and CCI dot signals buy either on same candle or next candle
3. RSI value must be above 50.00
4. CCI (Period 14) value must be above 100.00
5. The stochastic oscillator main line value and signal value must be greater than 20
6. Buy at the closure of the candle that meet up with the 1 to 5 conditions above
7. Stop loss below the low of the two previous bullish candle before the confirmation candle
8. Exit trade when RSI(20) < 50.00, stochastic < 80.00, Bearish Candle formed closed below Moving Average 20, 40 and 35

Condition for Sell
1.the confirmation candle should be below MA 20, MA 40 and MA 35 but may be less than or greater than MA 200
2. Beginners and CCI dot signals sell either on same candle or next candle
3. RSI value must be below 50.00
4. CCI (Period 14) value must be below -100.00
5. The stochastic oscillator main line value and signal value must be less than 80
6. sell at the closure of the candle that meet up with the 1 to 5 conditions above
7. Stop loss above the low of the two previous bearish candle before the confirmation candle
8. Exit trade when RSI(20) > 50.00, stochastic > 20.00, bullish Candle formed closed above Moving Average 20, 40 and 35

ok, I will try and share it with the community.

Avatar
0
ajayi oluwaseun

ANOTHER NEW STRATEGY 

i need mql5 robot coded with the details below

indicators used are
1. Moving Average Period 20, Method (exponetial), Apply to (Close)
2. Moving Average Period 40, Method (exponetial), Apply to (Close)
3. Moving Average Period 35, Method (exponetial), Apply to (Close)
4. Moving Average Period 200, Method (exponetial), Apply to (Close)
5. Beginner indicator 30, 50
6. CCI Dot indicator 60 Close 90
7. Commodity channel Index(CCI), Period 14, Apply to (close) Levels: (100, -100, 200, -200)
8. Relative Strength Index(RSI), Period 20, Apply to (weighted Close(HLCC/4), Levels: 30, 70
9. Relative Strength Index(RSI), Period 50, Apply to (weighted Close(HLCC/4), Levels: 30, 70
10. Stochastic Oscillator %K (150), %D (1), Slowing (3), Price field (Close/Close), Method (Exponential), Levels: 20, 80

Conditions for buy
1.the confirmation candle should be above MA 20, MA 40 and MA 35 but may be less than or greater than MA 200
2. Beginners and CCI dot signals buy either on same candle or next candle
3. RSI value must be above 50.00
4. CCI (Period 14) value must be above 100.00
5. The stochastic oscillator main line value and signal value must be greater than 20
6. Buy at the closure of the candle that meet up with the 1 to 5 conditions above
7. Stop loss below the low of the two previous bullish candle before the confirmation candle
8. Exit trade when RSI(20) < 50.00, stochastic < 80.00, Bearish Candle formed closed below Moving Average 20, 40 and 35

Condition for Sell
1.the confirmation candle should be below MA 20, MA 40 and MA 35 but may be less than or greater than MA 200
2. Beginners and CCI dot signals sell either on same candle or next candle
3. RSI value must be below 50.00
4. CCI (Period 14) value must be below -100.00
5. The stochastic oscillator main line value and signal value must be less than 80
6. sell at the closure of the candle that meet up with the 1 to 5 conditions above
7. Stop loss above the low of the two previous bearish candle before the confirmation candle
8. Exit trade when RSI(20) > 50.00, stochastic > 20.00, bullish Candle formed closed above Moving Average 20, 40 and 35

Avatar
0
ajayi oluwaseun

i have taken time to test the indicator but still not working..... Jay Hu, you have really tried... hoping to see some one else to help out

Avatar
0
jay hu
Quote from jay hu

Understood. I am still working on the set which can handle any market conditions as well.

MA_CCI_RSI strategy indicator.mq5

MA_CCI_RSI strategy indicator.ex5
Avatar
0
jay hu
Quote from ajayi oluwaseun

Brother, you have tried for me, hope to see someone who can help fix the errors.... I tried the SET file, it still need more fix as sometime it does not close trade and most closed trade are at negative (loss)

Understood. I am still working on the set which can handle any market conditions as well.

Avatar
0
ajayi oluwaseun
Quote from jay hu

//+------------------------------------------------------------------+

//| Moving average, CCI, RSI indicator |

//+------------------------------------------------------------------+

#property indicator_chart_window


double ma12[];

double ma40_high[];

double ma40_low[];

double cci50[];

double cci20[];

double rsi[];

double stochastic_main[];

double stochastic_signal[];

double UpArrowBuffer[];

double DownArrowBuffer[];

int OnInit()

{

SetIndexBuffer(0, UpArrowBuffer, INDICATOR_DATA);

PlotIndexSetInteger(0, PLOT_ARROW, 241); // Code 241 is the symbol for an up arrow

SetIndexLabel(0, "Buy signal");

SetIndexBuffer(1, DownArrowBuffer, INDICATOR_DATA);

PlotIndexSetInteger(1, PLOT_ARROW, 242); // Code 242 is the symbol for a down arrow

SetIndexLabel(1, "Sell signal");

return (INIT_SUCCEEDED);

}

int OnCalculate(const int rates_total,

const int prev_calculated,

const datetime &time[],

const double &open[],

const double &high[],

const double &low[],

const double &close[],

const long &tick_volume[],

const long &volume[],

const int &spread[])

{

ArraySetAsSeries(ma12, true);

ArraySetAsSeries(ma40_high, true);

ArraySetAsSeries(ma40_low, true);

ArraySetAsSeries(cci50, true);

ArraySetAsSeries(cci20, true);

ArraySetAsSeries(rsi, true);

ArraySetAsSeries(stochastic_main, true);

ArraySetAsSeries(stochastic_signal, true);

ArraySetAsSeries(UpArrowBuffer, true);

ArraySetAsSeries(DownArrowBuffer, true);

int ma12_period = 12;

int ma40_period = 40;

int cci50_period = 50;

int cci20_period = 20;

int rsi_period = 7;

int stochastic_period = 100;

// Rest of the code remains unchanged...

CopyClose(Symbol(), 0, 0, rates_total, ma12);

CopyHigh(Symbol(), 0, 0, rates_total, ma40_high);

CopyLow(Symbol(), 0, 0, rates_total, ma40_low);

CopyClose(Symbol(), 0, 0, rates_total, cci50);

CopyClose(Symbol(), 0, 0, rates_total, cci20);

CopyClose(Symbol(), 0, 0, rates_total, rsi);

for (int i = 0; i < rates_total; i++)

{

ma12[i] = iMA(NULL, 0, ma12_period, 0, MODE_LWMA, PRICE_CLOSE, i);

ma40_high[i] = iMA(NULL, 0, ma40_period, 0, MODE_LWMA, PRICE_HIGH, i);

ma40_low[i] = iMA(NULL, 0, ma40_period, 0, MODE_LWMA, PRICE_LOW, i);

cci50[i] = iCCI(NULL, 0, cci50_period, PRICE_CLOSE, i);

cci20[i] = iCCI(NULL, 0, cci20_period, PRICE_CLOSE, i);

rsi[i] = iRSI(NULL, 0, rsi_period, PRICE_CLOSE, i);

stochastic_main[i] = iStochastic(NULL, 0, stochastic_period, 5, MODE_SMA, 1, MODE_MAIN, i);

stochastic_signal[i] = iStochastic(NULL, 0, stochastic_period, 5, MODE_SMA, 1, MODE_SIGNAL, i);

// Buy conditions

if (ma12[i] > ma40_low[i] && ma12[i] > ma40_high[i] && rsi[i] > 70 && cci50[i] > 0 && cci20[i] > 100 && stochastic_main[i] > stochastic_signal[i])

{

Comment("Buy signal at ", TimeToString(time[i]));

UpArrowBuffer[i] = low[i] - 10 * Point; // Place the arrow 10 points below the low price

}

else

{

UpArrowBuffer[i] = EMPTY_VALUE;

}

// Sell conditions

if (ma12[i] < ma40_low[i] && ma12[i] < ma40_high[i] && rsi[i] < 30 && cci50[i] < 0 && cci20[i] < -100 && stochastic_main[i] < stochastic_signal[i])

{

Comment("Sell signal at ", TimeToString(time[i]));

DownArrowBuffer[i] = high[i] + 10 * Point; // Place the arrow 10 points above the high price

}

else

{

DownArrowBuffer[i] = EMPTY_VALUE;

}

}

return (rates_total);

}

//+------------------------------------------------------------------+

Try to edit this mql.5 in here but failed. still has 20 errors, anyone who had experience may improve this indicator code.

Brother, you have tried for me, hope to see someone who can help fix the errors.... I tried the SET file, it still need more fix as sometime it does not close trade and most closed trade are at negative (loss)

Avatar
1
jay hu
Quote from jay hu

#property indicator_chart_window

#property indicator_plots 0

#property indicator_buffers 2

#property indicator_color1 Green

#property indicator_color2 Red

// Define indicator handles

int ma12_handle, ma40_high_handle, ma40_low_handle, cci50_handle, cci20_handle, rsi_handle, stochastic_handle;

double ma12[], ma40_high[], ma40_low[], cci50[], cci20[], rsi[], stochastic_main[], stochastic_signal[];

double UpArrowBuffer[];

double DownArrowBuffer[];

// Define entry point function

int OnInit() {

// Initialize indicator handles

ma12_handle = iMA(NULL, 0, 12, 0, MODE_LWMA, PRICE_CLOSE);

ma40_high_handle = iMA(NULL, 0, 40, 0, MODE_LWMA, PRICE_HIGH);

ma40_low_handle = iMA(NULL, 0, 40, 0, MODE_LWMA, PRICE_LOW);

cci50_handle = iCCI(NULL, 0, 50, PRICE_CLOSE);

cci20_handle = iCCI(NULL, 0, 20, PRICE_CLOSE);

rsi_handle = iRSI(NULL, 0, 7, PRICE_WEIGHTED);

stochastic_handle = iStochastic(NULL, 0, 100, 100, 5, MODE_SMA, 1);

IndicatorBuffers(2);

SetIndexStyle(0, DRAW_ARROW);

SetIndexArrow(0, 241); // Code 241 is the symbol for an up arrow

SetIndexBuffer(0, UpArrowBuffer);

SetIndexLabel(0, "Buy signal");

SetIndexStyle(1, DRAW_ARROW);

SetIndexArrow(1, 242); // Code 242 is the symbol for a down arrow

SetIndexBuffer(1, DownArrowBuffer);

SetIndexLabel(1, "Sell signal");

return(INIT_SUCCEEDED);

}

// Define the main indicator calculation

int OnCalculate(const int rates_total,

const int prev_calculated,

const datetime &time[],

const double &open[],

const double &high[],

const double &low[],

const double &close[],

const long &tick_volume[],

const long &volume[],

const int &spread[])

{

// Update indicator data

if(CopyBuffer(ma12_handle, 0, 0, rates_total, ma12) == -1 ||

CopyBuffer(ma40_high_handle, 0, 0, rates_total, ma40_high) == -1 ||

CopyBuffer(ma40_low_handle, 0, 0, rates_total, ma40_low) == -1 ||

CopyBuffer(cci50_handle, 0, 0, rates_total, cci50) == -1 ||

CopyBuffer(cci20_handle, 0, 0, rates_total, cci20) == -1 ||

CopyBuffer(rsi_handle, 0, 0, rates_total, rsi) == -1 ||

CopyBuffer(stochastic_handle, 0, 0, rates_total, stochastic_main) == -1 ||

CopyBuffer(stochastic_handle, 1, 0, rates_total, stochastic_signal) == -1)

{

Print("Failed to copy data. Error code = ", GetLastError());

return(-1);

}

// Check conditions for buy or sell

for(int i = 1; i < rates_total; i++)

{

// Buy conditions

if(ma12[i] > ma40_low[i] && ma12[i] > ma40_high[i] && rsi[i] > 70 && cci50[i] > 0 && cci20[i] > 100 && stochastic_main[i] > stochastic_signal[i])

{

Comment("Buy signal at ", time[i]);

UpArrowBuffer[i] = low[i] - 10 * Point; // Place the arrow 10 points below the low price

}

else

{

UpArrowBuffer[i] = EMPTY_VALUE;

}

// Sell conditions

if(ma12[i] < ma40_low[i] && ma12[i] < ma40_high[i] && rsi[i] < 30 && cci50[i] < 0 && cci20[i] < -100 && stochastic_main[i] < stochastic_signal[i])

{

Comment("Sell signal at ", time[i]);

DownArrowBuffer[i] = high[i] + 10 * Point; // Place the arrow 10 points above the high price

}

else

{

DownArrowBuffer[i] = EMPTY_VALUE;

}

}

return(rates_total);

}

Here is the rough code for the indicator based on your strategy, Ulises mentioned that it is better to create an indicator. The code still needs some work to fix errors to compile successfully. See if someone has time to help.

//+------------------------------------------------------------------+

//| Moving average, CCI, RSI indicator |

//+------------------------------------------------------------------+

#property indicator_chart_window


double ma12[];

double ma40_high[];

double ma40_low[];

double cci50[];

double cci20[];

double rsi[];

double stochastic_main[];

double stochastic_signal[];

double UpArrowBuffer[];

double DownArrowBuffer[];

int OnInit()

{

SetIndexBuffer(0, UpArrowBuffer, INDICATOR_DATA);

PlotIndexSetInteger(0, PLOT_ARROW, 241); // Code 241 is the symbol for an up arrow

SetIndexLabel(0, "Buy signal");

SetIndexBuffer(1, DownArrowBuffer, INDICATOR_DATA);

PlotIndexSetInteger(1, PLOT_ARROW, 242); // Code 242 is the symbol for a down arrow

SetIndexLabel(1, "Sell signal");

return (INIT_SUCCEEDED);

}

int OnCalculate(const int rates_total,

const int prev_calculated,

const datetime &time[],

const double &open[],

const double &high[],

const double &low[],

const double &close[],

const long &tick_volume[],

const long &volume[],

const int &spread[])

{

ArraySetAsSeries(ma12, true);

ArraySetAsSeries(ma40_high, true);

ArraySetAsSeries(ma40_low, true);

ArraySetAsSeries(cci50, true);

ArraySetAsSeries(cci20, true);

ArraySetAsSeries(rsi, true);

ArraySetAsSeries(stochastic_main, true);

ArraySetAsSeries(stochastic_signal, true);

ArraySetAsSeries(UpArrowBuffer, true);

ArraySetAsSeries(DownArrowBuffer, true);

int ma12_period = 12;

int ma40_period = 40;

int cci50_period = 50;

int cci20_period = 20;

int rsi_period = 7;

int stochastic_period = 100;

// Rest of the code remains unchanged...

CopyClose(Symbol(), 0, 0, rates_total, ma12);

CopyHigh(Symbol(), 0, 0, rates_total, ma40_high);

CopyLow(Symbol(), 0, 0, rates_total, ma40_low);

CopyClose(Symbol(), 0, 0, rates_total, cci50);

CopyClose(Symbol(), 0, 0, rates_total, cci20);

CopyClose(Symbol(), 0, 0, rates_total, rsi);

for (int i = 0; i < rates_total; i++)

{

ma12[i] = iMA(NULL, 0, ma12_period, 0, MODE_LWMA, PRICE_CLOSE, i);

ma40_high[i] = iMA(NULL, 0, ma40_period, 0, MODE_LWMA, PRICE_HIGH, i);

ma40_low[i] = iMA(NULL, 0, ma40_period, 0, MODE_LWMA, PRICE_LOW, i);

cci50[i] = iCCI(NULL, 0, cci50_period, PRICE_CLOSE, i);

cci20[i] = iCCI(NULL, 0, cci20_period, PRICE_CLOSE, i);

rsi[i] = iRSI(NULL, 0, rsi_period, PRICE_CLOSE, i);

stochastic_main[i] = iStochastic(NULL, 0, stochastic_period, 5, MODE_SMA, 1, MODE_MAIN, i);

stochastic_signal[i] = iStochastic(NULL, 0, stochastic_period, 5, MODE_SMA, 1, MODE_SIGNAL, i);

// Buy conditions

if (ma12[i] > ma40_low[i] && ma12[i] > ma40_high[i] && rsi[i] > 70 && cci50[i] > 0 && cci20[i] > 100 && stochastic_main[i] > stochastic_signal[i])

{

Comment("Buy signal at ", TimeToString(time[i]));

UpArrowBuffer[i] = low[i] - 10 * Point; // Place the arrow 10 points below the low price

}

else

{

UpArrowBuffer[i] = EMPTY_VALUE;

}

// Sell conditions

if (ma12[i] < ma40_low[i] && ma12[i] < ma40_high[i] && rsi[i] < 30 && cci50[i] < 0 && cci20[i] < -100 && stochastic_main[i] < stochastic_signal[i])

{

Comment("Sell signal at ", TimeToString(time[i]));

DownArrowBuffer[i] = high[i] + 10 * Point; // Place the arrow 10 points above the high price

}

else

{

DownArrowBuffer[i] = EMPTY_VALUE;

}

}

return (rates_total);

}

//+------------------------------------------------------------------+

Try to edit this mql.5 in here but failed. still has 20 errors, anyone who had experience may improve this indicator code.