[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 289

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Well basically the strategy itself is very long and complex, and there is no point in describing it, it's 1 point to create a loop ie I need to find something instead of total==1 that does not open a position not matching the request, ie if it closes on st then .........open 1, if closed at ......... тп open 2, the condition lack of an order in the market, that's all,
Well basically the strategy itself is very long and complex, and there is no point in describing it, it's 1 point to create a loop ie I need to find something instead of total==1 that does not open positions not matching the request, ie if closed by st then .........open 1, if closed by ......... тп open 2, the condition abscence of the order in the market, that's all,
Then you just don't want to use Igor's function. You need a function that returns the type of the last closed order and why it was closed. It won't return the reason of the last closed order of a certain type. I will try to think of something now...
Then you just don't fit Igor's function that you are using. You need a function that returns the type of the last closed order and why it was closed (tap or sl). It won't return the reason of the last closed order of a certain type. I will try to think of something now...
If you have something similar to Klimovskoe that returns a value for the last order closure only, I would be very grateful to you
Try such a function in conjunction with Igor's function:
Your piece of code should then look like this
Your piece of code should then look like this
Thanks. I'll give it a try.
Hello, please help me to set virtual stoplosses at specified points. To be more precise: instead of sending data about a new SL, the EA shall simply store them in variables (or somewhere else), and trawl, trawl, and when the price reaches a certain level it sends a signal to brokerage companies about closing an order, (a kind of virtual trailing stop with virtual stoploss). In other words, the Expert Advisor includes a trailing stop on an invisible level from 1 pip to the DC server... is it realistic?
Yes it is real, of course. You look through the open orders, they have an open price, for example, we have a Buy order opened at the price of X, virtual stop-loss Y points, so if the current price Z < = X-Y*Point the order should be closed. Of course, we should also take into account the spreads and if the stop loss is not fixed but calculated, the calculated value must be securely stored somewhere, etc.
Search for "virtual stop", "virtual stoploss" etc.
It is realistic of course. If we look through the open orders, their open price will be set, for example, we have a Buy order opened at X price and the virtual stoploss is Y points so if the current price Z <=X-Y*Point the order will be closed. Of course we have to take into account the spreads, and if the stop loss is not fixed but calculated, then the calculated value has to be securely stored somewhere, etc.
Search for "virtual stop", "virtual stoploss" etc.
I think we cannot do without having our own order bookkeeping of some kind.
Create your own order array and store all the necessary virtual stop data in it.
Yes it is real, of course. You look through the open orders, they have an open price, for example, we have a Buy order opened at the price of X, virtual stop-loss Y points, so if the current price Z < = X-Y*Point the order should be closed. Of course, we should also take into account the spreads and if the stop loss is not fixed but calculated, the calculated value must be securely stored somewhere, etc.
Search for "virtual stop", "virtual stoploss" etc.
Thanks for the reply, it's just the trailing stop (trailing stop) that is the problem, I want to trail 1 pip min, and I want to send orderModify to brokerage company with every tick - it's just hooliganism IMHO ))
"If the stop loss is not fixed but calculated, the calculated value must be securely stored somewhere".
where to store and how to call it... I think it has to be a variable, or am I wrong...