Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1947

 
BIOs #:

Please advise where to "dig" about sending a signal when the price reaches the standard horizontal line on the chart to another device with the same account,

Thank you in advance, thank you

two terminals via DC server, share only trading status and account history.

if Alice wants to send a message to Bob, she puts out a pause.

or like dubrowski is looking for another duplo :-)

 

A question has arisen. The challenge. I have a deposit of $2,000 and a leverage of 100. The lot to be placed is 20% of the amount, i.e. $400 worth of lots. How to calculate stoploss level, so that the loss would be 50% for pairs of reverse quote eurusd, direct usdjpy and cross gbpchf.

And another question, contra T, in the asset tab we see the real amount of money in the deposit, but in the terminal can we see the amount of money with leverage and the leverage level?

It is clear that we can make a request and get everything.)))

 
Valeriy Yastremskiy #:

A question has arisen. The challenge. I have a deposit of $2,000 and a leverage of 100. The lot to be placed is 20% of the amount, i.e. $400 worth of lots. How to calculate stoploss level, so that the loss would be 50% for pairs of reverse quote eurusd, direct usdjpy and cross gbpchf.

And another question, contra T, in the asset tab we see the real amount of money in the deposit, but in the terminal can we see the amount of money with leverage and the leverage level?

It is clear that we can make a request and get everything)))

i can see the real amount of money on the deposit, leverage 100, margin level 60% (i need to know where the margin stake is). in the original message it is somehow absent. if i meant "deposit load", i.e. the use of the funds.

PS/ counts from the maximum possible to open and support a lot on the instrument. It's 100% of it you want to open 1/5 (use 20% of your funds) and from this volume, based on the price of the tick per lot, calculate the level of stop-loss

 
Maxim Kuznetsov #:

If you have a deposit of 2000, leverage 100, margin level of 60% (you have to know where the margin call is), it is somehow missing in the original message.

If you meant "deposit load", in other words, the use of funds. Heh, yes, exactly, I did not take into account that at 1100 somewhere by itself stops)))) at minimum lot 0.01, it turns out just 1000. Well, one can make a 30% loss. The question was about calculation of inverse and cross rates formulae. I do understand it with my mind, but I have to deduce formulas and sometimes I get them with errors))).

 
How to calculate deposit load in MT5 tester by code? It is Deposit Load Thank you!
 
Valeriy Yastremskiy #:

Heh, yes, exactly, I did not take into account that at 1100 somewhere will stop itself)))) with a minimum lot 0.01, it turns out just 1000. Well, one can make a 30% loss. The question was about calculation of inverse and cross rates formulae. I should understand with my mind, but I have to deduce formulas and sometimes I get them with errors.)

You have to take into account the point value

I can give you the code, but it will take you a long time to figure it out, it's big, also takes into account the maximum possible lot on the margin
 
Vitaly Muzichenko #:

You have to take into account the cost of the item

I can give you the code, but it will take a long time to understand it, it's big, also takes into account the maximum possible lot on the margin

If I can't do it, I'll ask questions))) Of course you have to take into account the point value and the formula is not a 2-step formula. I have difficulty in not fully understanding the terms, and testing the correctness of the assumptions takes time))) The value of the contract = the value of one lot in money day calculated))))

 

Good day, please advise how to return a value from a list of constants in the form of text.

For example, the HistoryDealGetInteger function returns the int value from theENUM_DEAL_TYPE list when requesting the event. How can we get information from the returned number that it is "DEAL_TYPE_CREDIT - credit accrual. Then after debugging this value will be of course not needed, int will be enough to process the event, but during debugging it is not clear at all what do the numbers 3 or 5 returned by the function mean.

Документация по MQL5: Константы, перечисления и структуры / Торговые константы / Свойства сделок
Документация по MQL5: Константы, перечисления и структуры / Торговые константы / Свойства сделок
  • www.mql5.com
Свойства сделок - Торговые константы - Константы, перечисления и структуры - Справочник MQL5 - Справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 
Кирилл Якимов #:

Good day, could you please tell me how to return a value as text from a list of constants.

For example, the HistoryDealGetInteger function returns the int value from theENUM_DEAL_TYPE list when requesting the event. How can we get information from the returned number that it is "DEAL_TYPE_CREDIT - credit accrual. Then after debugging this value will be of course not needed, int will be enough to process the event, but during debugging it is not clear at all what do the numbers 3 or 5 returned by the function mean.

string s = EnumToString((ENUM_DEAL_TYPE) x)

 
Maxim Kuznetsov #:

string s = EnumToString((ENUM_DEAL_TYPE) x)

Thank you very much, it helped.
Reason: