Displaying Graphic characters on the graph.

 
Hi I tried to modify this simple program to display an UpArrow at three places ( times) depending upon the if condition. It works partly and displays one arrow when i run it offline in simulated mode. But does not work at all when online. Please can someone point the mistake and show me what i shud do to display all three UpArrows. Thanks.
Files:
simple.mq4  3 kb
 
   ObjectCreate("Obj_Arrow", OBJ_ARROW, 0, Time[count], Bid+0.02); //draw an up arrow
You are counting ticks but Time[count] is 200 bars ago. If you mean to put the arrow at the current tick use TimeCurrent().
 
WHRoeder:
You are counting ticks but Time[count] is 200 bars ago. If you mean to put the array at the current tick use TimeCurrent().

ok thanks but please explain how wud i translate the 5 bars ago, 25 bars ago and generally n bars ago into the right time using TimeCurrent(). Can u expolain it for at least one and also wud i need to redraw the Arrows each time the graph moves to accommodate the new bar ? If so then how ?
 
ok thanks but please explain how wud i translate the 5 bars ago, 25 bars ago and generally n bars ago into the right time using TimeCurrent(). Can u expolain it for at least one and also wud i need to redraw the Arrows each time the graph moves to accommodate the new bar ? If so then how ?
 
can anyone look into this and help ? thanks.
 
ObjectCreate("Obj_Arrow", OBJ_ARROW, 0, TimeCurrent(), Bid+0.02); //draw an up arrow
 
Ohhh is it that simple !! Actually i cud not figure out the working of TimeCurrent() and i a still not sure of that but i will modify my code accordingly and try again. Thanks loads.
 

WHRoeder:

Hi ! i tried what you suggested but the result is the same. Offline i get only the first UpArrow like i got before when i was using time[count] function. But when the program is running online, not a single UpArrow is displayed. I replaced your line of code with mine and removed the count variable since that is not needed. Still no result. Can anyone please help / suggest. Such a simple thing like dispalying Graphical Objects on a chart can be so difficult ???? Thanks !

Hi ! i tried what you suggested but the result is the same. Offline i get only the first UpArrow like i got before when i was using time[count] function. But when the program is running online, not a single UpArrow is displayed. I replaced your line of code with mine and removed the count variable since that is not needed. Still no result. Can anyone please help / suggest. Such a simple thing like dispalying Graphical Objects on a chart can be so difficult ???? Thanks !


 
Not difficult at all. But, you're counting ticks, how far do you think the market moved in 5 ticks? maybe no where, so your second arrow is on top of your first.
 
WHRoeder:
Not difficult at all. But, you're counting ticks, how far do you think the market moved in 5 ticks? maybe no where, so your second arrow is on top of your first.

hi !! not true ! the 5 minute tick is the first uparrow for one. Secondly the 25th tick may overlap but the 100th tick wud definitely be in another minute zone. or bar. so at least that should have shown up. besides i tried it with greater intervals but still just one Uparrow. Same as whay i got earlier. kindly luk into it again.

thanks

 
  1. 100th tick wud definitely be in another minute zone

    Turn on the volume (control-L) On the EURUSD M1 chart I see an Average Volume of 100 with an Average True Range of 3 pips.

  2. When to you reset the counter?
Reason: