Carl Schreiber:
What you mean with does not work?
- Error => log error number?
- OrderSend never called check your logic with the debugger (Editor F5)?
- Something else?
when the bet is correct, the order will not be sent.
there is no error in meta editor and metatarder.
- "Doesn't work" is meaningless - just like saying the car doesn't work. Doesn't start, won't go in gear, no electrical, missing the key, flat tires - meaningless.
- Use Strict. It will help you.
Program Properties (#property) - Preprocessor - Language Basics - MQL4 Reference OrderSend(Symbol(),OP_BUY,hajm,Ask,10,0,0,0,0,0,Green);
Check your return codes for errors, report them and you would know why.
What are Function return values ? How do I use them ? - MQL4 and MetaTrader 4 - MQL4 programming forum
Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles
Only those functions that return a value (e.g. iClose, MarketInfo, etc.) must you call ResetLastError before in order to check after.double val1 = iCustom(Symbol(),TimeFrame,"Volty Channel Stop mtf",TimeFrame,MA_Price,MA_Length,MA_Mode,Atrlength,Kv,MoneyRisk,ab,abc,abcd,abcde,abcdef,abcdeg,abcdeh,abcdei,ahang,0,0); double val2 = iCustom(Symbol(),TimeFrame,"Volty Channel Stop mtf",TimeFrame,MA_Price,MA_Length,MA_Mode,Atrlength,Kv,MoneyRisk,ab,abc,abcd,abcde,abcdef,abcdeg,abcdeh,abcdei,ahang,1,0); double val3 = iCustom(Symbol(),TimeFrame,"Volty Channel Stop mtf",TimeFrame,MA_Price,MA_Length,MA_Mode,Atrlength,Kv,MoneyRisk,ab,abc,abcd,abcde,abcdef,abcdeg,abcdeh,abcdei,ahang,2,0); double val4 = iCustom(Symbol(),TimeFrame,"Volty Channel Stop mtf",TimeFrame,MA_Price,MA_Length,MA_Mode,Atrlength,Kv,MoneyRisk,ab,abc,abcd,abcde,abcdef,abcdeg,abcdeh,abcdei,ahang,3,0); void OnTick(){
These global variables never update. Assign them in OnTick. They don't need to be global either.You're not calling OrderSend and the lack of an error message would have told you that had you followed #3.- Once you get it to open an order, it will open a new one every tick.
- Next time, please don't add text inside quoted text or CODE blocks, put it outside.
MQL4 forum editor problem - MQL4 and MetaTrader 4 - MQL4 programming forum

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