***
Please help please
Documentation on MQL5: Constants, Enumerations and Structures / Environment State / Account Properties
- www.mql5.com
Account Properties - Environment State - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
- Anchor
- SymbolInfoDouble
- Comment
Please edit your post and use the code button (Alt+S) when pasting code.
EDIT your original post, please do not just post the code correctly in a new post.
-
Please edit your (original) post and use the CODE button (Alt-S)! (For large amounts of code, attach it.)
General rules and best pratices of the Forum. - General - MQL5 programming forum 2019.05.06
Messages Editor -
#include<Trade\Trade. Mqh>
Missing space after include. No spaces after the dot.
Several errors in your code :
- extra space at #include<Trade\Trade. Mqh>
- Digits => Digits() or _Digits
- If => if
- extra semicolon at your if statement
- BuyStop function comment should be string. instead of 0 use "0".
Your code should be like this :
#include<Trade\Trade.mqh> CTrade trade; void OnTick() { double Ask = NormalizeDouble(SymbolInfoDouble(_Symbol,SYMBOL_ASK),_Digits); double Balance = AccountInfoDouble(ACCOUNT_BALANCE); double Equity = AccountInfoDouble(ACCOUNT_EQUITY); if(Equity==Balance) { trade.BuyStop(0.01,Ask+100*_Point, _Symbol,0,Ask+300*_Point, ORDER_TIME_GTC,0,"0"); } }
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