[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 266

 
snowman647 >> :

Thank you very much.

Here's the question

I wrote an EA with some functions imported from a DLL - I try to run a strategy tester and get

I cannot use DLL for testing strategy of my EA?

or what kind of error?

To answer my own question Service - Settings - Enable DLL import

 

Please advise on the MA Smoothed formula. Here's an illustration just in case :)


MA

How is it ironed?
 
IlyaA >> :

Please advise on the MA Smoothed formula. Here's an illustration just in case :)


MA

How is it ironed?


>> https://www.metatrader5.com/ru/terminal/help/indicators/trend_indicators/ma

 

Gentlemen, could you please suggest a simple code to set pending order prices so that they end in 0 or 5.

By the way, how do I set multiplicity of pending prices?

I have tried it with remainder of division or percent comparison, but did not understand it at once.

I thank the people who have responded.

 
rosomah писал(а) >>

Gentlemen, could you please suggest a simple code to set pending order prices so that they end in 0 or 5.

By the way, how do I set multiplicity of pending prices?

I have tried it with remainder of division or percent comparison, but did not understand it at once.

Thanks to the guys who replied.

double NormalizeDouble( double value, int digits) 

Rounding a floating point number to a specified precision.

value - Value with floating point.
digits - A precision format, the number of digits after the decimal point (0-8).

 

Friends, can you tell me where I made a mistake?


There is an indicator BrainTrend1N - it colours bars depending on the direction of price movement.


I am writing an Expert Advisor that would buy when a bar is ascending (coloured blue by default) and sell when a bar is descending (coloured red by default).


I am accessing appropriate indicator buffers from EA, but unfortunately EA does not make any deal during testing.


Do you have any tips on how to deal with it?


Many thanks in advance.

 
vasya_vasya писал(а)

Thanks, but that's not what I asked.

One EA tracking a pair, let it place pending orders with a price ending in "0",

and another one, say, on the adjacent pair places pending orders ending with "5". And another one, for example, sets pending orders ending with "3" or "8".

It is about the last digit of the price.

I prefer using pendants placing 5-10 at a time to avoid confusion.

Now I am improving the placing of pending orders and want to handle this issue in my Expert Advisors for better visualization.

How to set the last digit of a pending price?

Or have I already got the answer?

 
rosomah писал(а) >>

Thanks, but that's not what I asked.

One EA tracking a pair, let it place pending orders with a price ending in "0",

and another one, say, on the adjacent pair places pending orders ending with "5". And another one, for example, sets pending orders ending with "3" or "8".

It is about the last digit of the price.

I prefer using pendants placing 5-10 at a time to avoid confusion.

Now I am improving the placing of pending orders and want to handle this issue in my Expert Advisors for clarity.

How to set the last digit of a pending price?

Or have I already got the answer?

Example

if(NormalizeDouble( x/10,4)==x/10)- condition for expiration on zero
if(NormalizeDouble( x/5,4)==x/5 )- condition for expiration on five 

to check the ending for 123456789

the function

MathCeil( double x)

Example

double xx;

xx=Bid/Point-(MathCeil(Bid/Point/10)-1)*10;
Print("Bid = "+Bid+" Point = "+xx);

 
rosomah >> :

Thanks, but that's not what I asked.

One EA tracking a pair, let it place pending orders with a price ending in "0",

and another one, say, on the adjacent pair places pending orders ending with "5". And another one, for example, sets pending orders until "3" or "8", it does not matter.

It is about the last digit in the price.

I prefer using pendants placing 5-10 at a time to avoid confusion.

Now I am improving the placing of pending orders and want to handle this issue in my Expert Advisors for clarity.

How to set the last digit of a pending price?

Or have I already got the answer?

If the number is set in integer type, it is elementary, e.g:


if ((number % 10) == n) {

// number number has a last digit n (ending in n), where n is an integer in the range 0 to 9

}


If the number is not an integer, it can always be converted to an integer type.

 

Good day to you all!

Do you guys know the reason why a strategy tester may hang?

When optimizing a simple Expert Advisor, the tester either "dies" right away, or hangs after a certain number of passes. There are only a few million search options, and I have tried reducing them to a few thousand - it still resists. It just keeps writing "optimization started" in the log. The Expert Advisor is very primitive - signals on CCI, order opening at crossing of the upper or lower levels by the indicator (levels are defined by the optimization), order closing and simultaneous opening of the next one occur at the opposite signal or at Take Profit or Stop Loss (TP and SL levels are also defined by the optimization). That is the version "always in market" with stops. And the previous version of this EA - when entering based on the same signals, but closing only with stops - tested and optimized without problems. I tried everything - I updated the minute history, changed terminals and computers, tried all variants of testing (by open prices, by checkpoints and by all ticks), danced around with tambourine, pronounced the name - but nothing works... :-(

The hedgehog knows that in the real world, such an expert will fail, but I need it for two reasons:

a) I'm learning to program on it;

b) I want to try to use it (not this expert in particular, but a modified CCI) as a locomotive to be able to attach additional conditions.

So the question why the optimization does not work is important to me: whether it is my glitchy code or some specific features of MT4.

Reason: