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

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Folks, help please. I want to write a function so that each next open order opens with a lot 2 times bigger than the previous one. This function is giving out wrong values... What is wrong with it? Thanks in advance!
extern double LotBuy = 0.01;
double GetLotBuy()
{
for(int n = 1; n<=CountBuy(); n++)
{
LotBuy=LotBuy*2;
}
return (LotBuy);
}
For starters:
extern double LotBuy = 0.01;
double GetLotBuy()
{
double ld_Lot = LotBuy;
for(int n = 1; n<=CountBuy(); n++)
{ld_Lot = LotBuy * n * 2;}
return (ld_Lot);
}
Folks, please help. I want to write a function so that each next open order opens with a lot 2 times the previous one. This function is giving out wrong values... What is wrong with it? Thanks in advance!
extern double LotBuy = 0.01;
double GetLotBuy()
{
for(int n = 1; n<=CountBuy(); n++)
{
LotBuy=LotBuy*2;
}
return (LotBuy);
}
Try this.
For a start:
extern double LotBuy = 0.01;
double GetLotBuy()
{
double ld_Lot = LotBuy;
for(int n = 1; n<=CountBuy(); n++)
{ld_Lot = LotBuy * n * 2;}
return (ld_Lot);
}
Are you kidding me?
Made an EA based on my own indicator.
Opening trades buy on the rise and sell on the fall of the indicator in relation to yesterday.
The problem is that trades open and close through a bar or more.
The indicator is set to ignore the movements on a certain set value.
If there is no excess, the indicator value remains as in the previous bar (I think the problem is somewhere here)
Indicator code:
EA trading criteria:
Hello!
A script like this is needed:
was
eur/gbp / 1 lot / open 312.25 / sl 559.45 / tp 454.55
yui/ghf / 1 lot / open 3.28 / sl 5.65 / tp 4.65
.../... / 1 lot / open ...... / sl ...... / tp .......
became
eur/gbp / 1.02 lot / open 312.25 / sl 559.45 / tp 454.55
yui/ghf / 1.02 lot / open 3.28 / sl 5.65 / tp 4.65
.../... / 1.02 lot / open ...... / sl ...... / tp .......
What would close pending orders with a certain volume (lot), and open a new order with another volume, but the same entry level, stop and take.
I don't know... Maybe someone has.
I don't understand anything here...
I want the lot size to increase geometrically (with a multiplier of 2) if a second unidirectional order is opened.
Are you joking?
The solution not infrequently consists of several "steps". The 1st step is to reduce the exponential growth of the lot size. At the same time we give at least some meaning to the use of the cycle. And since we do not know "where the beginning", the further steps are up to the author. ;)
This is, of course, wonderful, but still, how to express how to open the next one-directional order with lot twice more than the previous one? There are already two working functions CountBuy() and CountSell()
Here's the .cpp file of the project, have a look at it and after a couple of Google and Yandex searches, I didn't find anything at all brainy, it's generally understandable. It even seems simple.
But how does it work? I'm not quite sure how to refer to this ddl - from the EA's code? How? First, it looks like this #include <GetIntValue>.
2. When calling the dll, you don't have to keep studio on, right? how is it executed?
Please show the simplest example of calling this dll from mql code.