Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 850

 
mitanq:

Generally, the check is like this

OrderSelect(ticket,SELECT_BY_TICKET);

if(OrderProfit()<0) { }


And you can put anything you like in brackets. I use it this way, for example, to make "martin" method work )


mitanq, thank you.

And what should we put in place of ticket to select the last opened order?

 
Craft:


mitanq, thank you.

What should I put in place of ticket to select the last open order?

The ticket of the last order opened, what else?
 

I understand that, but how is it determined, by what method? The meta-editor swears at ticket when compiling.

 
Craft:

I understand that, but how is it determined, by what method? The meta-editor swears at ticket during compilation.

Of course, it wouldn't, if the ticket is not defined and the ticket variable is not even declared. And the ticket must be recognized by the same OrderSelect(), no matter how paradoxical it may seem. The only thing we need is to apply in the loop of all open orders and select in order - OrderSelect(x,SELECT_BY_POS), where x is the number of loop iterations. And then, if the selected order meets all of your requirements for it, ticket=OrderTicket().

There are so many Expert Advisors in Kodobase especially for the example, do not be lazy, look through them, they will do for training. And read the help.

 
evillive:

It wouldn't be, if the ticket isn't defined and the ticket variable isn't even declared. And we should recognize the ticket using the same OrderSelect(), no matter how paradoxical it may seem. The only thing we need is to use in the loop of all open orders and select in order - OrderSelect(x,SELECT_BY_POS), where x is the number of loop iterations. And then, if the selected order meets all of your requirements for it, ticket=OrderTicket().

There are so many Expert Advisors in Kodobase especially for the example, do not be lazy, look through them, they will do for training. And read the help.

I asked the question above. It concerns the trading of the Expert Advisor on each bar. I would like to know how to make the indicator check on every tick. Can you tell me? I have laid out the code above.
 

Friends, who can repair this indicator?

/* Decompiled deleted. The author has been warned. Vinin */

 
Geowind64:
Friends, who can repair this indicator?
Is it so hard to remove the dots yourself and not have to decompile here?
 
mitanq:
I asked the question above. About the EA trading on every bar. How do I make the indicator check on every tick? Can you tell me? The code was shown above.

Just remove the condition for checking a new bar and OnTick() is always executed on every tick.
 
evillive:
Is it so hard to remove the dots yourself and not put a decompiled file here?
I'm sorry, I didn't even know it was a decompiled file.... I don't know much about it, so I had no idea.
 
evillive:
Simply remove the condition to control a new bar, and OnTick() is always executed on every tick.

Put ontick instead of time[0] ?
Reason: