[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 597

 
Dimka-novitsek:



Of course you are! I wrote that on purpose. After 100pp in either direction, the profitable order is deleted, the flag is reset, and the orders are placed again. But... It doesn't work.

That's the trick.

With this conditionif (Error==0){ profit = NormalizeDouble( Ask+( 45*Point),Digits); SELL will not open

	          
 

Thank you!!! I think you're right. I'll take a closer look. But so far I've been testing with zero.

Wait, where was I? Yes, it won't open if the buy order is not successfully opened. And stops and profits are set exactly as they should be.

 
Chiripaha:
Is it somehow possible to write comments to lines like those written when an order is placed (ticket number and order type)?

rigonich:


Oh yes, learn to ask the right questions, at last. What lines? Power lines? Most people are not telepathic and cannot know what you mean unless you tell them.

: ))) I've read the comments for the right question(s)... Thanks to all participants of the discussion - I'll try to take it into account.

(Reference: for help (don't take it as a mentoring)
In pedagogy it is called "Loss of coherence" - when a part of a question seems self-evident to the asker (or explainer) - so he misses it in the narrative. In this case you need to be patient and ask an equally valid "Clarifying Question". The whole thing is called the "Feedback Technique". )))
Another important aspect. - When you take on the job of helping beginners, it seems that they are silly underachievers and so on... This is also a pedagogical peculiarity. - Those who ask can not and do not know, and most of them can not even ask the right question, because the correct question is 70% of the answer. - This is normal and should be so by definition. So I have great respect for those who took on this difficult and patient job. Thank you very much! : )) )

Regarding lines - I meant any lines: at least horizontal ones.

That is, if I set some horizontal line, is it possible to write comments to it, which are written in case of placing an order: with ticket number and order type? Also, if we have such a clarifying question, are these comments different for different types of lines or will the method of placing such comments be similar (the same)? If so, I would like to know these differences.

Thanks so much for the follow-up replies! I really appreciate any help on this new thing for me.

 

It could probably be done by methods like this . By the way, the question is perfectly clear to me. This is not a solution, but only roughly how.

//+------------------------------------------------------------------+
//|                                                    написание.mq4 |
//|                        Copyright 2012, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright 2012, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"
extern int shift=0;// На каком баре рисуем.
//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
//----
   int Profit=0;                                
    for (int i=0; i<OrdersTotal(); i++)
   {
    if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES) == true)
   {
    if(OrderSymbol()!= Symbol()) continue;
  double  Price=OrderOpenPrice;
      Price=Price+Point*100;
      string name=Price;
      ObjectCreate(  name, OBJ_LABEL, 0, iTime( NULL, 0,  shift),  name );
     ObjectSetText(  name, name, 4, NULL, Green)  }}  
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
 
Chiripaha:

As for lines - I meant any lines: at least horizontal ones.

That is, if I put some horizontal line, is it possible to write comments to it, which are written in the case of placing an order: with the ticket number and order type? Also, if we have such a clarifying question, do these comments differ for different types of lines or will the method of making these comments be similar (identical)? If so, I'd like to know the differences.

Thanks so much for the follow up replies! I really appreciate any help in this new thing for me.

A horizontal line(OBJ_HLINE) is a graphical object. The objects have properties. There is a property (description). Graphical objects on a chart are recognized by their names (to control them via code). To show object description on the chart, right click on the chart -> Properties -> General -> Check the box "Show object description". Manually enter a description of the object: select the object -> right click on the object -> Object Properties -> Description - > Enter the desired description.

P.S. In this way, the information obtained in 9 out of 10 cases will not be remembered. As opposed to the answer found. Through the process of cognition through the search process. Moscow will remember the excruciating process and in order to avoid repetition of the situation, will "deposit" in memory the information found - this is a form of acquired reflex. ;)

P.P.S. All my children knew that their father would help them only if they had the answer to the task, even if it was not correct. Thank God they 'graduated from the institutes with success'!!! :)))

 
Chiripaha:

: ))) I've read the comments for the right question(s)... Thanks to all the participants - I'll try to take it into account.

(Reference: for the help box (don't take it as a mentoring)
In pedagogy it is called "Loss of coherence" - when some part of the question seems to be self-evident to the asker (or explainer) - so he skips it in the narrative. In this case you need to be patient and ask an equally valid "Clarifying Question". The whole thing is called the "Feedback Technique". )))
Another important aspect. - When you take on the job of helping beginners, it seems that they are silly underachievers and so on... This is also a pedagogical peculiarity. - Those who ask can not and do not know, and most of them can not even ask the right question, because the correct question is 70% of the answer. - This is normal and should be so by definition. So I have great respect for those who took on this difficult and patient job. Thank you very much! : )) )

Regarding lines - I meant any lines: at least horizontal ones.

That is, if I set some horizontal line, is it possible to write comments to it, which are written in case of placing an order: with ticket number and order type? Also, if we have such a clarifying question, are these comments different for different types of lines or will the method of placing such comments be similar (the same)? If there are, I would like to know these differences.

Thanks so much for the follow-up replies! I am very grateful for any help in this new for me case.To create a comment to a horizontal line , the same as to the order line, you need to use a text marker, to mark some point on the MA line you need to use text.




Comments are inserted with the help of graphical objects like text or text mark. The difference between them is that the first one is attached to a chart and its coordinates are set as time and price, i.e., when the chart changes, they move together with the chart. The second one is attached to the terminal window and its coordinates are set in pixels relative to the terminal corner. That is, when the chart is updated, the comment will remain in the same place. Depending on which lines we are talking about, either one or the other must be used to create a comment.To create a comment to a horizontal line as well as to an order line, it is necessary to use a text mark, to mark some point on the MA line, it is necessary to use text.
 

Thank you very much!

I've certainly been climbing and researching this topic, but without your hints I couldn't figure out the very dry Help documentation for the language by myself. And as I just started to learn programming with this language, it's still hard for me to "guess" (due to the same notorious loss of consistency) about the functionality of graphical objects properties. That's why I'm asking.

I understand the general direction - I will try it.

 
How do I get the meta-editor out of the glitch? Preferably without shutting down the computer, preferably saving the information - the last ten to fifteen lines that have not been compiled.
 
Chiripaha:

Thank you very much!

I've certainly been climbing and researching this topic, but without your hints I couldn't figure out the very dry Help documentation for the language by myself. And as I just started to learn programming with this language, it's still hard for me to "guess" (due to the same notorious loss of consistency) about the functionality of the properties of graphical objects. That's why I'm asking.

I understand the general direction - I will try it.


Good luck.
 
Dimka-novitsek:
How to get meta-editor out of glitch? Preferably without shutting down the computer, preferably by saving the information - the last ten fifteen lines that have not been compiled.


Press save instead of compile - I always do that in such cases.

P.S. You don't have to shut down the computer, just restart the terminal.