How to code? - page 139

 
luxinterior:
I answered your question 3 pages back https://www.mql5.com/en/forum/173219/page91

If you could only apply yourself as diligently to learning and coding as you do to nagging and whining then you might actually have accomplished something by now.

Nobody is under any obligation to help you so take what you've been given and apply it.

If, as I suspect, you're simply waiting for somebody else to actually code the whole thing for you then good luck. Perhaps somebody more benevolent than myself will assist you. The title of this thread is 'How to code?' NOT 'Code my routine for me cos I'm too lazy to even try to learn how to help myself.'

So sorry if mine and other coders posts regarding decompiled code got in the way of your SO important begging post.

Lux

Lux, sorry if i got in your way.. i am not what you think i am.. i am trying to create my own EA and have learn the basic through trial and error and examples.. i have been learning on my own but there are things i do not know..

even when i ask.. i am creating my own codes.. but still stuck.. i know little about loops..

i was hoping someone can just give me code which i can start.. from there i can get where i need..

 

Help with Highs and Lows

I'm struggling with some code and wonder if anybody could please help.

I'm trying to identify values for the two most recent highs (H1 and H2) and the two most recent lows (L1 and L2) which form during the period that an indicator returns an overbought or oversold value.

I've drawn a little picture to illustrate what I'm trying to achieve. My example uses stochastics, but any oscillator with a fixed minimum and maximum could be substituted.

I'm simply after the value of the highs and lows (not the time that they form). As the most recent value is returned (eg H1 or L1), the old H1 and L1 would then become H2 and L2.

 
fercan:
now that is over.. can someone help? i need code from using a fractal..

what is the code for fractal? i wanna get the value of the blue and yellow.. also 2 fractal up and fractal down after the blue and yellow..

Fractal source code here:

Fractals.mq4 - MQL4 Code Base

 

Please help to find the error

Can't find one error at expert. Please help.

Files:
test1.mq4  13 kb
 

Identifier syntax maybe???

 

Why doesnt this work?

Hello

//---- input parameters

extern string paire.1="EURUSD";

extern string paire.2="GBPUSD";

extern string paire.3="USDJPY";

string paire [3]= {paire.1, paire.2, paire.3}; //error compil

string paire [3]= {string paire.1, string paire.1, string paire.1};//error compil

string paire [3]= {extern string paire.1="EURUSD", extern string paire.1="EURUSD", extern string paire.1="EURUSD"};//error compil

string paire [3]= {"EURUSD", "GBPUSD", "USDJPY"}; // no error it's good compil

Help me please.

Where's my error?

 

Have you tried without the full stop?

eg paire1 instead of paire.1

I don't know, but it's just a thought.

 

fungraphic

You can't have period in a variable name also you can't declare a variable within an array declaration. Take a look in the help file for more information about arrays and how to declare them.

Lux

 
fungraphic:
Hello

//---- input parameters

extern string paire.1="EURUSD";

extern string paire.2="GBPUSD";

extern string paire.3="USDJPY";

string paire [3]= {paire.1, paire.2, paire.3}; //error compil

string paire [3]= {string paire.1, string paire.1, string paire.1};//error compil

string paire [3]= {extern string paire.1="EURUSD", extern string paire.1="EURUSD", extern string paire.1="EURUSD"};//error compil

string paire [3]= {"EURUSD", "GBPUSD", "USDJPY"}; // no error it's good compil

Help me please.

Where's my error?

what a mess what is it your tring to do?

You cant declear variables within array declarations you can not use the extern key word there as well, in fact you can not declare the variables twice in the same code block. But your main problem lays in the fact your useing variables to assign values to the the elements of the array that can only be done with constancts as in your last example.

as far as using the period seperator it is not documented it will work BUT because that it is undocumented I would not be supprized if MT is not reserving its use in the future, and if so, your'll have to rewrite your code at that time. not a good idear to use it if you ask me.

Keit

 

Can anyone help me code this? Need a Popup once a certain condition is met

Hi

I need to code an EA (is that what you call it) to alert me on a certain trade condition happening.

I would like it to be able to moniter the 15mins, 30 mins, 1h and 4h time frames

Conditions for Buy: (Sell is the direct opposite)

1) 2 Moving Averages are needed

1 of the High of all bars 10 SMA of High

1 of the Low of all bars 8 SMA of Low

2) 2 bars are TOTALLY ABOVE the SMA High, (Meaning the Low of the bar is totally above the SMA high)

3) Within the next 10 or 15 bars or 20 bars, alert me once 1 bar closes TOTALLY BELOW the SMA Low

VICE VERSA for sell

Can anyone code this for me?

Thank you

Reason: