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

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
edyuson:
sergeev:Как зделать, чтоб не сразу умножал, а скажем через два-три раза? Пример: лот=0,01, еще - 0,01, еще - 0,01 и только после умножать. Подскажите, если не много возни. Спасибо.
make an int counter and add +1 at each opening.
Once the correct counter value is set, allow to do lot*koef as well.
Yes, it's not as easy as I thought, now it's starting to occur. And the cycle: lot-0.01, lot-0.01, lot-0.01 and only after multiplying lot-0.02, lot-0.02, lot-0.02 further: lot-0.04, lot-0.04, lot-0.04 .... should be interrupted by profit and continue with lots. There were some variants from the guys on the other forum about this: You could declare double koef[]={ 1.0, 2.0, 1.0, 1.0, 1.0, 1.0, 2.0, 1.0, 1 . 0, 1.0, 2.0 .......} - as an array, filling it with the required coefficients, and a static or global variable int k=0;
Then lot=lot*koef[k++]; Starting series: k=0;
and such:
int k = 1;
int koef = 3;
if (k/koef == k) { lot*=2; k++; } but everything is wrong.
I tried a counter like: int j;
for(j=0; j<15; j++)
, but again it is not the same. Here it is all:
int X=0;
double S = 0.0000;
extern double lot=0.01;
extern double koef=2.0;
extern int SL=30;
extern int TP=120;
double dl;
double a;
int init()
{
a=lot;
return(0);
}
int deinit()
{
return(0);
}
int start()
{
if(OrdersTotal() == 0 && X==1)
{
if (Close[0]>dl){lot=a;}
X=0;
}
if(OrdersTotal() == 0 && X==2)
{
if (Close[0]<dl){lot=a;}
X=0;
}
if (OrdersTotal() == 0 && Close[1]>Open[1])
{
dl=Close[0];
OrderSend(Symbol(),OP_BUY,lot,Ask,3,Ask-SL*0.0001,Ask+TP*0.0001,",14774,0,Blue);
//--------------------------------------------------------------------
lot=lot*koef;
X=1;
}
if(OrdersTotal() == 0 && Close[1]<Open[1])
{
dl=Close[0];
OrderSend(Symbol(),OP_SELL,lot,Bid,3,Bid+SL*0.0001,Bid-TP*0.0001,",14774,0,Red);
//sudy some haler may help
lot=lot*koef;
X=2;
}
}
return(0);
//It's just a martin
Thanks, but look, there are two prices, one is the opening price of the order, and the other is the stop loss price, the number of points to the stop loss and the price of the point are known. How do I calculate the lot size so that the loss would be 10% of the deposit if the price reaches stop loss? I am just not good with figures.
I also do not understand
For cross rates, the point value, expressed in dollars, is calculated by the formula
PIP = LOT_SIZE * TICK_SIZE * BASE_QUOTE / CURRENT_QUOTE,
where LOT_SIZE is the lot size, TICK_SIZE is tick size, BASE_QUOTE is the current quote of base (first) currency to US dollar, CURRENT_QUOTE is the current rate of the pair.
How do you understand this first currency to US dollar?
Yes... tight... :-)
the base (first) currency to the US dollar, is, in the example GBP to JPY - GBP/JPY, would beGBP/USD
I redid this script, which is what you need with the calculation of the traded position volume depending on the amount of capital and stop-loss size.
You also need it - "I faced a problem and I have been struggling for three days already and cannot solve it. In the finished Expert Advisor I decided instead of a lot to enter the % risk, so I need to calculate the lot to stop, for example at 10 000 depo the risk of 1% at a stop of 100 points it will be about 0.1 lot and here at 200 lot stop the lot should be 0.05, so the 1% risk has remained at the same level. I hope everything is clear. And here you are writing:
"How do I calculate the lot size so that the loss would be equal to 10% of the deposit, for example, if the price reaches a stop loss? I'm just not good with numbers. "
So I modified the lot calculation function from the tutorial - its description and approach is the same, only instead of lot calculation by percentage of deposit size, the traded lot is calculated exactly by your (given by me in this example - see script, link above) conditions:
I tried this method. Now during the whole testing period one pending STOPLOSS order has opened and that's it...maybe my terminal is glitchy?
The program is supposed to find maximum and minimum prices every day, from 7 to 9 am and put a stop order at these levels.
I tried this method. Now during the whole testing period one pending STOPLOSS order has opened and that's it...maybe my terminal is glitchy?
Hello.
Has anyone had any problems with the function
IsDemo()
?
I always get 1 result - that the account is real (no matter if it is real or demo).
Hello.
Has anyone had any problems with the function
?
I always get 1 result - my account is real (no matter if it is real or demo).
I put an EA on a chart with a code on a demo account:
Writes in the magazine: "This is a demo.I have a demo account with an EA with code on the chart:
It writes in the log: "This is a demo.I have a demo on a phibogroup - for some mysterious reason it says I'm on a real account. In your version it shows - This is not a demo.
It turns out that somehow the DC itself is perverted
I have a demo on phibogroup - for some mysterious reason it says I'm on real. In your version of the picture - It's not a demo.
It turns out that somehow the DC itself has become perverted
Some brokers have one server for both demo and real. Check with your broker's support department.
Thank you.