Questions from Beginners MQL5 MT5 MetaTrader 5 - page 552

 
Vitalii Ananev:
If you need rsi and stochastic in one indicator, it can be implemented by means of mql language. Contact the freelance service.
Not available. I will do it myself. THANK YOU.
 
Vitalii Ananev:

The condition for breaking through the level.

e.g. closing price of a candlestick

double Uroven; - level

if (Close[2]<Uroven && Close[1]>=Uroven) from the bottom upwards

if (Close[2]>Uroven && Close[1]<=Uroven) from top to bottom.

Thank you.
 

Hello, ran into this problem.

There is a condition in the program: if a variable (in which profit of certain orders is calculated) is smaller than the expression from several other variables, several functions will be executed next.

I will not describe at once exactly what and how it is calculated as it would be too much. Perhaps, the answer will be very simple because I do not know it:)

So, when executing the program this condition turns out to be true, when in fact the first variable is much larger than the other one (for example, I was outputting values - 146.3412 and 0.41 in the tester).

All variables in this condition are of type double and separately are calculated correctly.

Can you tell me what it may be related to?

 
Maria Baburina:

Hello, ran into this problem.

There is a condition in the program: if a variable (in which profit of certain orders is calculated) is smaller than the expression from several other variables, several functions will be executed next.

I will not describe at once exactly what and how it is calculated as it would be too much. Maybe, the answer will be very simple because I do not know it:)

So, when executing the program this condition turns out to be true, when in fact the first variable is much larger than the other one (for example, I was outputting values - 146.3412 and 0.41 in the tester).

All variables in this condition are of type double and separately are calculated correctly.

Can you tell me what it may be related to?

The solution really lies on the surface - here:Telepath Club
Клуб Телепатов (^_^) - MQL4 форум
Клуб Телепатов (^_^) - MQL4 форум
  • www.mql5.com
Клуб Телепатов (^_^) - MQL4 форум
 
Karputov Vladimir:
The solution really lies on the surface - go here:Telepath Club

Prerequisite:

if (ProfitSellDBL < (Profit_Upgr+(Tral_Start__Upgr-Tral_Size__Upgr)*TV*SumLotSellDBL)) CloseTriggerS_Upgrade=0;


ProfitSellDBL is calculated here

   for (i=totalsellDBL-1; i>=0; i--)
      {
      ReturnValueBool=OrderSelect(DoubleSell[i][0],SELECT_BY_TICKET);
      SumLotSellDBL+=OrderLots();
      j=i+totalbuyDBL;
      MassivDBL[j][0]=OrderProfit()+OrderCommission()+OrderSwap();
      MassivDBL[j][1]=DoubleSell[i][0]; 
      ProfitSellDBL+=MassivDBL[j][0];
      LastPriceSellDBL = OrderOpenPrice(); 
      LastLotSellDBL = OrderLots();      
      }

Profit_Upgr = 0.01

Tral_Start__Upgr is equated to an external variable of int type and equals to 5.

Tral_Size__Upgr is similarly equal to 4

TV - tick value, =10

SumLotSellDBL = 0.04

 
Vitalii Ananev:

The condition for breaking through the level.

e.g. closing price of a candlestick

double Uroven; - level

if (Close[2]<Uroven && Close[1]>=Uroven) from the bottom upwards

if (Close[2]>Uroven && Close[1]<=Uroven) from top to bottom.

Sorry, it does not work. I will describe it in a picture. The red broken line is an indicator, the blue lines are levels.

Condition for opening Buy: when the indicator crosses any level from bottom to top.

Condition for closing Buy (simultaneously open Sell): when the indicator crosses any level from top to bottom, except the one where the order was opened.

Sorry, I must be boring you already.

Files:
 
Maria Baburina:

Prerequisite:


ProfitSellDBL is calculated here

Profit_Upgr = 0.01

Tral_Start__Upgr is equated to an external variable of int type and equals to 5.

Tral_Size__Upgr is similarly equal to 4

TV - tick value, =10

SumLotSellDBL = 0.04

Horses and people mixed up...Type conversion
 
edutak:

Sorry, it doesn't work. I'll describe it in a picture. The red broken line is the indicator, the blue lines are the levels.

Condition to open Buy: when the indicator crosses any level from bottom to top.

Condition for closing Buy (simultaneously open Sell): when the indicator crosses any level from top to bottom, except the one at which the order was opened.

Sorry, I must be boring you already.

When it crosses from top to bottom, look at the opening price of the order and determine which line it crossed when it opened. Naturally, if the same line is crossed now, the order should not be closed.
 
Is it possible to put Balance and Equity charts on a currency pair window, working in Online mode? Where can I get the relevant software?
 
edutak:

Sorry, it doesn't work. I'll describe it in a picture. The red broken line is the indicator, the blue lines are the levels.

Condition to open Buy: when the indicator crosses any level from bottom to top.

Condition for closing Buy (simultaneously open Sell): when the indicator crosses any level from top to bottom, except the one at which the order was opened.

Sorry, I must be boring you already.

Instead of Close[2], put the indicator value on the second bar (for example iRSI(.......,2) ), and instead of Close[1] put the indicator value on the first bar. And uroven is the value of the level.

And the rest you have already been told above.