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
right but what are you setting SL to? try 10, 100, 1000, and see how it looks in the strategy tester visual mode. One pip size in EURJPY is 0.01 I think, and the SL has to be set accordingly
I tried all numbers 10 to 1000 I still get invalid stops instead of using my pips function I assumed that might be the problem
switched to "_point" function but I still encounter the same problem invalid stops so that's not the problem.
I tried using Round to tick size but I still get invalid stops why is this?
Use ASK for modifying buy positions, use BID for modifying sell positions. You have it the other way around here. The Ask price is the available buy price. The Bid is the price you sell at. switch it around (even though it might not resolve this issue)
I don't use this function "SelectByIndex", try this instead:
Use ASK for modifying buy positions, use BID for modifying sell positions. You have it the other way around here. The Ask price is the available buy price. The Bid is the price you sell at. switch it around (even though it might not resolve this issue)
I don't use this function "SelectByIndex", try this instead:
Don't you count down when looping? I tried using position get ticket and I still get invalid stops
Don't you count down when looping? I tried using position get ticket and I still get invalid stops
I still get invalid stops even when checking stop levels
what symbol are you trading on? Invalid stops simply means that it's not being set at an allowed stop loss level. Different securities have different point systems. It's down to the broker to provide the correct data specifications for the symbols.
Go to the market watch window, right click the symbol you're trading on, and click "Specification". None of those fields should be 0. The "Initial Margin" should be 100000 for forex pairs.
I think your "Pips" function might be the problem. Use _Point (predefined variable).
Please change it to:
what symbol are you trading on? Invalid stops simply means that it's not being set at an allowed stop loss level. Different securities have different point systems. It's down to the broker to provide the correct data specifications for the symbols.
Go to the market watch window, right click the symbol you're trading on, and click "Specification". None of those fields should be 0. The "Initial Margin" should be 100000 for forex pairs.
I think your "Pips" function might be the problem. Use _Point (predefined variable).
Please change it to:
I don't think that's the problem as I've tried it before. I found a way to use a double function that includes stop levels , I don't experience invalid stops with buy orders its only with sell orders this time they don't modify at all.
I don't know why you use OnStart(), it's for scripts. I use OnTick() in expert advisors. I hope you're not learning from AI, as it will teach one how to do things incorrectly. I suggest to read through the "how to" guides for expert advisors
https://www.mql5.com/en/articles
https://www.mql5.com/en/articles/15299
I don't know why you use OnStart(), it's for scripts. I use OnTick() in expert advisors. I hope you're not learning from AI, as it will teach one how to do things incorrectly. I suggest to read through the "how to" guides for expert advisors
https://www.mql5.com/en/articles
https://www.mql5.com/en/articles/15299
I'm using Scripts for manual trading when I want to modify my positions not just one positions but multiple positions. As for AI I don't use it at all, it would be a waste of my time and everybody's time.