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

 
Vodya:


Thank you.

But when compiling in this row.

it shows '(' - function definition unexpected.

and this '}'. - where the last return(0) is

Put functions at the end of code, outside start().

In the start() function write function calls:

 int start(){

  double Profit = Profit();
  double Loss =  Loss();

 return(0);}
And work with variables Profit and Loss.
 
charter:

Put the functions at the end of the code, outside of start().

In the start() function write function calls:

And work with Profit and Loss variables.

Thank you.
 
Please advise how to memorise the equity size? Before opening a position, you need to memorise the equity and after closing that position, compare the equity data.
 

Please advise, I need the High function to always work only with the opening bar

High[TimeHour(Time[0])- TimeHour(OrderOpenTime())]

will it return only the value of high from the opening bar, or can't I do calculations in High at all?

Logically, the difference between the current hour and the opening hour is inside, and the resulting number should determine the number of the opening bar

 
WindSW:
Please advise how to memorise the equity size? Before opening a position, you need to memorise the equity and after closing that position, compare the equity data.

Before opening a lot, give an equity value to any variable, and after closing it, give an equity value to another variable, and compare the two values at the end of all procedures
 
LazarevDenis:

Before opening a lot, give any variable its value, and after closing the lot, give another variable its value, and compare these two values at the end of all procedures.

And how to make them not reset?
 
WindSW:

How do you make them not reset?
Make them static or declare them globally
 

Hello, I have a question:

How do you determine in EURUSD (if it is moving upwards) whether the euro is rising or falling?

 
asimox:

Hello, I have a question:

How do you determine in EURUSD (if it is moving upwards) whether the euro is rising or falling?


This question is not asked here, it's a programming question, but I'll answer it, the first currency in the pair is the main one, in a relationship it is always the first, that is, the euro always = 1, and the second currency is called "something else" But the rate always determines how much of the second currency is needed to buy one unit of the first, if the rate rises, then you have to give more of the second currency for 1 unit of the first, and vice versa, if the rate falls, then less for 1 unit, if the rate rises, it is not clear from one figure, you need to compare several pairs.It is impossible to compare several currencies, as the euro can grow or the dollar can fall or vice versa, but the "number" will grow in all three cases.
 
asimox:

Hello, I have a question:

How do you determine in EURUSD (if it is moving upwards) whether the euro is rising or falling?

The topic has been moved to the new branch https://www.mql5.com/ru/forum/134852