Custom indicator code to open my .ex4 customer indicator

To add comments, please log in or register
adub206
42
adub206  

Hello,

I've tried for many hours to figure out what's going on with my code on this. From my understanding, I can code into a customer indicator in *.mq4 format to open my *.ex4 customer indicator. If this is incorrect, please correct me. 

So now, here is the code I have been implementing using MetaEditor4:

double  iCustom(
   string       NULL,           // symbol
   int          0,        // timeframe
   string       BuySell,             // path/name of the custom indicator compiled program
   ...                            // custom indicator input parameters (if necessary)
   int          0,             // line index
   int          1             // shift
   );

I am completely uncertain of the customer parameters its asking for, the "line index", and the "shift" inputs. Hovering over my signals, I'm seeing my BUY signal has a value1 and my SELL signal has a value2. 

I would greatly greatly appreciate it if someone would please help me with this! If someone should help me and get it working, they could freely have what I am in the project of making. I'm looking at an easy 80-90% win rate on my trades when backtesting this strategy I'm trying to turn into an EA.


Thank you in advance!!

Keith Watford
Moderator
24756
Keith Watford  

Re line index, value 1 is probably index 0 and value 2, 1.

shift 1 is the last closed bar

if the indicator's name is "BuySell" it should be a string, ie with the quotation marks

adub206
42
adub206  
Keith Watford:

Re line index, value 1 is probably index 0 and value 2, 1.

shift 1 is the last closed bar

if the indicator's name is "BuySell" it should be a string, ie with the quotation marks

Thank you! 
And as far as placement of the files, all it should be is have the "BuySell.ex4" file in the same folder as where the customer indicator is?
Keith Watford
Moderator
24756
Keith Watford  
adub206:
Thank you! 
And as far as placement of the files, all it should be is have the "BuySell.ex4" file in the same folder as where the customer indicator is?

Yes, in the indicator file. in the iCustom call  "BuySell", no need for the .exe

adub206
42
adub206  
Keith Watford:

Yes, in the indicator file. in the iCustom call  "BuySell", no need for the .exe

Thank you! I have made corrections. I'm trying to get the indicator to work on my MT4 chart and it isn't doing anything when I drag it onto the chart. I have both files in the same folder and here is the correction to the coding:

double  iCustom(
   string       NULL,           // symbol
   int          0,        // timeframe
   string       "BuySell",             // path/name of the custom indicator compiled program
   ...                            // custom indicator input parameters (if necessary)
   int          0,1             // line index
   int          1             // shift
   );


Thank you, again! 

Keith Watford
Moderator
24756
Keith Watford  
   int          0,1             // line index

you can only set 1 value as you can only get the value of 1 line at a time.

Always check in the Experts/Journal logs for any reported errors if it doesn't appear to be working.

How are you outputting the value?

adub206
42
adub206  
Keith Watford:

you can only set 1 value as you can only get the value of 1 line at a time.

Always check in the Experts/Journal logs for any reported errors if it doesn't appear to be working.

How are you outputting the value?

I am currently at a total loss!!
Here are my inputs for the indicator: 
Inputs

Here is my code thus far: 

double  iCustom(
   string       NULL,           // symbol
   int          PERIOD_CURRENT=0,        // timeframe
   string       "BuySell",             // path/name of the custom indicator compiled program
   ...                            // custom indicator input parameters (if necessary)
   int          0,1,             // line index
   int          2             // shift
   );
Keith Watford
Moderator
24756
Keith Watford  

Look at my previous post, you cannot have 2 line indexes in one call.

Unless you are using the default inputs for the indicator, you will need to enter them in order and separated by commas.

Keith Watford:

you can only set 1 value as you can only get the value of 1 line at a time.

Always check in the Experts/Journal logs for any reported errors if it doesn't appear to be working.

How are you outputting the value?

adub206
42
adub206  
Keith Watford:

Look at my previous post, you cannot have 2 line indexes in one call.

Unless you are using the default inputs for the indicator, you will need to enter them in order and separated by commas.

I understand now. I need two separate lines for each of the signals... one value for the buy and one for the sell signal? Like this: 

double  iCustom( NULL,0,"BuySell",...,0,0);
double  iCustom( NULL,0,"BuySell",...,1,0);

Does that look correct? I've tried this one and it doesn't do anything either. There are no errors in the journal. It just does nothing at all when putting it to a chart.

Keith Watford
Moderator
24756
Keith Watford  
adub206:

I understand now. I need two separate lines for each of the signals... one value for the buy and one for the sell signal? Like this: 

Does that look correct? I've tried this one and it doesn't do anything either. There are no errors in the journal. It just does nothing at all when putting it to a chart.

I have asked 2 times already and now the third

How are you outputting the value?

adub206
42
adub206  
Keith Watford:

I have asked 2 times already and now the third

How are you outputting the value?

I'm sorry. I have no idea what you mean by outputting it? 

12
To add comments, please log in or register