Your attempt......
//+------------------------------------------------------------------+ //| find the Arrow.mq4 | //| Copyright © 2011, Ron Kirby | //| http://www.blsmur.com | //+------------------------------------------------------------------+ #property copyright "Copyright © 2011, Ron Kirby" #property link "http://www.blsmur.com" //+------------------------------------------------------------------+ //| expert initialization function | //+------------------------------------------------------------------+ int init() { //----double iCustom( string symbol, int timeframe, string name, ..., int mode, int shift) //---- return(0); } //+------------------------------------------------------------------+ //| expert deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| expert start function | //+------------------------------------------------------------------+ int start() { //---- //int fnGetArrowSignal(string strName, int type); //{ // get time and color of arrow double dTime = ObjectGet( "EMA Crossover", OBJPROP_TIME1); double dArrowColorP = ObjectGet( "EMA Crossover", OBJPROP_COLOR); Print ("dArrowColorP ", dArrowColorP," dTime ",dTime); double EmaArrow=iCustom(NULL,0,"EMA Crossover",4,5,1); Print ("EmaArrow ",EmaArrow); // int NewArrow= OBJPROP_ARROWCODE [241]; int win_Arrow=WindowFind( "EMA Crossover"); Print ("win_Arrow ",win_Arrow ); //---- return(0); } //+------------------------------------------------------------------+
You can use iCustom to get info from a compiled indicator
Parameters:
Sample: double val=iCustom(NULL, 0, "SampleInd",13,1,0); |
You tried
double EmaArrow=iCustom(NULL,0,"EMA Crossover",4,5,1);
This is wrong.....
1 indicator name is not "EMA Crossover"
============ it is "EMAyCrossover"
2 The indicator has 2 inputparameters both type integer
FasterEMA value 4
SlowerEMA value 5
after the input of the parameters we have to choose the buffer we want the value from and then the barnumber for that value
then you forgot or which buffer (maximal 8 buffers) or what bar you want to have the value
So with this info ......
what is the right code using iCustom( ) to get from this indicator the value of buffer 0 bar1
what is the right code using iCustom( ) to get from this indicator the value of buffer 1 bar1
what is the right code using iCustom( ) to get from this indicator the value of buffer 2 bar1
this you can do till buffer 7 (0,1,2,3,4,5,6,7 are totally 8 buffers)
and what you do to find the value at bar1 you can do so for other bars
I think you have to start first with that good luck
Your attempt......
You can use iCustom to get info from a compiled indicator
Parameters:
Sample: |
You tried
This is wrong.....
1 indicator name is not "EMA Crossover"
============ it is "EMAyCrossover"
2 The indicator has 2 inputparameters both type integer
FasterEMA value 4
SlowerEMA value 5
after the input of the parameters we have to choose the buffer we want the value from and then the barnumber for that value
then you forgot or which buffer (maximal 8 buffers) or what bar you want to have the value
So with this info ......
what is the right code using iCustom( ) to get from this indicator the value of buffer 0 bar1
what is the right code using iCustom( ) to get from this indicator the value of buffer 1 bar1
what is the right code using iCustom( ) to get from this indicator the value of buffer 2 bar1
this you can do till buffer 7 (0,1,2,3,4,5,6,7 are totally 8 buffers)
and what you do to find the value at bar1 you can do so for other bars
I think you have to start first with that good luck
thankyou for you input I will have a play with it, i must say the ""y"" is new and not in the original file of EMA Crossover but i will certainly try it too
while the file uploaded as "EMAyCrossover " that name will not load when i run the EA in the tester, removing the y and it runs the indicator ok, I can only assume the y was added during the upload but it was not added by me
thankyou for you input I will have a play with it, i must say the ""y"" is new and not in the original file of EMA Crossover but i will certainly try it too
Use the Exact name of the indicator how it is on your MT4 platform if it is without ""y"" then you have another indicator here I think
alright I have some info coming now I had added buffers to the icustom
and added colors to the properties
now when the indicator places an arrow it gives me a price from the journal
so a little gain today
here is my code so far
//+------------------------------------------------------------------+ //| find the Arrow.mq4 | //| Copyright © 2011, Ron Kirby | //| http://www.blsmur.com | //+------------------------------------------------------------------+ #property copyright "Copyright © 2011, Ron Kirby" #property link "http://www.blsmur.com" #property indicator_color1 Red #property indicator_color2 Blue #property indicator_buffers 2 //+------------------------------------------------------------------+ //| expert initialization function | //+------------------------------------------------------------------+ int init() { //----double iCustom( string symbol, int timeframe, string name, ..., int mode, int shift) //---- return(0); } //+------------------------------------------------------------------+ //| expert deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| expert start function | //+------------------------------------------------------------------+ int start() { //---- //int fnGetArrowSignal(string strName, int type); //{ // get time and color of arrow double dTime = ObjectGet( "EMA Crossover", OBJPROP_TIME1); double dArrowColorP = ObjectGet( "EMA Crossover", OBJPROP_COLOR); Print ("dArrowColorP ", dArrowColorP," dTime ",dTime); double EmaArrow=iCustom(NULL,0,"EMA Crossover",4,5,0,1,1); Print ("EmaArrow ",EmaArrow); // int NewArrow= OBJPROP_ARROWCODE [241]; int win_Arrow=WindowFind( "EMA Crossover"); Print ("win_Arrow ",win_Arrow ); //---- return(0); } //+------------------------------------------------------------------+
2012.04.17 18:56:30 2012.03.01 13:00 find the Arrow EURUSD,H1: EmaArrow 1.3358 signal
2012.04.17 18:56:29 2012.03.01 12:59 find the Arrow EURUSD,H1: EmaArrow 2147483647 no signal
the ema crossover file again
it would seem the space in the name is being filled randomly by the forum server
alright I have some info coming now I had added buffers to the icustom
and added colors to the properties
now when the indicator places an arrow it gives me a price from the journal
so a little gain today
here is my code so far
2012.04.17 18:56:30 2012.03.01 13:00 find the Arrow EURUSD,H1: EmaArrow 1.3358 signal
2012.04.17 18:56:29 2012.03.01 12:59 find the Arrow EURUSD,H1: EmaArrow 2147483647 no signal
double EmaArrow=iCustom(NULL,0,"EMA Crossover",4,5,0,1,1);Now there is one input too many
NULL Symbol()
0 Timeframe attached
"EMA Crossover" name of indicator
4 input FasterEMA
5 input SlowerEMA
0 ???????
1 ??????? input for last input is for the buffer we want the value from
1 ???????? last input is for bar
Is there another parameter for the settings in your indicator "EMA Crossover" that is not in "EMAyCrossover" ????
I see ..... the name change by downloading to the forum.
but still the function is not written right....
ok well i now have enough to make my EA work but still not able to actually read the red arrow or the blue arrow which is what i wanted to do
i have put in my ideas for using the existing signal at the bottom of this EA
//+------------------------------------------------------------------+ //| find the Arrow.mq4 | //| Copyright © 2011, Ron Kirby | //| http://www.blsmur.com | //+------------------------------------------------------------------+ #property copyright "Copyright © 2011, Ron Kirby" #property link "http://www.blsmur.com" #property indicator_color1 Red #property indicator_color2 Blue #property indicator_buffers 2 //+------------------------------------------------------------------+ //| expert initialization function | //+------------------------------------------------------------------+ int init() { //----double iCustom( string symbol, int timeframe, string name, ..., int mode, int shift) //---- return(0); } //+------------------------------------------------------------------+ //| expert deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| expert start function | //+------------------------------------------------------------------+ int start() { //---- double EmaArrow = 0; //int fnGetArrowSignal(string strName, int type); //{ // get time and color of arrow // double dTime = ObjectGet( "EMA Crossover", OBJPROP_TIME1); // double dArrowColorP = ObjectGet( "EMA Crossover", OBJPROP_COLOR); // Print ("dArrowColorP ", dArrowColorP," dTime ",dTime); EmaArrow=iCustom(NULL,0,"EMA Crossover",4,5,1,1); Print ("EmaArrow ",EmaArrow); // int NewArrow= OBJPROP_ARROWCODE [241]; //int win_Arrow=WindowFind( "EMA Crossover"); // Print ("win_Arrow ",win_Arrow ); //---- return(0); } //+------------------------------------------------------------------+ // I am thinking I now have enough info coming it to make this EA work // if i compare price to the signal and the signal is > price it is a sell signal // and if the signal < price it is a buy signal // i still havnt figured out how to read the red and blue arrows but at least i have something to put in my EA // I will have to also eliminate the very large number when there is no signal I tried setting the emaArrow to 0 but it had no effect
ok well i now have enough to make my EA work but still not able to actually read the red arrow or the blue arrow which is what i wanted to do
i have put in my ideas for using the existing signal at the bottom of this EA
EmaArrow=iCustom(NULL,0,"EMA Crossover",4,5,1,1);
You have two Arrows and both appear with a signal from a different buffer
so BlueArrow= iCustom(NULL,0,"EMA Crossover",4,5, .........,1);
RedArrow= iCustom(NULL,0,"EMA Crossover",4,5, .........,1);
Also you have to look for every indicator to the chart if the arrows are appearing for the firsttime at bar 0, or 1 or 2 ....... and if they not disappear repaint
If they not repaint you can use them for making an EA
Don't put in the EA
#property indicator_color1 Red #property indicator_color2 Blue #property indicator_buffers 2That's for indicators......
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
hi guys i am having another go at this
I know we can get info from the screen or chart directly into an EA because I have done it with trendlines
now I want to do it with the arrows produced by the indicator "EMA Crossover"
so i have started completely new code and i have it post along with the indicator
any help would be most appreciated
Thanks Ron