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

 
Good afternoon ! Mt4 is not installing, terminal.exe gives error ( terminal.exe - error detected, application will be closed) at the end of the terminal loading ! The hardware is old - Microsoft Windows XP Professional 2002 service pack 3, Intel(R) Celeron(TM) CPU 1200 MHz 1.20 GHz. 384 MB RAM-, but until the new year (November-December) was installed all right, and now no way, with instaforeks (version 5.0.0.804) Load and then gives an error from other sites at all is not loaded anything ! I've already deleted my antivirus and remotely deleted previous terminals via Revo Unistaler. Perhaps that is because I recently stopped some local services (which do not remember) ???
 
Vladon:

how is that?

and this:

will never be fulfilled.

therefore:

will always work with every order.

CONCLUSION: everything is wrong.

Your function needs to be thought through, I don't have a quick answer.

But at least it's like this to start with:

I'm just learning, that's why I don't know much. I want to write a function to close orders on the percentage of the deposit. i tried your version. it closes only the positive profit, but how to make it close the negative profit, that is, not profit. i can not understand the logic operators that can be used in this function ?
 
che07:
Good afternoon ! Mt4 is not installing, terminal.exe gives error ( terminal.exe - error detected, application will be closed) at the end of the terminal loading ! The hardware is old - Microsoft Windows XP Professional 2002 service pack 3, Intel(R) Celeron(TM) CPU 1200 MHz 1.20 GHz. 384 MB RAM-, but until the new year (November-December) was installed all right, and now no way, with instaforeks (version 5.0.0.804) Load and then gives an error from other sites at all is not loaded anything ! I've already deleted my antivirus and remotely deleted previous terminals via Revo Unistaler. Perhaps that is because I had recently stopped some local services (which do not remember) ???
Your processor probably doesn't support SSE2 command set - check it
 
artmedia70:
Your processor probably does not support the SSE2 command set - check


How do I do that?
 
denis77515:
I want to use close orders as percentage of deposit, I already tried your version, it only closes positive profits, but how to make it close negative profits, i.e. not profits?


Ok

I am a beginner, i do not know much.

extern double Percent = 2.0;
extern int Slippage = 2;
double stop;

void OnStart()
{

if (Digits == 3 || Digits == 5)
{
Slippage *= 10;
}

for(int i = OrdersTotal()-1; i>=0; i--)
{
if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
{
if (OrderSymbol() == Symbol()) 
{
if (OrderType() == OP_BUY || OrderType() == OP_SELL)
{
if(OrderProfit()<=0-AccountBalance()/100*Percent && OrderProfit()<0)

{
if(OrderType() == OP_SELL)OrderClose(OrderTicket(),OrderLots(),Ask,Slippage,Aqua);
if(OrderType() == OP_BUY)OrderClose(OrderTicket(),OrderLots(),Bid,Slippage,Aqua);
}//if(ostop<=AccountBalance())
}//if(ostop==AccountBalance()/100*Percent)
}//if (OrderSymbol() == Symbol() )
}//if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
}//for(int i = OrdersTotal()-1; i>=0; i--)
return;
}//void OnStart()
//+-----------------------------------------------------------------
 
Vladon:


OK

everyone's learning, so that's fine.


Thank you so much, it's working.
 
artmedia70:
Your processor probably does not support the SSE2 command set - check


Yes, it does, but why was it working a couple of months ago? So do you have to replace the computer or what?
 
there's no way I can figure it out - it's a number:
8,01129039727145009060093343395e+8328
if the number is: 8.01129039727145009060093343395e+8328
as: 1 and 8328 zeros immediately after the one ( without the comma ) and multiply by 8 - would this be correct ?
or is there another way to read the number ?

I can't figure it out because I'm confused by the comma after 8.

Or another way, how to read 8,01129039727145009060093343395e+8328 as a whole number, so that this number will be comma-free.

Note: the digits following the comma from the above number can be represented as zeros.

 
che07:

Yeah, it doesn't, but why was it working a few months ago? So do we have to change the computer or what?

Do you know how many years ago this set of commands came about? Of course, your grandfather was still saving the bunnies from the flood.

 
There are two indicators Ind_1 and Ind_GV. The Ind_GV indicator differs from Ind_1 in that it receives one of the setting values from the global variable of the client terminal.
When Ind_1 and Ind_GV settings match, Ind_GV has a slightly different result value than Ind_1.
If I pause the tester while Ind_1 and Ind_GV are matched and compile Ind_GV, the resulting value of both indicators matches completely.
Who knows how this can be explained?
Reason: