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

 
AlexeyVik:

Forget what you wrote next. Declare an array of appropriate type at global variable level arr[][][3] and define the second dimension by yourself.

Well, it's like this. And you will probably need to convert string indexes to integers.


THANK YOU VERY MUCH!!!! When one's brain boils, one becomes "blind" and fails to see the simple and obvious things. The most interesting thing is that you know the solution is simple, "like three kopecks", but, alas, it's a blur in front of your eyes.
THANK YOU again !!!!!
 
artmedia70:
You don't need to give stupid advice. This command will remove all objects from the chart altogether.

I do not agree with you!

There was a question:

How to delete all objects such as OBJ_ARROW_RIGHT_PRICE ?

Solution:

ObjectsDeleteAll(0,OBJ_ARROW_RIGHT_PRICE); //удалить все объекты типа "Правая ценовая метка" в главном окне графика

How is the solution stupid?

 
isn-88:

I do not agree with you!

There was a question:

Solution:

And why is the decision stupid?

By the fact that it will remove ALL objects. Even those that do NOT belong to the EA/indicator. What if a person has been markup his own code on a chart for a long time? And then he ran this code in a third-party indicator? How, and what would he then say about the author of this good code?
 
artmedia70:
How, and what does he then say about the author of this good code?


People are kind. They'll say whatever they think.
 
Vinin:

People are kind. They'll say what they think.
Yeah, Vitya... people are mean these days... It's sad.
 
isn-88:

I do not agree with you!

There was a question:

Solution:

And why is the solution stupid?

Actually it all started with command: ObjectsDeleteAll(0,OBJ_ARROW_RIGHT_PRICE) ;

and then another variant tried ObjectsDeleteAll(OBJ_ARROW_RIGHT_PRICE);

Dear Sir, read the help :)

I don't understand why my index with the mentioned commands works correctly in Alpha-Forex, but in Saxo Bank the objects are not deleted anymore.

Then I started experimenting with the script and the script stopped deleting objects in all terminals.

 

Salud to all !

Such an oddity of the tester is observed.

After closing orders 152, 153, 158 and 159 the profit is not correct (as if the tester calculated incorrectly). The orders have been "hanging" for several months as shown in the table. Besides, the drawdown is shown in the table correctly but it is not visible on the chart for some reason.

What can it be ?


EURUSD (Euro vs US Dollar)

15 Minutes (M15) 2012.01.01 23:00 - 2014.03.07 22:59 (2012.01.01 - 2014.03.08)

















1000.00



Spread

Current (12)

1418.73

Total profit

2045.28

Total loss

-626.55

3.26

Expected payoff

2.41



419.34

Maximum drawdown

834.91 (58.98%)

Relative drawdown

58.98% (834.91)


















test

Time

Type

Order

Volume

Price

S / L

T / P

Profit

Balance

372

2012.04.30 11:00

buy

151

0.01

1.32193

0.00000

1.32472


373

2012.05.01 04:45

t/p

151

0.01

1.3247234

0.00000

1.32472

2.75

1402.41

374

2012.05.01 15:00

buy

152

0.01

1.32262

0.00000

1.32713


375

2012.05.02 07:45

t/p

142

0.01

1.31949

0.00000

1.31949

-4.40

1398.00

376

2012.05.02 07:45

t/p

143

0.01

1.31949

0.00000

1.31949

0.95

1398.96

377

2012.05.02 07:45

t/p

149

0.02

1.31949

0.00000

1.31949

12.49

1411.44

378

2012.05.02 08:45

buy

153

0.01

1.31711

0.00000

1.32237


379

2012.05.02 08:45

modify

152

0.01

1.32262

0.00000

1.32237


380

2012.05.02 15:15

sell

154

0.01

1.31483

0.00000

1.31352


381

2012.05.03 07:00

t/p

154

0.01

1.3135174

0.00000

1.31352

1.18

1412.63

382

2012.05.03 08:45

sell

155

0.01

1.31454

0.00000

1.31425


383

2012.05.03 09:00

t/p

155

0.01

1.3142483

0.00000

1.31425

0.29

1412.92

384

2012.05.03 13:45

sell

156

0.01

1.31671

0.00000

1.31256


385

2012.05.04 10:45

t/p

156

0.01

1.3125581

0.00000

1.31256

4.11

1417.02

386

2012.05.04 14:15

sell

157

0.01

1.31527

0.00000

1.31293


387

2012.05.04 14:45

t/p

157

0.01

1.3129331

0.00000

1.31293

2.34

1419.36

388

2012.05.04 16:15

buy

158

0.02

1.30997

0.00000

1.31742


389

2012.05.04 16:15

modify

152

0.01

1.32262

0.00000

1.31742


390

2012.05.04 16:15

modify

153

0.01

1.31711

0.00000

1.31742


391

2012.05.06 23:15

buy

159

0.04

1.29845

0.00000

1.30918


392

2012.05.06 23:15

modify

152

0.01

1.32262

0.00000

1.30918


393

2012.05.06 23:15

modify

153

0.01

1.31711

0.00000

1.30918


394

2012.05.06 23:15

modify

158

0.02

1.30997

0.00000

1.30918


395

2012.09.14 10:45

t/p

152

0.01

1.30918

0.00000

1.30918

-18.67

1400.70

396

2012.09.14 10:45

t/p

153

0.01

1.30918

0.00000

1.30918

-13.12

1387.58

397

2012.09.14 10:45

t/p

158

0.02

1.30918

0.00000

1.30918

-11.65

1375.93

398

2012.09.14 10:45

t/p

159

0.04

1.30918

0.00000

1.30918

22.77

1398.70

 
VoDyaMon:

Actually it all started with command: ObjectsDeleteAll(0,OBJ_ARROW_RIGHT_PRICE) ;

and then I tried another variant: ObjectsDeleteAll(OBJ_ARROW_RIGHT_PRICE);

Dear Sir, read the help :)

I don't understand why my index with the mentioned commands works correctly in Alpha-Forex, but in Saxo Bank the objects are not deleted anymore.

Then I started experimenting with the script and the script stopped deleting objects in all terminals.

The first looks in the main chart window, the second in all. Conclusion - 1) Use window index to reduce the number of objects the function goes through to find the ones to be deleted. 2) If you delete by name (part of name, because one mql program usually names objects with some personal prefix), then use search loop from last (older by time of creation) object.

Although there is indeed a problem with deleting objects, if there are a lot of them and it goes from 0 to ObjectTotal()-1, then some of the objects are not deleted. Question to developers, maybe there is not enough buffer memory allocated.

Example:

void DeleteObjects(int chartID, string prefix_obj_name) {
   string obj_nm="";
   int obj=ObjectsTotal();
 //  for(int k=0; k<obj; k++){  // неправильный вариант
   for(int k=obj-1; k>=0; k--){
      obj_nm = ObjectName(k);
      if(StringFind(obj_nm,prefix_obj_name)>=0) 
      { 
         ResetLastError();
         if(!ObjectDelete(chartID,obj_nm))
         {
            Print(__FUNCTION__,
            ": не удалось удалить объект ",obj_nm," Код ошибки = ",GetLastError());
         }
      }
   }
}
// prefix_obj_name = "Obj_MQLname_";   Имена объектов создаваемых программой "Obj_MQLname_Close_"+DoubleToStr(Close[0],Digits), "Obj_MQLname_Open_"+DoubleToStr(Open[0],Digits)   и т.д. 
 
Can you tell me if Win 8 is compatible with MT 4 and MT 5? I'm asking because I have a mac and am wondering which OS to buy a PC with. One guy even showed me a screenshot of MT 4 running on 8. But since some comrades claim that there is no full compatibility, I have to clarify... Thanks.
 
nekadabra:
Can you tell me if Win 8 is compatible with MT 4 and MT 5? I'm asking because I have a mac and am wondering which OS to buy a PC with. One guy even showed me a screenshot of MT 4 running on 8. But since some comrades claim that there is no full compatibility, I have to clarify... Thanks.

Win 8 is compatible with MT 4 and 5.