Anyone??
//+------------------------------------------------------------------+ //| Script program start function | //+------------------------------------------------------------------+ void OnStart() { //--- /*double ATR[],threshold=0; if(CopyBuffer(iATR(_Symbol,_Period,1000),0,0,1,ATR)>0) threshold=ATR[0]/10;*/ double highest=iHigh(_Symbol,_Period,iHighest(_Symbol,_Period,MODE_HIGH,1000,0)); double lowest=iLow(_Symbol,_Period,iLowest(_Symbol,_Period,MODE_LOW,1000,0)); double percent=0.005,threshold=(highest-lowest)*percent; for(int i = 0; i < 1000; i++){ double dif = MathAbs(iClose(Symbol(),PERIOD_CURRENT,i)-iClose(Symbol(),PERIOD_CURRENT,i+1)); if(dif <= threshold){ ObjectCreate(ChartID(),"BreakShow "+IntegerToString(i),OBJ_ARROW_CHECK,0,iTime(Symbol(),PERIOD_CURRENT,i),iHigh(Symbol(),PERIOD_CURRENT,i)); } } while(!_StopFlag) {} ObjectsDeleteAll(ChartID(),0,OBJ_ARROW_CHECK); } //+------------------------------------------------------------------+
Thanks a lot, this is actually a good idea
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
I wrote this code to spot fractures but the thing is that the threshold for each chart and time frame is different.
And with a fixed low threshold you may miss some fractures and with a high threshold you may get non fractures in the line chart
Isn't there any better solution for this?
here is sample code that puts an arrow on top of each candle where there is a fracture
I'll attach a photo to show what I mean by fracture
The pink arrow showing a fracture missed by my code