Ask! - page 5

 

EDIT: Well, I guess you already got a response from Codersguru, but I'll leave this in place as it may help somebody else.

EDIT 2: I think you'll need reference JMASlope as I show below, due to the way it uses 2 buffers to give you the slope. Codersguru, please let me know if this is correct as you're The Man and I'm just a humble noob trying to learn to program. BTW, thank you so much for your MT4 programming tutorials. I knew a little, but now I know a lot more.

zuhainis:
Hi Codersguru,

I'm trying to get current JMASlope value using iCustom but not sure how to do it, can you please help me?

Is this correct?

double Slope = iCustom(NULL,0,"JMASlope",14,0,0);

Thank you.

double Slope = iCustom(NULL,0,"JMASlope",14,0,0);

The 0 in the above line of code sets which indicator buffer you want information from. In the code, you'll usually see them as IndexBuffers. There can be 8 buffers, from 0-7.

In the JMASlope indicator, if you look at the code, you'll notice that there are 2 indicator buffers, 0 and 1. 0 = UpBuffer and 1 = DnBuffer.

In most indicators you can choose whichever buffer holds the information that you want and just call that buffer. JMASlope is a little different, though. It uses 2 buffers to give you 1 piece of information, i.e. the slope. Buffer 0 keeps track of positive slopes, and buffer 1 keeps track of negative slopes. To get all the information into your EA you would need to reference both buffers, similar to the following:

double Slope

double SlopeUP = iCustom(NULL,0,"JMASlope",14,0,0)

double SlopeDN = iCustom(NULL,0,"JMASlope",14,1,0)

if(SlopeUP > 0) Slope = SlopeUP;

else

Slope = SlopeDN;

Another thing, in iCustom, the values after the indicator name, i.e. "JMASlope", and before the mode (where you choose the buffer as we did above), match the external Inputs that a user may enter on the Input tab when attaching the indicator. For JMASlope, there are two inputs, Length and Phase. So, in the above code, we've specified 14 for the length, and we left out an entry for phase, so it would use the default of 0. If you had wanted to specify a phase you would have done something like 14,2.

Well, that may be a little overkill for an answer, but I wanted you to understand how it worked. I hope all of that was understandable. Let me know if I need to clarify anything.

Keris

 

Help with ICWR

Since this is the Ask thread, I'm posting this here too (I posted in the icwr thread already).

Do you think it would be possible to modify the code of the icwr indicator to leave all of the previous Active Waves showing? I want to be able to manually backtest the system and the indicator is great fro drawing the waves, but it would be nice to be able to quickly look at the chart and see all the previous waves that qualified as Active Waves. Maybe when an active wave is replaced by a new active wave, instead of turning back to blue, it could change to yellow or something.

I've tried a number of modifications to the code, but I can't seem to get any of them to work.

When you have time, I'd really appreciate your help.

Keris

 

hi coder

i am a Microsft Certified VB6 coder if you have any idea about linking MQL4 and VB6 i am very keen to help.i do not know exactly it is possible or not(i mean linking these two)but i suppose that evry thing is possible.i am ready for your suggestion(s).

 

strategy compiler

i want to offer you a software which is able to compile your trading strategies to MQL4 language.to install this software on your PC you should install .NetFrameWork 1.1 first.here you can find it:

http://www.microsoft.com/downloads/details.aspx?FamilyID=262d25e3-f589-4842-8157-034d1e7cf3a3&displaylang=en

 

hi

this software that i offered here is a compiler.i mean you can put your own strategy in it(of course in a very user friendly environment)and the software will compile your strategy to MQL4 language.this is a trial version.

Files:
gordago.rar  833 kb
 

presentation

this file is a demonstration of the software.in fact it is a guideline of it.the best kind of help.enjoy!!!!!!!

Files:
 

Stop and Reverse trailing stop loss

Hi

I am interested in stop and reverse code.

Can you put stop and reverse code onto the sample that you gave for the lessons.

Example long EURUSD stop loss 10.

if stop loss reached then close order and open a order in the reverse OP_SELL.

If short EURUSD short stop loss 10.

if stop loss reached then close order and open a order in the reverse

OP_BUY

Thank you

Oba Ire

 

silvertrend alert

codersguru,

gud day!

what code could i add to silvertrend signal. so that everytime it signals buy or sell aside from visual signal it will also sound off or better send me an email.

thanks it would help me alot.

Merry Christmas!!!

Files:
 
jerrymar:
codersguru,

gud day!

what code could i add to silvertrend signal. so that everytime it signals buy or sell aside from visual signal it will also sound off or better send me an email.

thanks it would help me alot.

Merry Christmas!!!

I think this will work:

smin = SsMin+(SsMax-SsMin)*K/100;

smax = SsMax-(SsMax-SsMin)*K/100;

val1[shift]=0;

val2[shift]=0;

if (Close[shift]<smin)

{

uptrend = false;

Alert("Silvertrend DOWN signal!!!"); }

if (Close[shift]>smax)

{

uptrend = true;

Alert("Silvertrend UP signal!!!");

}
 

hi coder

i have a question :consider i want to draw an arrow on my chart as a result of a special condition.what should i do?