Less code, more action... writing an EA - page 8

 
fxsaber:

It's not working.


And this is the second code

It's working.
JD      0       23:24:20.766    Experts expert Test (EURUSD,M1) loaded successfully
GR      0       23:24:35.118    Trades  '500031174': market buy 0.20 EURUSD
JH      0       23:24:35.248    Trades  '500031174': accepted market buy 0.20 EURUSD
CG      0       23:24:37.248    Trades  '500031174': deal #1624723 buy 0.20 EURUSD at 1.12964 done (based on order #2191294)
OM      0       23:24:37.248    Trades  '500031174': order #2191294 buy 0.20 / 0.20 EURUSD at 1.12964 done in 2138.070 ms
NQ      0       23:24:37.248    Trades  '500031174': market sell 0.10 EURUSD
HK      0       23:24:37.388    Trades  '500031174': accepted market sell 0.10 EURUSD
OL      0       23:24:39.405    Trades  '500031174': deal #1624724 sell 0.10 EURUSD at 1.12953 done (based on order #2191295)
QM      0       23:24:39.405    Trades  '500031174': order #2191295 sell 0.10 / 0.10 EURUSD at 1.12953 done in 2149.885 ms
KD      0       23:24:39.405    Trades  '500031174': close position #2191294 buy 0.20 EURUSD by position #2191295 sell 0.10 EURUSD
GE      0       23:24:39.535    Trades  '500031174': accepted close position #2191294 buy 0.20 EURUSD by position #2191295
ED      0       23:24:41.545    Trades  '500031174': deal #1624725 sell 0.10 EURUSD at 1.12953 done (based on order #2191296)
NK      0       23:24:41.545    Trades  '500031174': close position #2191294 buy 0.20 EURUSD by position #2191295 done in 2148.051 ms
 
Vladimir Simakov:

Try here:ForexTimeFXTM-Demo01.

 
Maxim Kuznetsov:

Is it all right that before accessing indicators of different timeframes, you have to bang on a tambourine and do the dance?

If you know who's going to do it, it's the user - let him learn zen and non-Chinese at the same time :-)

The platform represents convenient interfaces of indicators and their decomposition into buffers. So, why repeat something which has already been done and has been well done? To show that you are familiar with the word "class" something in fact...

Is it OK that this is the whole tambourine dance?

   ResetLastError();
   double res=iIchimoku(cSymbol,CheckFrame(),cTenkan,cKijun,cSenkou,mBuffer,mShift);
   return !GetLastError()?res:0.0;}

If the data is not ready, the method will return 0.0, which is elementary checked.

 
fxsaber:

Try here:ForexTimeFXTM-Demo01.

I wrote that I wrote it on my knee, and it's not netting accounting by the way?
 
Maxim Kuznetsov: Show you're familiar with the word "class" something in fact...

nasty word is class, second day I'm hanging with syntax parsing these devils: tag = "//tr [@class='calendar__row calendar__row--day-breaker']" at the word class, my eye starts twitching something is boiling ))))

 
Vladimir Simakov:
I wrote that I wrote it on my knee, by the way, it's not netting accounting?

Hedge. No one is rushing you to broaden your horizons.

If you have already downloaded this article, it will be useful for you to insert it into your MT5 trading account. So, everyone can try his forces.
 
fxsaber:

Hedge. It's not like anyone is rushing to expand their horizons.

This task can be considered as an initial test of one's MT5 trading skills. So, everyone may try their forces.

Is it like that I will not test it?

 
I'm going to bed now. Learn the basics. If there's anything you need, come back to me.
 
Igor Makanu:

nasty word is class, second day I'm stuck with syntax parsing these devils: tag = "//tr [@class='calendar__row calendar__row--day-breaker']" )))), the word class makes my eye twitch and I'm hooked.

careful reading of near-Xtml is a real learning curve :-)

Coming back to our mql's: in my opinion, classes are created from scratch. At the first opportunity and without justification and goals. If there's an op, then let's create a class :-). With the same indicators - the fifth generation of software, and the fact that indicators are divided into buffers that can be called as time-series and that's convenient, everyone knows it.

But they still keep making class CIshimoku. CMyYellowJigulyN5090 as the 50th class :-)

 
Maxim Kuznetsov:

Back to our mql: in my opinion, classes are created out of the blue. At the first opportunity and without justification or purpose. There's an oop, so we bump into a class :-)

strange, but you read my mind when observing some authors of indicators/articles etc.... i'm kind of the same here myself, sometimes i want to create something like this out of high art, and start writing in a class, that could be done easier, the main thing here is to stop and get back to the goals, and the goal should always be - performance and memory savings (fast code modification? - flexibility? ), but alas, these goals are not popular now

I could understand using OOP if you don't want to understand implementation and just want to get the job done, you can take an OOP solution and use it (HtmlAgilityPack, damn it, its simplicity...)

or use OOP if you need to store all data in one piece of code

but this is too much to use OOP for executing one built-in MQL command

Ok, I'm through discussing other people's code, I've never discussed it, it's not an interesting topic, there's no sense in it, nothing will change anyway, and I'm not the best example of writing a correct perfect code ))))