Deleting arrows on chart

 

How does one delete arrows on the chart with MT 4?

I have tried ObjectDeleteAll(0,0) and that deletes the vertical lines but not the buy and sell arrows.

 
BluePearl:
How does one delete arrows on the chart with MT 4? I have tried ObjectDeleteAll(0,0) and that deletes the vertical lines but not the buy and sell arrows.

Hi BluePearl,

Select them with a left click and then right click and choose "Delete." (You can also choose "delete all selected," if more than one)

moneyline

 
BluePearl:
How does one delete arrows on the chart with MT 4? I have tried ObjectDeleteAll(0,0) and that deletes the vertical lines but not the buy and sell arrows.

Try this:

for(int i=0;i<ObjectsTotal();i++)

{

if(ObjectType(i) == OBJ_ARROW)

ObjectDelete(ObjectName(i));

}

 

deletin all

hi,

i was about to ask the sme question.

Can someone make a code to delete all items(objects) from the chart that are not from the last day or maybe to choose how many days back to be left?

I have 6 charts open at same time with max bars in history with bunch of objects and i think it is slowing my computer pretty much.

 
deepdrunk:
hi,

i was about to ask the sme question.

Can someone make a code to delete all items(objects) from the chart that are not from the last day or maybe to choose how many days back to be left?

I have 6 charts open at same time with max bars in history with bunch of objects and i think it is slowing my computer pretty much.

This should work but I didnt test it:

datetime currentDay = StrToTime(Year()+"."+Month()+"."+Day()+" 00.00");

for(int i=0;i<ObjectsTotal();i++)

{

if(ObjectType(i) == OBJ_ARROW && ObjectGet(ObjectName(i),OBJPROP_TIME1)>currentDay)

{

ObjectDelete(ObjectName(i));

}

}

 

ths Kalenzo but can you make an script of it or what ever we need to get this work ?I am still learning mql4 and it would take me lot of time to make it work.

This code is verry clear to me but i still can't be sure how to implement it and i dont have to much time.

 
deepdrunk:
ths Kalenzo but can you make an script of it or what ever we need to get this work ?I am still learning mql4 and it would take me lot of time to make it work. This code is verry clear to me but i still can't be sure how to implement it and i dont have to much time.

Ye the time is the biggest problem, but ye, when I will find some I can make such a script.

 
BluePearl:
How does one delete arrows on the chart with MT 4? I have tried ObjectDeleteAll(0,0) and that deletes the vertical lines but not the buy and sell arrows.

Well, there are 2 things you can do:

1) If you don't want your trades to show on chart:

a)Tools -- Options -- Charts -- Show Trade Levels (Undo)

2)If you want them on your chart, then simply delete after trade:

a)right click on chart select Objects List, find arrows and delete. or;

b)click on the arrows/checkmarks button near the "T" up on the tool bar, select "delete all arrows"

 
BluePearl:
How does one delete arrows on the chart with MT 4? I have tried ObjectDeleteAll(0,0) and that deletes the vertical lines but not the buy and sell arrows.

Another way do not see it on the chart, but still see it when testing

color SellColor = Red, BuyColor = Blue, SlColor = Yellow;

if (!IsTesting())

{

SellColor = CLR_NONE; BuyColor = CLR_NONE; SlColor = CLR_NONE;

}

if (Buy){

if(StopLoss==0){SL=0;}else{SL=Ask-StopLoss*Point; if (FractalLow>0) SL = slBuy;}

if(TakeProfit==0){TP=0;}else{TP=Ask+TakeProfit*Point;}

Print("About to open buy order. S/L ",SL, " Fractal = " , FractalLow);

OrderSend(Symbol(),OP_BUY,lots,Ask,1,SL,TP,OrderCmt,IDT,0,BuyColor);

}

if (Sell){

if(StopLoss==0){SL=0;}else{SL=Bid+StopLoss*Point;if (FractalHigh>0) SL = slSell;}

if(TakeProfit==0){TP=0;}else{TP=Bid-TakeProfit*Point;}

Print("About to open sell order. S/L ",SL, " Fractal = " , FractalHigh);

OrderSend(Symbol(),OP_SELL,lots,Bid,1,SL,TP,OrderCmt,IDT,0,SellColor);

}

 
deepdrunk:
ths Kalenzo but can you make an script of it or what ever we need to get this work ?I am still learning mql4 and it would take me lot of time to make it work. This code is verry clear to me but i still can't be sure how to implement it and i dont have to much time.

Here U go - put this in your script directory and compile. This script removes all type of objects from previous days.

Enjoy!

Files:
 

Kalenzo i compiled this scrtipt but it does not delete anything from the chart.

I also try to refresh the chart after executing the script but i only get alert that objects are deleted and they ar not.

#property copyright "Kalenzo"

#property link "bartlomiej.gorski@gmail.com"

//+------------------------------------------------------------------+

//| script program start function |

//+------------------------------------------------------------------+

int start()

{

while(remObj()==false){}

Alert("All objects from previous days was removed");

return(0);

}

//+------------------------------------------------------------------+

bool remObj()

{

datetime currentDay = StrToTime(Year()+"."+Month()+"."+Day()+" 00.00");

for(int i=0;i<ObjectsTotal();i++)

{

string name = ObjectName(i);

if( ObjectGet(name,OBJPROP_TIME1) < currentDay && ObjectGet(name,OBJPROP_TIME2) < currentDay && ObjectGet(name,OBJPROP_TIME3) < currentDay) {

ObjectDelete(ObjectName(i));

return (false);

}

}

return(true);

}

i guess this line of code is wrong as you are comparing OBJPROP_TIME1 with currentDay witch is Y+M+D...same with OBJPROP_TIME2 AND 3

i tryed to change the code a litle to get time 1,2,3 in one variable but it is showing the error "incopatible types"

datetime objdate = ObjectGet(name,OBJPROP_TIME1) + "." + ObjectGet(name,OBJPROP_TIME2)+ "." + ObjectGet(name,OBJPROP_TIME3);

//if( ObjectGet(name,OBJPROP_TIME1) < currentDay && ObjectGet(name,OBJPROP_TIME2) < currentDay && ObjectGet(name,OBJPROP_TIME3) < currentDay)\\

if (objdate < currentDay)