Problems reading DT-ZigZag-Lauer with iCustom

Oct 15, 2012 at 14:06
1,215Lượt xem
1 Replies
fx_maddin
forex_trader_95285
Tham gia từ Oct 15, 2012   1bài viết
Oct 15, 2012 at 14:06
Hi,

i try to write an EA and get the values from DT-ZigZag-Lauer indicator with following code:

int depth = 5;
int GrossPeriod = 240;

double Lauer_BUY = iCustom(NULL,0,'DT-ZigZag-Lauer',depth,GrossPeriod,0,1);
double Lauer_SELL = iCustom(NULL,0,'DT-ZigZag-Lauer',depth,GrossPeriod,1,1);

if (Lauer_BUY > 0) {
   LauerSignal = 'BUY';
   ObjectCreate('LBUY_'+Bars, OBJ_ARROW, 0, Time[1], Lauer_BUY + 35 * Point);
   ObjectSet('LBUY_'+Bars, OBJPROP_ARROWCODE, SYMBOL_ARROWUP);
   ObjectSet('LBUY_'+Bars, OBJPROP_COLOR, Blue);
}
else if (Lauer_SELL > 0) {
   GPLauerSignal = 'SELL';
   ObjectCreate('LSELL_'+Bars, OBJ_ARROW, 0, Time[1], Lauer_SELL - 35 * Point);
   ObjectSet('LSELL_'+Bars, OBJPROP_ARROWCODE, SYMBOL_ARROWDOWN);
   ObjectSet('LSELL_'+Bars, OBJPROP_COLOR, Red);
}
But my arrows differ from the arrows (dots) of the EA (See Screenshot Lauer.png).

What's wrong in my code.

thanks in advance.
Tham gia từ Dec 08, 2010   36bài viết
Oct 16, 2012 at 13:02
You also need to check for EMPTY_VALUE, since it is defined as 2147483647 and is greater than 0.

if( Lauer_BUY > 0 && Lauer_BUY != EMPTY_VALUE )
{
....
}
Đăng nhập / Đăng ký to comment
You must be connected to Myfxbook in order to leave a comment
*Nghiêm cấm sử dụng cho mục đích thương mại và spam, nếu vi phạm có thể dẫn đến việc chấm dứt tài khoản.
Mẹo: Đăng ảnh/url youtube sẽ tự động được nhúng vào bài viết của bạn!
Mẹo: Dùng @ để tự động điền tên người dùng tham gia vào cuộc thảo luận này.