• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • User/Email: Password:
  • 9:53pm
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 9:53pm
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Printable Version

Similar Threads

Gapping on a live account 7 replies

Stupid problem - object not at exact level. 5 replies

Custom Indicator not Drawing Properly? 0 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe

Arrow Object not Gapping properly

  • Post #1
  • Quote
  • First Post: Edited Mar 25, 2010 12:31am Mar 24, 2010 11:14pm | Edited Mar 25, 2010 12:31am
  •  decidence
  • | Joined Sep 2009 | Status: Member | 71 Posts
I'm creating arrows for swing highs and lows and for some pairs they are created with a gap between bar and arrow as intended but for other pairs the arrow ends up showing up right at the tip of the bar.

Inserted Code
int init()
{  
   DeleteAllObjects();
   
   // Setup Arrow Drawing Buffers
   IndicatorBuffers(2);
   
   SetIndexStyle(0, DRAW_ARROW, EMPTY, 1, White);
   SetIndexStyle(1, DRAW_ARROW, EMPTY, 1, White);
   
   SetIndexArrow(0, 233);
   SetIndexArrow(1, 234);
   
   SetIndexEmptyValue(0, 0.0);
   SetIndexEmptyValue(1, 0.0);
   
   SetIndexBuffer(0, UpArrowBuffer);
   SetIndexBuffer(1, DownArrowBuffer);
   
   return(0);
}

void CalculateHighsLows()
{
   ...
   ...
   ...

   DownArrowBuffer[i] = currentBarLow - Point * 100;

   ...

   UpArrowBuffer[i] = currentBarHigh + Point * 100;

   ...
   ...
   ...
}
  • Post #2
  • Quote
  • Mar 25, 2010 1:00am Mar 25, 2010 1:00am
  •  CodeMeister
  • Joined Sep 2009 | Status: Making Code While Making Pips | 1,672 Posts
I have run into the same problem myself. I have tried various things mostly without success. One thing I noticed is the arrows positioned at the Low of the bar tend to be better positioned than the arrows at the High of the same bar. It is necessary to give those arrows an extra spacing of between 3 and 6 pips. But that still doesn't give me satisfactory results, because as I scroll from right to left, the spacing is either too much or too little. I even tried to find the height of the window in pixels and pips and do some fancy math and even that wasn't much better. So any new ideas would be very welcome.
  • Post #3
  • Quote
  • Oct 22, 2010 2:51pm Oct 22, 2010 2:51pm
  •  nix
  • | Commercial Member | Joined Jul 2007 | 27 Posts
I've run into the same problem myself. This is not an easy task since the chart window constantly rescales to fit the highest and lowest point of the visible chart segment. This way even if we know the pixel resolution of the window and the pip size in pixels we cannot come up with one correct setting.

The chart will constantly rescale and screw up our calculations (unless we keep recalculating each visible label position - which is really not the point since we want to trade and not "photoshop").

The developers of MT should add an anchor setting to text and arrow objects!

This way we would set the anchor for the low points at the top of the object
and bottom of the object for the low point (simple and easy).

Anyway, I've tried (WindowPriceMax()-WindowPriceMin()) /10)
works a bit better than standard pip spacing, but is still far from the desired effect.
NiX - click my profile & visit my website
  • Post #4
  • Quote
  • Oct 22, 2010 3:38pm Oct 22, 2010 3:38pm
  •  flyer415
  • Joined Nov 2008 | 693 Posts
Quoting CodeMeister
Disliked
I have run into the same problem myself. I have tried various things mostly without success. One thing I noticed is the arrows positioned at the Low of the bar tend to be better positioned than the arrows at the High of the same bar. It is necessary to give those arrows an extra spacing of between 3 and 6 pips. But that still doesn't give me satisfactory results, because as I scroll from right to left, the spacing is either too much or too little. I even tried to find the height of the window in pixels and pips and do some fancy math and even that...
Ignored
This happens as the gap is measured differently on up pointing arrows vs down pointing arrows. Or more correctly it is measured from the same spot but it appears differently to us as we observe it. The gap is measured from the highest point on the arrow. So on an UP arrow it is measured from the point but on a DOWN arrow it is measured from the tail (as this is the highest value of the arrow).

It is a pain. Sometimes I will use an ATR measure of previous 50 candles from the arrow so at least the arrow does not go crazy.
  • Post #5
  • Quote
  • Last Post: Oct 22, 2010 5:19pm Oct 22, 2010 5:19pm
  •  hanover
  • Joined Sep 2006 | Status: ... | 8,081 Posts
Yes, it's because any symbol (not just arrow) plotted has the top of its Wingding graphic anchored at its price coordinate.

I agree with Nix, adding something like

(WindowPriceMax()-WindowPriceMin())/(60-size*8)

where size is the size (OBJPROP_WIDTH) of the object, is a pretty fair solution.
  • Platform Tech
  • /
  • Arrow Object not Gapping properly
  • Reply to Thread
0 traders viewing now
Top of Page
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2021