this is my code. i jast want EA after run, buy 0.1 lot of symbol in Ask price. but this code dont work and show me 10013 return code. please help me. what is problem and how i can solve it. tnx.
- OOP, templates and macros in mql5, subtleties and uses
- Please help me "OrderSend: Error code 131"
- iteration(code too large)
Use a simple option. This script is a one-off program. Attention: this is not an expert!
//+------------------------------------------------------------------+ //| Open Buy.mq5 | //| Copyright © 2018-2021, Vladimir Karputov | //+------------------------------------------------------------------+ #property copyright "Copyright © 2018-2021, Vladimir Karputov" #property version "1.001" //--- #include <Trade\Trade.mqh> CTrade m_trade; // trading object //+------------------------------------------------------------------+ //| Script program start function | //+------------------------------------------------------------------+ void OnStart() { //--- m_trade.SetMarginMode(); m_trade.SetTypeFillingBySymbol(Symbol()); m_trade.Buy(0.01); // open Buy position, volume 0.01 lot } //+------------------------------------------------------------------+
Vladimir Karputov:
i know but how i can buy or sell when price break moving average line? can you show me this expert code?
Use a simple option. This script is a one-off program. Attention: this is not an expert!
reza bhamanian :
i know but how i can buy or sell when price break moving average line? can you show me this expert code?
i know but how i can buy or sell when price break moving average line? can you show me this expert code?
First, you need to learn how to create an indicator and receive data from the indicator: Creating an iMA indicator handle, getting indicator values
How to start with MQL5
- 2020.03.05
- www.mql5.com
This thread discusses MQL5 code examples. There will be examples of how to get data from indicators, how to program advisors...
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