How to Draw a Reference Lines Every 10 Pips - page 3

 
WHRoeder:
  1. MisterDog:
    Tell me, is there way to use some sort of a "wildcard" for things like the ObjectDelete? I would like to do something like this, ObjectDelete("tensLines"*); in other words, delete anything that starts with "tensLines".
    Not compiled, not tested.

  2. Also there's no reason to delete them, just move them to the new position. From my code:

  3. RaptorUK:
    Why not add PERIOD_W1 * 60 to the end time ? that should just about cover any gaps . .. ;-)
    Why not just project the rectangle all the way into the future?
I like RaptorUK's approach. I think there is no "wildcard" feature for deleting objects like you describe. I think you need to go through a loop using ObjectDelete. But also check out ObjectsDeleteAll. I have a script that clears everything off the screen.
 
I dislike ObjectsDeleteAll() immensely . . . I don't want someone's Indicator to delete MY objects . . . it can happily delete it's own but leave mine alone !
 
RaptorUK:
I dislike ObjectsDeleteAll() immensely . . . I don't want someone's Indicator to delete MY objects . . . it can happily delete it's own but leave mine alone !
Ah yes, understood, you don't like being greedy, so ObjectDeleteAll() == Greedy, right ?
 
onewithzachy:
Ah yes, understood, you don't like being greedy, so ObjectDeleteAll() == Greedy, right ?
No really greedy, just a pain in the neck that happens when least expected. :-(
 
WHRoeder:
  1. Also there's no reason to delete them, just move them to the new position. From my code:

  2. RaptorUK:
    Why not add PERIOD_W1 * 60 to the end time ? that should just about cover any gaps . .. ;-)
    Why not just project the rectangle all the way into the future?

Could anybody who already put these code snippets together to make the horizontal price bars post their version here pls?
I did used to code C language and can kind of understand whats in the code ,but not familiar with most of the include library in MT and Im getting stuck.

 
deansi:

Could anybody who already put these code snippets together to make the horizontal price bars post their version here pls?
I did used to code C language and can kind of understand whats in the code ,but not familiar with most of the include library in MT and Im getting stuck.

That's the best way to learn . . .  out of necessity.
 

If i wanna make this indicator start at euro open time and calculate from that open 13 pips up and down, maybe we can use trend lines and make it start at euro open and ends at America close.anyone can help with that?

 

Anyone else got this to work that can help?

spent another half day on it, and can so far get a rectangle that has 3 things wrong with it. :|

 WHRoeder wrote:

  1. Why not just project the rectangle all the way into the future?
    #define INF 0x6FFFFFFF // Not quite infinite, Jul 2029, or 1,879,048,191
    ObjectSet("tensRec"+ix,OBJPROP_TIME2,INF);
    my indicator doesnt project to the right of the current candlestick [at all] using any of: 0x6FFFFFFF, -100, +100, -1, +1
    Also if I zoom out on the graph too far [maybe showing 500-1000 candles] the grey bar completely disappears to the right of the first candle.!


        Here is the rectangle create and move parts of my code:
    I know it still needs a lot to make it complete but just trying to get the basics of creating 1 rectangle where I want it and continue making the rest of the code from there 
          ObjectCreate("Rect02", OBJ_RECTANGLE, 0, Time[0], Bid, Time[Bars], (Bid+0.0010) ); //make bar above cur price
          ObjectSet("Rect02", OBJPROP_COLOR, Silver );
          }
    //================= Move the Rect with new ticks/candles ===========================
       
       else {
          ObjectMove("Rect01", 0, Time[0], WindowPriceMin()*0.95);
          ObjectMove("Rect02", 0, Time[0], Bid);
            }  
 

Result looks like this:

 BarTest

 

Write WHRoeder code on top of your CI and change your Time [0] to INF

#define INF 0x6FFFFFFF // Not quite infinite, Jul 2029, or 1,879,048,191
Reason: