[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 11

 
SeALALex:
Roman. It doesn't work, what's wrong?


So try it (I have it in abbreviated form) - the basis... All the opening checks, additional Prints will set themselves.

bool BuyTrue = true;                  
bool SellTrue = true;                  

int start()                           // Спец. функция start
  {
   if (A1>A2 && S1>30 && ADX1>ADX2 && BuyTrue == true) // Условие открытия позы в лонг
      {         
        SellTrue=true;         
        BuyTrue=false;   
        ticket=OrderSend(в лонг);                     
        Alert("Открываемся в лонг"); // Сообщение 
      }

   if (A1<A2 && S1<30 && ADX1<ADX2 && SellTrue==true) // Условие открытия позы в шорт
      {
        BuyTrue=true;         
        SellTrue=false;         
        ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,0,Bid-TakeProfit*Point,"AO sample",16384,0,Red);            
        Alert("Открываемся в шорт"); // Сообщение 
     }
 //--------------------------------------------------------------------
   return;                            // Выход из start()
  }
//--------------------------------------------------------------------
 

Roman. THANK YOU !!!! HUGE really worked out :-)

 
SeALALex:

Roman. THANK YOU !!!! HUGE really worked out :-)


I'm glad. :-)))
 
tol64:

3.3 If a position is opened via the Client Terminal using an Advisor, the Client cannot designate Stop Loss and/or Take Profit Orders. If the Client wishes to place these orders they can do so by modifying the existing position in accordance with clauses 5.16 - 5.22 and 9.13 - 9.16.

I am wondering if it is possible to check this programmatically. As I understand it, no. Originally, you should develop the function for opening positions/setting pending orders considering the conditions that have been established by your broker.

Those paragraphs (5.16-5.22, 9.13-9.16) don't contain conditions for modification? For example, not earlier than 10 min. Accordingly, this condition should be checked programmatically.

 
peshihod:

Do these paragraphs (5.16-5.22, 9.13-9.16) not specify conditions for modification? For example, not earlier than 10 min. Accordingly, this condition should be checked programmatically.

The Regulations specify everything)). And why 10 min later? Immediately after opening a position, set a stop-loss/stop-profit. It is unlikely that the connection will break unexpectedly and there is no back-up.))
 
Question: If the current Balance sheet is 15,000 and the current Funds are 8,000, if we close all positions at once - no matter how many we have - what will be the Balance sheet and the Funds?
 
alex12:
Question: If the current Balance sheet is 15,000 and the current Funds are 8,000, if we close all positions at once - no matter how many we have - what will be the Balance sheet and the Funds?

The Balance will be equal to the Means. Balance is 8,000, Funds are 8,000
 
tol64:

The Balance will become equal to the Means. Balance is 8000, Means is 8000.

Thank you. Could you write a formula - how to operate the calculations: Balance and Means?

All the same 7000 is somewhere gone from Balance (if Balance was = 15000 and Means = 8000).

I understand (so far blindly) that it is necessary to be guided by Means,

and that Balance is nothing or an illusion. But I do not understand it consciously.

 
Good evening, can you tell me where to find the error description?
 
nadya:
good evening, can you tell me where to find the error description?

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

https://docs.mql4.com/ru/trading/errors

Reason: