Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 14

 

Good afternoon . Need some help.

There are now 4 options in the EA //0//1//2//3// calculating a KM order
// Calculating the multiplier of a lot.
double GetMultiplier(double Koeff, int Method, int i, int j)
{
double res;
int y, z;

if (Koeff < 0) Koeff = 0;
if (i < j) y = 1;
else y = i - j + 1;
switch (Method) {
case 0:
// No progression
res = Koeff;
break;
case 1:
// Geometric progression
res = MathPow(Koeff, y);
break;
case 2:
// Arithmetic progression
res = Koeff * y;
break;
case 3:
// Fibonacci sequence progression
res = Koeff * GetFibo(y);
break;
}
return(res);
}

Can we add a calculation option like
case 4:
//calculate xxxxxxxx

which would calculate the lot volume in this scenario :

that the lot size of KM to be opened is calculated in such a way that the TP of previously opened orders (one or several) and TP = 5 of this order when modifying all these orders (total TP) is obtained = 6 to 10 pips. I.e. the TP of the increased order = 5 + (from 1 to 5) = 6 to 10 pips?

Thank you in advance for your reply.

 
ALEX-BAX:

Good afternoon . Need some help.

Right now my EA has 4 options //0//1//2//3// for calculating a KM order


Can I add a calculation option like
case 4:
//Calculate xxxxxxxx

which would calculate the lot size in this scenario :

that the lot size of KM to be opened is calculated in such a way that the TP of previously opened orders (one or several) and TP = 5 of this order when modifying all these orders (total TP) is obtained = 6 to 10 pips. I.e. the TP of the increased order = 5 + (from 1 to 5) = 6 to 10 pips?

Thank you in advance for your reply.


I just need to make up the formula and add it. And use SRC to insert the code
 
Vinin:

All that's left to do is to make up the formula and add it. And use SRC to insert the code.

I'd be happy to, but I'm not very good at programming. Can anyone help me?
 
ALEX-BAX:

I'd love to, but I'm not very good at programming. Can anyone help me?

Did you learn arithmetic at school? Programming has nothing to do with it. Simple proportions, nothing more.
 
Vinin:

Did you study arithmetic at school? It has nothing to do with programming. Simple proportions, nothing more.


x=Lot_KM;

y=Lots_openOrders;

x>y;

TP_KM=5;

TP_openOrders+TP_KM=?? =openPrice+5pp;

I know it is written absurdly, but I don't know how to explain it in another way.

What do you advise?

 
ALEX-BAX:


x=Lot_KM;

y=Lots_openOrders;

x>y;

TP_KM=5;

TP_openOrders+TP_KM=?? =openPrice+5pp;

I know it's written absurdly, but I don't know how to explain it in another way.

Please, advise.


First, we have to replace all of the open orders with a single aggregate order, a position.

This position will be characterized by the total volume and the total profit (loss). There are some more parameters, e.g. the aggregate opening price.

Then we can solve the problem.

 
Vinin:


To start with we need to replace all open orders with a single aggregate order, a position.

This position will be characterised by total volume and total profit (loss). There are some more parameters, e.g. the aggregate opening price.

Then we can solve the problem.


Can you suggest how to write it? - "By total volume and total profit (loss). "

And what does "cumulative opening price" mean?

 

Hello. I have created a simple indicator using the iclose function which forcibly calls several currency pairs

iClose("GBPUSD",0,i);

iClose("AUDUSD",0,i);

and it does work, but I observe the following glitch:

I attach the indicator to a symbol window, which is forcibly prescribed - it draws. I attach it to the window of another symbol that appears in the indicator - it doesn't draw it on the same timeframe (but if you move the cursor it writes the values). So, if it's calculating one-minute, one-hour and one-week values on GBPUSD, it won't display them on AUDUSD, but will only draw on five-minute, fifteen-minute, etc.


If I change the currency pair in the chart to another one, for example, AUDNZD, it works properly and changes everything. Please help me, I am a beginner - that's why I am writing here (I just read the MQL4 tutorial)

 
ALEX-BAX:


Can you tell me how to write this? - "total volume and total profit (loss). "

And what does "aggregate opening price" mean? )

Cumulative volume = sum of lots of all open market orders; consequently, total profit (loss) = sum of the profits (losses) of all those orders.

Total open price = the average open price of all open market orders.

 
artmedia70:

Total volume = sum of lots of all open market orders; accordingly total profit (loss) = sum of profits (losses) of all those orders.

Total open price = the average open price of all open market orders.




I do not understand anything (I mean, how can we put it in words)?
Reason: