[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 588

 
lottamer:

Oh! Now I get it! In MetaEditor's help it is not there...:(

Open MetaEditor. Open ANY EA there (you can just write extern in any code), press Ctrl+F and type extern, press "Find Next", then put cursor on found extern and press Ctrl+F1. Tell me "what did you get?" Is there any difference from"read on"??

P.S. The main problem of the modern beginner: "The incompatibility of opportunities with the immature desires!" Today ANY knowledge starts with SEARCHING for it! This too is a FACT - master it to begin with!!!! "Running over a step" for a beginner is predictable with the result...

 
lottamer:

Oh! I got it now! But it's not in the MetaEditor's help... :(


In Help :

MQL4 Reference - Language Basics - Variables - External Variables

  • Local variables
  • Formal parameters
  • Static variables
  • Global variables
  • External variables
  • Initialization of variables
  • Description of external functions

The extern memory class defines an external variable. The extern modifier is specified before the data type.

Example:

extern double InputParameter1 = 1.0; extern color InputParameter2 = red; int init() { ... }

External variables define the input parameters of a program, they are accessible from the program's properties window. Arrays cannot be used as external variables.

 
TarasBY:

Open MetaEditor. Open ANY EA there (you can just write extern in any code), press Ctrl+F and type extern, press "Find Next", then put cursor on found extern and press Ctrl+F1. Tell me "what did you get?" Is there any difference from"read on"??

P.S. The GREATEST problem for the modern beginner: "The incompatibility of capabilities with immature desires!" Today ANY knowledge starts with SEARCHING for it! This too is a FACT - master it to begin with!!!! "Running over a step" for a beginner is predictable with the result...

Thank you, friends, for your help. It's so helpful that I'm even willing to tolerate the various barbs with which you usually conclude your posts :))))))))))))))))

By the way, about the search in the MetaEditor Navigator... I have to hand it to the creators... extern is there of course...I just didn't type the word there, but copied-pasted it, and accidentally put two spaces at the end. So extern with two spaces already returns zero search result. extern with a single space gives 3 options...and just extern gives lots of links

:)))))))))))))) funny

 
rigonich:

If your sl and tp are fixed, why do you need any other closing conditions? Your trailing stop behaves the same as the standard one from the terminal - it modifies order on every tick, if price goes in the right direction (it pulls up stoploss). If you want it to modify not on every tick, add condition - not to modify, if difference between stoploss of order and current price is less than some level(trailing stop level + modification step).

And about placing - operators are executed in order, from top to bottom from left to right, if there are no branching operators between them (if else)/.


:))) there is no such thing as a NOT-modify condition! :)))

But the idea about comparing stops is alive, but too complicated. you'd have to first pull a stop value, then compare it...

it's easier to put some "checkbox" after modification, and then just look at its value, if it wasn't - modify, if it was - move on.....

And about stops - a deal may be closed not only by a stop, but earlier, if conditions for a turn for example...or simply exit by market.

 
lottamer:


Apparently because they do NOT need indicators. And beginners (traders) are not beginner programmers! I wouldn't want to learn mql in details either... just because there's no such problem. Instead, my real task is to make my life easier. To do that I need to write a not very complicated Expert Advisor, but to learn the entire language... it's too complicated... :)))

it is clear that later another EA or script will be needed...and one way or another the language will be learnt...but gradually...very gradually... :))

There's an old joke:

Летят в самолете Петька (П) и Василий Иванович (ВИ). Ж-Ж-Ж-Ж...
ВИ: - Петька, прибор!
П: - 120!
Ж-Ж-Ж-Ж...
ВИ: - Чего 120?!
П: - А чего прибор?!

So oh-so-often on a forum question and answer - like that joke, only the endings are different - split up happy! :)))

 
lottamer:


:))) there is no such condition as NOT to modify! :)))

But the idea of comparing stops is a good one, it's just too complicated. You would have to first pull the value of a stop, then compare it...

it would be easier to put some 'checkbox' after modification, and then just look at the value, if it was not there - modify it, if it was there - move on.....

And about stops - a trade may be closed not only at stop, but earlier, if conditions for a turn for example...or just an exit by market.

1.:))) there is no such condition as NOT to modify! :))). No, but there is an if operator, which allows you to create almost any conditions.

2. If you only want to modify an order once, then why should you modify it at all? Just set the required parameters when you open the order.

3. As for the stops - a deal may be closed not only at stop, but earlier, if the conditions for a turn, for example, or just a market exit.

All of this is possible, the question is in the objective (your goal). If you have a trading strategy and you only need to "mechanize" it, that's one thing, and if you want to learn how to do it with any trading strategy, that's another. For the first, you must have a ready-made strategy, for the second, you must learn to program it. And to be able to programmatically test your own trading ideas, you must be a fairly experienced trader and programmer, or at least the former and be able to pay a programmer for his work.

 
Can you suggest some literature so that I can read and create my own advisor? Or is it something that mere mortals cannot do? )))
 
rigonich:

1.:))) there is no such condition as NOT to modify! :))). No, but there is an if statement, which allows you to create almost any condition.

2. If you only want to modify an order once, then why should you modify it at all? Just set the required parameters when you open the order.

3. As for the stops - a deal may be closed not only at stop, but earlier, if the conditions for a turn, for example, or just a market exit.

All of this is possible, the question is in the objective (your goal). If you have a trading strategy and you only need to "mechanize" it, that's one thing, and if you want to learn how to do it with any trading strategy, that's another. For the first, you must have a ready-made strategy, for the second, you must learn how to program it.


1) it is clear

2) just checked...in Alpari you can't set stop and take when you open. only through subsequent modification...the costs of non-dealing-desk

3) there is a strategy.

 
Beowulf:
Can you suggest some literature to get me started and create my own EA! Or is it something that mere mortals cannot do? )))

https://book.mql4.com/ru/
 

Thank you!
Reason: