kapri65 Posted August 2, 2010 Report Posted August 2, 2010 Hi, Working on a new EA, I need help to get iCustom variable from an indicator, you can get the indi here http://www.forexsharing.com/482376 The indi shows an arrow when find a rsi divergence, need to get the iCustom value for this. Please Help me!. Thanks. Quote
iwjw Posted August 2, 2010 Report Posted August 2, 2010 The arrows are in buffer #2(green) and buffer #3(red) If there is no arrow on a given bar, the return value for this buffer should be EMPTY_VALUE Make sure that you are passing all of the 7 external parameter in right order Params used as comment (like separator1) can be passed as "" To get a green arrow: double val=iCustum(NULL,0,"Regular RSI Div","",7,"", 0.0001,-0.0001,0,true,2,shift) where shift=bar you are looking at...could be 0,1, or any bar prior If(val==EMPTY_VALUE) -> there is no arrow on that bar Same for the red arrow where you have to use buffer #3 (the param prior to shift) Didn't test it, but could work kapri65 and t2g 2 Quote
kapri65 Posted August 2, 2010 Author Report Posted August 2, 2010 (edited) Can't make it work, I tried with double rsi1=iCustom(NULL,0,"Regular RSI Div","",7,"", 0.0001,-0.0001,0,true,2,1); // (...,true,2,0) green arrow double rsi2=iCustom(NULL,0,"Regular RSI Div","",7,"", 0.0001,-0.0001,0,true,3,1); // (...,true,3,0) red arrow if (rsi1 != EMPTY_VALUE) return(SIGNAL_BUY); if (rsi2 != EMPTY_VALUE) return(SIGNAL_SELL); Also ask how to open an order in the exact moment that the arrow appears? not when the bar close. Any help please? Thanks :) Edited August 2, 2010 by kapri65 Quote
chrisbenjy Posted August 2, 2010 Report Posted August 2, 2010 Can't make it work, I tried with double rsi1=iCustom(NULL,0,"Regular RSI Div","",7,"", 0.0001,-0.0001,0,true,2,1); // (...,true,2,0) green arrow double rsi2=iCustom(NULL,0,"Regular RSI Div","",7,"", 0.0001,-0.0001,0,true,3,1); // (...,true,3,0) red arrow if (rsi1 != EMPTY_VALUE) return(SIGNAL_BUY); if (rsi2 != EMPTY_VALUE) return(SIGNAL_SELL); Also ask how to open an order in the exact moment that the arrow appears? not when the bar close. Any help please? Thanks :) To test, try this: double rsi1=iCustom(NULL,0,"Regular RSI Div","",7,"", 0.0001,-0.0001,0,true,2,1); // (...,true,2,0) green arrow double rsi2=iCustom(NULL,0,"Regular RSI Div","",7,"", 0.0001,-0.0001,0,true,3,1); // (...,true,3,0) red arrow Print("Rsi1: " + Rsi1) Print("Rsi2: " + Rsi2) Change the shift value to a time when there is an arrow on the screen. This will help you find out what the value is when there is an arrow. kapri65 1 Quote
iwjw Posted August 2, 2010 Report Posted August 2, 2010 First thing, I wouldn't rely on a signal on the current bar, because lots of indis are repainting at least the current bar Next I would let the EA run in visual mode and attach the RSI indi so that you can see whether the indi probably repaints the arrows even a few bars back...if so you might forget about it kapri65 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.