[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 102

 
Vinin:


Approximately like this

In the array we get the numbers, ones, tens, hundreds and so on

No, your code is hard to use for me yet. I will leave it in the archive until better times, so to speak, "to grow".

However, in your version I was attracted by the while loop, in which you put N (tmpl).

Can I do the same, i.e. use while in my above code (p.100) and put it above the for loop?

 

robot:


I guess I don't understand, a programme that works on the tester should logically also place orders on the real.

No, it does not owe anyone anything. There is a difference between the demo real and the tester. For example, the tester will never show an error when opening orders if all parameters OrderSend() are correct. But a trade server, on the contrary, it will.

This is why we should modify the programs after the tester and then run them on the demo, so that they can adequately handle exceptional situations, which do not occur in the tester.

 
Sergey_Rogozin:

No, it's hard for me to use it yet. I'll leave it in the archive until better times, so to speak, "to grow".

However, in your version I was attracted by the while loop in which you put N (tmpl).

Can I do the same, i.e. apply while in my code above (p.100), putting it over for loops?


I basically did what you wanted. No more than that.

And using for() loops in your version would take relatively long to execute

It is better to do without for() loops. There should only be one loop

 
Can you tell me how to make the advisor switch off at a certain time?
 
Vinin:


Basically, I did what you wanted. No more than that.

And using for() loops in your version will take a relatively long time.

It's better to do without for() loops. There must be only one loop.

Thank you, I understood about the loops.

I will master new horizons - your code.

 
render:
Can you tell me how to make the advisor switch off at a certain time?
If you want it to unload completely, you cannot do it with MQL. If you want it to stop responding to the market, then if(Time[0]>=set_time) return(0);
 

I have a broker that has such holes in the quotes, I contacted their support team and they say that the quotes are downloaded from the metaquotes to them and we have nothing to do with it.

I do not know what to do with them.


 

In the tester sleep() does not work, in that case how to bypass this point... I use for initiation of two figures (with the same principle of construction), i.e. for difference of one from another for possibility of their subsequent comparison I remember time of formation of the first and if time of formation of the second is more, then I perform actions... I.e., right after formation of the first figure I use sleep(2000) to prevent at the same moment (in the next line of code) - to identify this first formed as the second, too. Please advise what can be used for this... In other words, to make the EA rest for a second after the formation of the first figure, because in the next line there is a control of formation of the second figure and without a "rest" the first formed figure is initialized as the second one too, and this is not acceptable...

The (whole) question itself is here - page 99.

 
alsu:
Note - in your code, "If(Ticket>0)" means "the OrderSend command worked without errors" and "else" is "some error occurred while executing OrderSend and the order was not placed". Is that the logic you mean?
Yes, you are correct in noting that my code doesn't match what I want to end up with at all!
This was the idea:
1. I place a pending order (if the trade criterion is met)
2. If the order has not been executed on the current bar, we wait to see what happens on the next bar
3. If the pending order has not been executed on the next bar, we delete it

alternative (good luck):
2. If the order has been executed on the current bar (1st Stop Loss is already there), then the next 3 bars are trailing (trailing in shadows of the last N bars)
3. Trailing (by a boom)
alternatively (bad luck)
2. If the order is executed and the market does not go the way it should, then we make a U-turn

NAPOLEONIAN PLANS OF course!!!, but I am a beginner - and I am struggling with the "language"
. If you would like to write a nice template, because my mind is still boggling)

Thanks for your feedback
 
Roman.:

In the tester sleep() does not work, in that case how to bypass this point... I use it to initiate two figures (with the same principle of construction), i.e. to distinguish one from another for possibility of their subsequent comparison I memorize time of formation of the first and if time of formation of the second is more, I perform actions... I.e. I use sleep(2000) when forming the first figure to distinguish possible subsequent formation of the second figure and identify it as the second one. Please advise what can be used for this...

The (whole) question itself is here - page 99.

Use Time[x] bar time.