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

 
Maxim Kuznetsov:

which Ishimock component do you want a wrap for? and most importantly why and what kind of...
just chatting ? you can, why not...

PS/ Have you seen the Exxel ? In the DataFrame view the Ishimocks will look the same... Just like all the others... Traders work with tables actually. A chart is just a partial representation (view) of a summary table. So this data should be treated like tables.
From the trader's point of view - what is a program object ? It is nothing. There are no such things in his practical life.

So are you doing this for programmers, even beginners, or for just anyone?

 
Vladimir Simakov:

I wrote that with control of opening of these very orders.

I don't get it. Have you posted an incomplete version?

 
Vladimir Simakov:

For general thinking, example of a wrapper class for Ichimoku, but in mql4.

why make simple things so complicated? mt4 makes it easy to use indicators by writing a single line

I used to write it that way:

#define  ind1(int bar_) ind1(inp_param1, int... , int bar_) 
double ind1(int param1, int... , int bar)

{
тут можно предобработку описать, если необходимо
return(iCustom(,,,,,, bar))
}

OnTick()
{
 if(ind1(1) > ind1(2)) BUY();
}

With this approach, OnTick() takes 15-20 lines of code, where you can see all logic and quickly modify it for modifications - conditions are rewritten or indicators are added

imho, OOP you have made a complicated task from a simple one, you need to control TF switching, if the objects are created via pointers, unnecessary manipulation at each call, increases memory consumption.... why?

 
Vladimir Simakov:

Do you do it for programmers, even beginners, or for just anyone?

I do it specifically for beginners.

And who did you cite the code for? It completely repeats the standard indicator, and does not allow anything new; it's like an old song with a new twist. With new entities, one more class and one more include.

Why was the COD made ? It cannot be applied to S20 for example... physically it cannot be applied to arbitrary ohlc. And what class can be derived from it, where to grow from there ?

 
fxsaber:

I don't get it. Have you posted an incomplete version?

So you have no control of opening/closing an order, with me everything is fine. At least it works on Forex Club. I wrote that today I attached CloseBy to the library, there is still a feedback to be improved. For example, does the same ticket change or not? Forex Club does not, but others? That is, we have to implement control of this, to change required class fields, etc. But when all this is finalized and debugged, it's a real pleasure to write.

 
Vladimir Simakov:

So it is you who has no control of opening/closing an order, with me it is just fine. At least on Forex Club it works. I wrote, that CloseBy was attached to the library on a scratch today, there is still a feedback to be finished and to be finished. For example, does the same ticket change or not? Forex Club does not, but others? That is, we have to implement control of this, to change required class fields, etc. But when all this is finalized and debugged, it's a real pleasure to write it.

I'm repeating once again, your code doesn't work, the second code works.

 
Maxim Kuznetsov:

I'm doing this specifically for beginners.

But who did you cite the code for? It completely repeats the standard indicator, and does not allow anything new; it's an old song with a new twist. With new entities, one more class and one more inlude.

Why was the COD made ? It cannot be applied to S20 for example... physically it cannot be applied to arbitrary ohlc. And what class can be derived from it, where to grow from there ?

It's purely for the sake of convenience.

In the data segment:

CIchimoku ind1(EURUSD,PERIOD_M5,5,10,15);

CIchimoku ind1(GBPUSD,0,10,25,30,2);

As a result we have two indicators, the first on the m5 timeframe, but the second will always be shifted by +2 timeframes from the current chart timeframe.

 
fxsaber:

Once again, your code does not work, the second code works.

 
Vladimir Simakov:
expert Test (EURUSD,M1) loaded successfully
'35286172': market buy 0.20 EURUSD
'35286172': accepted market buy 0.20 EURUSD
'35286172': market buy 0.20 EURUSD placed for execution
'35286172': order #2214667209 buy 0.20 / 0.20 EURUSD at market done in 172.415 ms
'35286172': market sell 0.10 EURUSD
'35286172': deal #2211904952 buy 0.20 EURUSD at 1.12941 done (based on order #2214667209)
'35286172': accepted market sell 0.10 EURUSD
'35286172': market sell 0.10 EURUSD placed for execution
'35286172': order #2214667210 sell 0.10 / 0.10 EURUSD at market done in 171.843 ms
'35286172': deal #2211904953 sell 0.10 EURUSD at 1.12936 done (based on order #2214667210)
expert Test (EURUSD,M1) removed

It's not working.


And this is the second code

script Test4 (EURUSD,M1) loaded successfully
'35286172': market sell 1.00 EURUSD
'35286172': accepted market sell 1.00 EURUSD
'35286172': market sell 1.00 EURUSD placed for execution
'35286172': order #2214667234 sell 1.00 / 1.00 EURUSD at market done in 174.294 ms
'35286172': deal #2211904975 sell 1.00 EURUSD at 1.12936 done (based on order #2214667234)
'35286172': market buy 1.00 EURUSD
'35286172': accepted market buy 1.00 EURUSD
'35286172': market buy 1.00 EURUSD placed for execution
'35286172': order #2214667235 buy 1.00 / 1.00 EURUSD at market done in 175.016 ms
'35286172': deal #2211904976 buy 1.00 EURUSD at 1.12941 done (based on order #2214667235)
'35286172': close position #2214667235 buy 1.00 EURUSD by position #2214667234 sell 1.00 EURUSD
'35286172': accepted close position #2214667235 buy 1.00 EURUSD by position #2214667234
'35286172': deal #2211904977 sell 1.00 EURUSD at 1.12936 done (based on order #2214667236)
'35286172': close position #2214667235 buy 1.00 EURUSD by position #2214667234 done in 67.893 ms
script Test4 (EURUSD,M1) removed
It's working.
 
Vladimir Simakov:

This is purely for convenience's sake.

In the data segment:

CIchimoku ind1(EURUSD,PERIOD_M5,5,10,15);

CIchimoku ind1(GBPUSD,0,10,25,30,2);

As a result, we have two indicators, the first on the m5 timeframe, while the second will always be shifted by +2 timeframes from the current chart timeframe.

But is it OK that before accessing indicators of different timeframes, you have to bang on a tambourine and do some dancing?

Who will do it ... well, apparently the user - let him learn zen and the power of non-Chinese simultaneously :-)

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...

Reason: