I found a zigzag indicator that doesn't repaint. The indicator will display three signals when there is a turn of the zigzag. The value of the three signals are stored in three buffers. Now I want to create an EA that will Ordersend a buy or sell when it indicates the third buffer value. The problem right now is that I cannot get the value for the third value.
I think that I should use the iCustom but it does not return the value, therefore my OrderSend does not go to the server
When I use the same iCustom on the standard ZigZag indicator I am able to send our the orders. But I cannot seems to get the value for this custom indicator. Appreciate your help.
I think that I should use the iCustom but it does not return the value, therefore my OrderSend does not go to the server
Inserted Code
double bothzigzag = iCustom(NULL,0,"DoubleZigZagNoRepaint",true,6,24,3,1)
When I use the same iCustom on the standard ZigZag indicator I am able to send our the orders. But I cannot seems to get the value for this custom indicator. Appreciate your help.
Inserted Code
#property indicator_chart_window #property indicator_buffers 2 #property indicator_color1 Red // Slow zigzag #property indicator_color2 Blue // Fast zigzag #property indicator_color3 DarkOrange // Both zigzags #define IName "DoubleZigZagTrack" #define ZZBack 1 // Just 1bar past-repaint #define ZZDev 5 // ZigZag deviation //------------------------------- // Input parameters //------------------------------- extern bool CalculateOnBarClose = true; extern int ZigZagFast = 6; extern int ZigZagSlow = 24; //------------------------------- // Buffers //------------------------------- double ExtMapBuffer1[]; // Slow ZigZag double ExtMapBuffer2[]; // Fast ZigZag double ExtMapBuffer3[]; // Botg ZigZags //------------------------------- // Internal variables //------------------------------- // Fractals value -mine- double fr_resistance = 0; double fr_support = EMPTY_VALUE; bool fr_resistance_change = EMPTY_VALUE; bool fr_support_change = EMPTY_VALUE; // ZigZag stores values double zz_slow_high = 0; double zz_slow_low = 0; double zz_fast_high = 0; double zz_fast_low = 0; // Offset in chart int nShift; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { // ZigZag signals SetIndexStyle(0, DRAW_ARROW, STYLE_DOT, 1); SetIndexArrow(0, 108); SetIndexBuffer(0, ExtMapBuffer1); SetIndexStyle(1, DRAW_ARROW, STYLE_DOT, 1); SetIndexArrow(1, 108); SetIndexBuffer(1, ExtMapBuffer2); SetIndexStyle(2, DRAW_ARROW, STYLE_DOT, 1); SetIndexArrow(2, 108); SetIndexBuffer(2, ExtMapBuffer3); // Data window IndicatorShortName("Double ZigZag No-repaint"); SetIndexLabel(0, "Slow ZigZag"); SetIndexLabel(1, "Fast ZigZag"); SetIndexLabel(2, "Both ZigZags"); // Copyright Comment("Copyright © http://www.pointzero-indicator.com"); // Chart offset calculation switch(Period()) { case 1: nShift = 1; break; case 5: nShift = 3; break; case 15: nShift = 5; break; case 30: nShift = 10; break; case 60: nShift = 15; break; case 240: nShift = 20; break; case 1440: nShift = 80; break; case 10080: nShift = 100; break; case 43200: nShift = 200; break; } nShift = nShift * 3; return(0); } //+------------------------------------------------------------------+ //| Custor indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { return(0); }