You need to decide the Highest high and Lowest low of x number of bars.
Best example is the Zigzag indicator !.
As a code, you may use something like this ...
HH = NormalizeDouble(iHigh(Symbol(), TimeFrame, iHighest(Symbol(), 0, MODE_HIGH, NoOfBars, 1)), Digits); LL = NormalizeDouble(iLow(Symbol(), TimeFrame, iLowest(Symbol(), 0, MODE_LOW, NoOfBars, 1)), Digits);
Osama Shaban:
You need to decide the Highest high and Lowest low of x number of bars.
Best example is the Zigzag indicator !.
As a code, you may use something like this ...
being search around on internet,
this is what i found.
int n, i; double zag, zig; i=0; while(n<2) { if(zig>0) zag=zig; zig=iCustom(NULL, 0, "ZigZag", 0, i); if(zig>0) n+=1; i++; }now you have two numbers zig -- last value and zag -- value before that if(zag>zig) indicator shows down if(zig>zag) indicator shows up
2016.08.30 12:39:03 Core 1 2010.01.01 00:00:00 cannot load custom indicator 'ZigZag' [4802]
it seems is wrong coding.
void OnTick() { //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ if(ZigZag_Handle != INVALID_HANDLE) { double values[]; if(CopyBuffer(ZigZag_Handle, 0, 0, 2, values) == 2 && values[0] != EMPTY_VALUE) { if(GlobalVariableSet("ZigZag_Handle", values[0])) { if(!IndicatorRelease(ZigZag_Handle)) { Print("IndicatorRelease() failed. Error ",GetLastError()); } else ZigZag_Handle = INVALID_HANDLE; } else { Print("GlobalVariableSet failed. Error ",GetLastError()); } } } //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ }
int OnInit() { //+------------------------------------------------------------------+ //+-- create timer --------------------------------------------------+ EventSetTimer(60); //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ ZigZag_Handle = iCustom(Symbols, PERIOD_CURRENT, "ZigZag", ExtDepth, ExtDeviation, ExtBackstep); //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ return(INIT_SUCCEEDED); }
//+--- int ZigZag_Handle = INVALID_HANDLE; int ExtDepth = 6; int ExtDeviation = 3; int ExtBackstep = 2; //+---
any help please ??
Marco vd Heijden:
Please use the search function.
super thanks for the solution.
great thanks !!
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
and how to get it ?
confusing...
buy low sell high
seems is the easy job
but how to ensure that point is highest or lowest ?