-
Play videoPlease edit your post.
For large amounts of code, attach it. - Of course it's possible.
- But what will you do if you exceed limits. Requirements and Limitations in Making Trades - Appendixes - MQL4 Tutorial
thanks for answer.I tried this change, will be correct ? thanks
double price=iOpen(Symbol(),0,0); double Buy_TP=price; double Buy_SL=0; double Sell_TP=price; double Sell_SL=0; // + ----------------------------------------------- ------------------- + // | función de inicialización experto | // + ----------------------------------------------- ------------------- + int init ( ) { // ---- // ---- retorno ( 0 ) ; } // + ----------------------------------------------- ------------------- + // | función deinicialización experto | // + ----------------------------------------------- ------------------- + int deinit ( ) { // ---- // ---- retorno ( 0 ) ; } // + ----------------------------------------------- ------------------- + // | Función de arranque experto | // + ----------------------------------------------- ------------------- + int inicio ( ) { // ---- int HowDeepIsYourLove = OrdersTotal ( ) ; doble TP, SL ; para ( int z = 0 ; z < HowDeepIsYourLove ; z ++ ) { si ( OrderSelect ( z, SELECT_BY_POS , MODE_TRADES ) ) { si ( OrderType ( ) == OP_BUY || OrderType ( ) == OP_BUYSTOP || OrderType ( ) == OP_BUYLIMIT ) { TP = NormalizeDouble ( Buy_TP, Dígitos ) ; SL = NormalizeDouble ( Buy_SL, Dígitos ) ; si ( OrderTakeProfit ( ) ! = TP || OrderStopLoss ( ) ! = SL ) { si ( ! OrderModify ( OrderTicket ( ) , OrderOpenPrice ( ) , SL, TP, 0 , CLR_NONE ) ) Imprimir ( "Algo pasó en BuyHood =), el error #" + GetLastError ( ) ) ; } } Demás si ( OrderType ( ) == OP_SELL || OrderType ( ) == OP_SELLSTOP || OrderType ( ) == OP_SELLLIMIT ) { TP = NormalizeDouble ( Sell_TP, Dígitos ) ; SL = NormalizeDouble ( Sell_SL, Dígitos ) ; si ( OrderTakeProfit ( ) ! = TP || OrderStopLoss ( ) ! = SL ) { si ( ! OrderModify ( OrderTicket ( ) , OrderOpenPrice ( ) , SL, TP, 0 , CLR_NONE ) ) Imprimir ( "Algo pasó en SellHood =), el error #" + GetLastError ( ) ) ; } } } } // ---- retorno ( 0 ) ; } // + ----------------------------------------------- ------------------- +
Why are you writing your code with the built-in function names translated into Spanish? You cannot just change MQL's function names into another human language just on a whim? You must use the proper original names of MQL! There is no "si", "para", "retorno", "Imprimir", etc.! You must to use "if", "for", "return", "Print", etc.
You should first learn coding in general, so that you can understand the basics of coding before trying to code your own Indicator or EA. It is of no use to anyone if you don't first learn the basics. This can take many months (even a couple of years), for a complete beginner, to properly learn to code Indicators or EAs. You need time to properly gain the necessary knowledge and coding experience for it. Obviously, if you are serious about it and have the dedication to stick with it, then go for it. But remember that it is a long-term project, and not short term.
If however, you are not serious about learning to code, or you need a solution quickly, then please consider hiring someone to code for you. Go to the Freelance section and place a Job advert, stating your budget and describing your requirements.
- All you did was translate your original post. That is nonsense. Babel. No attempt.
- Where do you try to Buy_TP and Sell_TP be equal to the opening price of the current candle? You didn't! No attempt.
- learn
to code it, or pay someone.
We're not going to code it FOR you.
We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Thanks.
CODE: [SELECT ALL]