Вы упускаете торговые возможности:
- Бесплатные приложения для трейдинга
- 8 000+ сигналов для копирования
- Экономические новости для анализа финансовых рынков
Регистрация
Вход
Вы принимаете политику сайта и условия использования
Если у вас нет учетной записи, зарегистрируйтесь
Извините, на самом деле я немного запутался.
if(iOpenOrders_Buy = 3)
Если общее количество открытых ордеров на покупку равно '3', то код переходит к следующей части.
if(iOpenOrders_Buy > 0 )
Если количество всего открытых ордеров на покупку больше '0', то код переходит к следующей части.
if(iOpenOrders_Buy == 3)
Тогда если количество открытых ордеров на покупку равно 3, то откроется BuyOrder_1, если равно '2', то откроется BuyOrder_2 и затем BuyOrder_3, если количество открытых ордеров на покупку равно 1.
Я прав?
Вы правы, посмотрите еще раз на измененный код, это нормально?
Вы правы, посмотрите еще раз на измененный код, это нормально?
Я так не думаю.
if (Buy Condition Met && iOpenOrders_Buy == 0)
Это означает, что "условие покупки выполнено" и нет "открытых ордеров на покупку", верно?
тогда код перейдет к следующей строке, где iOpenOrders_Buy = 3;
Таким образом, эксперту сообщается, что уже есть 3 открытых ордера, верно?
Но если я ввожу код, зная, что там нет открытых ордеров на покупку, то почему мы присваиваем iOpenOrders_Buy = 3;?
Также цель состоит в том, чтобы одна из трех сделок продолжала работать, и только "новый" ордер на покупку будет открыт, когда последняя сделка будет закрыта.
Поэтому должно быть следующее
if(iOpenOrders_Buy== 0) // Открытых ордеров на покупку нет, поэтому мы должны открыть новые ордера на покупку.
Когда советник получит условие Buy, он откроет три сделки с разными Take Profit.
Затем, если две из сделок все равно будут закрыты (по TP или SL), третья будет продолжать работать.
Что вы думаете об этом? Будет ли это делать то же самое, что указано выше?
С уважением,
Я так не думаю.
Что вы думаете по этому поводу? Будет ли это делать то же самое, что указано выше?
С уважением,
нет, что происходит, если ордера не удаются, как вы проверяете, какую сделку нужно открыть, если одна не удалась
почему мы присваиваем iOpenOrders_Buy = 3; ?
вы должны открыть 3 новые сделки, если ordersend успешен, сделайте iOpenOrders_Buy новым значением.
если iOpenOrders_Buy становится 0, то у нас есть наши 3 сделки
нет, что происходит в случае неудачного завершения ордеров, как проверить, какую сделку нужно открыть, если одна не удалась
почему мы присваиваем iOpenOrders_Buy = 3; ?
вы должны открыть 3 новые сделки, если ordersend успешен, сделайте iOpenOrders_Buy новым значением.
если iOpenOrders_Buy становится 0, то у нас есть наши 3 сделки.
Да, очень возможно, что 'Ordersend()' не удается открыть ордер.
Теперь я понял, почему
if(iOpenOrders_Buy > 0 ) // мы должны открыть новые ордера на покупку
был использован в вашем коде. Так как мы уже установили iopendOrders=3, то он это проверит.
Но потом я запутался, как значение iopendOrders будет меняться.
Вероятно, из-за ограниченности моего мозга я не смог понять механизм. Поэтому я попытался реализовать вашу логику вышеописанным способом.
Это то, что вы указали в приведенном вами коде?
С уважением,
Да, очень возможно, что 'Ordersend()' не может открыть ордер.
Теперь я понял, почему
if(iOpenOrders_Buy > 0 ) // мы должны открыть новые ордера на покупку
был использован в вашем коде. Так как мы уже установили iopendOrders=3, то он это проверит.
Но потом я запутался, как значение iopendOrders будет меняться.
Вероятно, из-за ограниченности моего мозга я не смог понять механизм. Поэтому я попытался реализовать вашу логику вышеописанным способом.
Это то, что вы указали в приведенном вами коде?
С уважением,
Пожалуйста, не обращайте внимания, но я опять запутался!
Если я использую
count=count-1; after
Print( "Buy Order 1 Opened successfully");
это означает, что если первый ордер на покупку был открыт, то значение count будет уменьшено на 1.
Поэтому при входе в следующую функцию, здесь следующее условие 'if':
if (count==2) {}
значение count стало равно '2'. [count=3-1=2].
Правильно ли это?
Пожалуйста, не обращайте внимания, но я опять запутался!
Если я использую
count=count-1; after
Print( "Buy Order 1 Opened successfully");
это означает, что если первый ордер на покупку был открыт, то значение count будет уменьшено на 1.
Поэтому при входе в следующую функцию, здесь следующее условие 'if':
if (count==2) {}
значение count стало равно '2'. [count=3-1=2].
Правильно ли это?
попробуйте.... провести тестирование
попробуйте это сделать.... сделайте несколько тестов
Устал и вот результат.
Вероятно, я не смог разместить код 'Закрытие ордера на продажу перед покупкой' в нужном месте. Отсюда и продажи и покупки, хотя это противоречит оригинальному коду.
И всего '4' ордера на покупку!
Я потерпел неудачу :(
опс, забыл поставить iOpenOrders_Buy ==0
Теперь тестируем снова с этим.