Errors, bugs, questions - page 949

 
Renat:
You have a strange attitude to terminal and resources.

The trading terminal has no task to save resources when its main task is to work effectively with huge amounts of data. Moreover, you can't complain that four copies of the number cruncher don't have enough gigabytes of memory in the VPS.

This is not the issue, but the different behaviour on Win2003x64 server (VPS) and Win7x64 Home.

http://file.karelia.ru/6v55j5/ the video on the link says that when starting the terminal, it consumes much more allocated memory than the operating system shows for this process.

 
olyakish:

This is not the issue, but the different behaviour on Win2003x64 server (VPS) and Win7x64 Home.

http://file.karelia.ru/6v55j5/ the video on the link says that when starting the terminal it consumes much more allocated memory than the operating system shows for this process.

Oh how everything is running.

Too long to explain and it has nothing to do with the terminal. Forget it and don't skimp on the VPS.

 
Renat:

Oh, how messed up it is.

Too long to explain and it has nothing to do with the terminal. Forget it and don't skimp on the VPS.

Maybe not so much.

For example, it may be that the terminal picks up third-party services that eat up more than the terminal itself. And on my laptop they're just initially at startup,

Then why is memory consumed similar to the first run of the terminal - it's enough to run the service once. (although it's debatable if the service can run threads for every copy of the terminal)

OK, I'll ask another way, if the server is 2008 on a VPN it won't have this effect if it's too long to explain.

 
olyakish:

Maybe not so much.

For example, it may be that the terminal picks up third-party services that eat up more than the terminal itself. On my laptop they're just initially at startup,

then why is the memory consumption similar to the first run of the terminal - the service only needs to run once. (although it is questionable if the service can start threads for each copy of the terminal)

Ok I'll ask another way, if the server is 2008 on pps it won't have that effect if it's too long to explain.

I have on VPS (Win XP) about 200 MB consumed by MT4 terminal.
 
Why not allow (with a tick in the settings) the terminal to use a cache swap? There will be a user-selectable speed/memory-loading trade-off.
 

...Seems like a simple operation, but the correct integer values in pips cannot be obtained. Here is the code of the script:

void OnStart() {
//---
   double max_price = NormalizeDouble(ChartGetDouble(0, CHART_PRICE_MAX), _Digits);
   double min_price = NormalizeDouble(ChartGetDouble(0, CHART_PRICE_MIN), _Digits);
   
   double entry_price, stop_price, profit_price;
   entry_price = NormalizeDouble((max_price+min_price)/2, _Digits);
   stop_price = NormalizeDouble(entry_price-(entry_price-min_price)/2, _Digits);
   profit_price = NormalizeDouble(max_price-(max_price-entry_price)/2, _Digits);
   
   int stop_pips = int((entry_price - stop_price)/_Point);
   int profit_pips = int((profit_price - entry_price)/_Point);
   
   Print("Entry: ", entry_price, ", Stop: ", stop_price, ", Profit: ", profit_price,
         ", Stop pips: ", stop_pips, ", Profit pips: ", profit_pips);
//---   
}

Here are the results of the run:

2013.03.29 16:42:03 Experiment_Script (EURUSD,H4) Entry: 1.29445, Stop: 1.28453, Profit: 1.30438, Stop pips: 991, Profit pips: 993
2013.03.29 16:41:57 Experiment_Script (GBPUSD,H4) Entry: 1.50465, Stop: 1.49348, Profit: 1.51583, Stop pips: 1117, Profit pips: 1117

It should be 992 and 993 (for EURUSD), 1117 and 1118 (for GBPUSD). Can you tell me how to get a correct result?

 
Rone:

...

Try dividing by 2.0 instead of just 2.

The result of an integer operation is an integer, and it does not affect that the result is written in double.

 
muallch: Why not allow (with a tick in the settings) the terminal to use a cache swap? There will be a user selectable speed/ memory load compromise.
Better to go straight to Service Desk with such questions. Otherwise they will get lost.
 
fyords: Try dividing by 2.0 instead of just 2.

No, that's not the problem. The divisible is a double.

The problem is most likely caused by these lines:

   int stop_pips = int((entry_price - stop_price)/_Point);
   int profit_pips = int((profit_price - entry_price)/_Point);
Rone:
Try printing the value "(entry_price - stop_price)/_Point" without rounding.
 

Please advise if anyone has encountered something like this.

There is a code:

//+------------------------------------------------------------------+
double date[];
//+------------------------------------------------------------------+
void OnInit()
{
   ArrayResize(date,3);
}
//+------------------------------------------------------------------+
void OnChartEvent(const int id,
                  const long &lparam,
                  const double &dparam,
                  const string &sparam)
{
   Print("ArraySize(date)=",ArraySize(date));
}
//+------------------------------------------------------------------+
It works in realtime in the terminal:
DH      0       12:39:43        test (EURGBP.m,M5)      ArraySize(date)=3
LN      0       12:39:43        test (EURGBP.m,M5)      ArraySize(date)=3
DG      0       12:39:43        test (EURGBP.m,M5)      ArraySize(date)=3
But in the tester the same code gives a different result:
MN      0       12:34:21        test (EURGBP.m,M15)     2013.01.02 07:59:59   ArraySize(date)=0
OG      0       12:34:21        test (EURGBP.m,M15)     2013.01.02 07:59:59   ArraySize(date)=0
IM      0       12:34:21        test (EURGBP.m,M15)     2013.01.02 07:59:59   ArraySize(date)=0
Reason: