Questions from a "dummy" - page 149

 
alph:
Thank you! Is the rest of the code correct?


Honestly, I haven't looked at it. If Yedelkin hadn't paid attention to the function, I wouldn't have been interested in the code.

As I understood from the description of the situation there are also problems with error handling.

 
Interesting:


Honestly, I haven't looked at it. If Yedelkin hadn't paid attention to the function, I wouldn't have been interested in the code.

I understand from the description of the situation that there are also problems with error handling.

I'll have a look, do you mind if I use what I've got tomorrow?
 
alph:
I'll have a look, do you mind if I use what I've got tomorrow?
If it's not me, someone will help.
 
Interesting:
If it's not me, someone will help.
THANK YOU!
 

Hello!

Can you tell me the code to bind StopLoss to a local low (high)?

 

Can you tell me how to delete owner-only objects?

Tried this:

#define def_ID "LPS_1M"

void OnDeinit(const int reason)
{
   s_indy.S_DeleteObjects(0, 0, -1, def_ID);
}

void S_Indy::S_DeleteObjects(int i_chart_id, int i_nwin, int i_type, string s_ID_Objects)
{
string s_ObjectName;

   Print(ObjectsTotal(i_chart_id,i_nwin,i_type));
   for (int i = 0; i < ObjectsTotal(i_chart_id,i_nwin,i_type);i++){
      //s_ObjectName = ObjectName(i_chart_id,i,i_nwin,i_type);
      s_ObjectName = ObjectName(i_chart_id,0,i_nwin,i_type);
      Print("s_ObjectName: "  + s_ObjectName);
      if (StringFind(s_ObjectName, s_ID_Objects) != -1){
         ObjectDelete(i_chart_id,s_ObjectName);
      }
   }
}

But not all objects 5 of 9 are deleted:

2012.05.16 13:26:34 i_Find_Line_M_02 (EURUSD,H1) s_ObjectName: LPS_1M_Line_Max_4_
2012.05.16 13:26:34 i_Find_Line_M_02 (EURUSD,H1) s_ObjectName: LPS_1M_Line_Max_3_
2012.05.16 13:26:34 i_Find_Line_M_02 (EURUSD,H1) s_ObjectName: LPS_1M_Line_Max_2_
2012.05.16 13:26:34 i_Find_Line_M_02 (EURUSD,H1) s_ObjectName: LPS_1M_Line_Max_1_
2012.05.16 13:26:34 i_Find_Line_M_02 (EURUSD,H1) s_ObjectName: LPS_1M_Line_Max_0_

2012.05.16 13:26:34 i_Find_Line_M_02 (EURUSD,H1) 9

What am I doing wrong??????

 
pusheax:
   for (int i = 0; i < ObjectsTotal(i_chart_id,i_nwin,i_type);i++){
The list changes when you delete it. It is the same with warrants.

The other way over).

   for (int i = ObjectsTotal(i_chart_id,i_nwin,i_type)-1; i >= 0 ;i--){
 
for (int i = 0; i < ObjectsTotal(i_chart_id,i_nwin,i_type);i++)

this cycle is wrong.

ObjectsTotal

you have it taken at each iteration. it will be decreasing.

 

pusheax:

But not all objects 5 out of 9 are removed:

According to your technology, exactly that many should be deleted. :)
Swan:
When deleted, the list changes. It is the same with the warrants.

The other way over)

   for (int i = ObjectsTotal(i_chart_id,i_nwin,i_type); i >= 0 ;i--){

Small correction:

   for (int i = ObjectsTotal(i_chart_id,i_nwin,i_type) - 1 ; i >= 0 ;i--){
 
Swan:
The list changes when you delete it. Same with the orders.

The other way over)

Thank you it's all working!

How does it change?

Can you tell me how it all happens in there?
Reason: