[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 224

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
I've read it, I know about freezing distances etc., but I don't understand how a zero stop loss relates to all these restrictions! If you see a mistake - tell me. I read the manuals carefully before writing here. I would not do it if I didn't have to.
Some DCs allow SL and TP to be set when placing an order, some do not. Try it with your hands. The same applies to Freeze and minimum distance to stop (TP is also a stop).
Solved the problem with zero stops. However, I didn't understand how: what I commented, copied, put explicit 0 instead of variables, etc. Anyway, at some point everything worked))) Thanks to everyone who responded and left comments.
I've read them, I know about freezing distances and so on, but I don't understand how a zero stop loss relates to all of these limitations! If you see a mistake - tell me. I read the manuals carefully before writing here. I wouldn't write them if I didn't have to.
I saw the error in the fact that your BUY_STOP and SELL_STOP are set at the same price. If you have set TP and SL to zero, but error 130 remains, it must not be about them!
Only BUY_STOP and SELL_LIMIT, or conversely (depending on the specific case) BUY_LIMIT and SELL_STOP can be set at the same price. But not at all BUY_STOP and SELL_STOP! :)))
But you didn't read the manuals very well...
Now, by the way, the expert is working correctly.
A homemade function removes, in the case of a level breach, horizontal TREDLINE objects. Works correctly but is very costly.
With a large number of objects (more than 5000), it completely suspends the MT. Two days of CPU load without any results.
What options are more optimal to replace the condition?
A homemade function removes, in the case of a level breach, horizontal TREDLINE objects. Works correctly but is very costly.
With a large number of objects (more than 5000), it completely suspends the MT. Two days of CPU load without results.
How can the condition be more optimally replaced?
Calculate iHighest() at the very beginning of the code (at startup), save bar index into a variable. When opening a new bar, increment this variable and check if the previous bar is not the new "Highest". Also don't forget to check if variable > number of bars searched, then iHighest() function must be started again. This algorithm will work much faster, but it's still far from optimal! :))
I saw the error in the fact that your BUY_STOP and SELL_STOP are set at the same price. If you have set TP and SL to zero, but error 130 remains, it must not be about them!
Only BUY_STOP and SELL_LIMIT, or conversely (depending on the specific case) BUY_LIMIT and SELL_STOP can be set at the same price. But not at all BUY_STOP and SELL_STOP! :)))
You didn't read the manuals very well...
I do! Now I've looked at what I posted on the forum. But "reading manuals" has nothing to do with it - I just copied the parameter list and then corrected the right ones. And I forgot to correct the price in Sell Stop. It's buyPrice in both orders and sellPrice in Sell. If you had told me at once, it would have been very helpful, but it took me a lot of time to find an error due to my inattention.
Sorry I'm not a telepath... If I had known it was an oversight, I would have pointed it out straight away. I thought you didn't understand the theory.
However, your inattention was a long one... :D