//+-----------------------------------------------------------------------------------+ //| Bogie-HedgeHog-IND-v2.mq4 | //| | //+-----------------------------------------------------------------------------------+ ///Please, do not sell this Indicator because its FREE #property copyright "Copyright © 2010, Bogie Enterprises" #property indicator_chart_window extern int MagicNumber = 12345; double step; double PreviousClose; double OrderID, OpenOrders; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators MagicNumber=GlobalVariableGet("MagicNumber"+Symbol()+MagicNumber); //---- return(0); } //+------------------------------------------------------------------+ //| Custor indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int shift,counted_bars=IndicatorCounted(); PreviousClose = GlobalVariableGet("PreviousClose"+Symbol()+MagicNumber); step=GlobalVariableGet("Step"+Symbol()+MagicNumber); OrderID=GlobalVariableGet("OrderType"+Symbol()+MagicNumber); OpenOrders=GlobalVariableGet("OpenOrders"+Symbol()+MagicNumber); if(IsVisualMode() || !IsTesting()) { ObjectCreate ( "PreviousClose" , OBJ_HLINE , 0 , 0 , PreviousClose ) ; ObjectSet ( "PreviousClose" , OBJPROP_COLOR , White ) ; ObjectSet ( "PreviousClose" , OBJPROP_STYLE , 0 ) ; ObjectSet ( "PreviousClose" , OBJPROP_WIDTH , 2 ); ObjectSet ( "PreviousClose" , OBJPROP_BACK , 0 ) ; if(OpenOrders==0 || OrderType()==OP_BUY) { ObjectCreate ( "Buy1" , OBJ_HLINE , 0 , 0 , PreviousClose *(1 - (step/100)) ) ; ObjectSet ( "Buy1" , OBJPROP_COLOR , Blue ) ; ObjectSet ( "Buy1" , OBJPROP_STYLE , 0 ) ; ObjectSet ( "Buy1" , OBJPROP_WIDTH , 2 ); ObjectSet ( "Buy1" , OBJPROP_BACK , 0 ) ; } else if(OrderType()==OP_SELL ) ObjectDelete("Buy1"); if(OpenOrders==0 || OrderType()==OP_SELL) { ObjectCreate ( "Sell11" , OBJ_HLINE , 0 , 0 , PreviousClose *(1 + (step/100)) ) ; ObjectSet ( "Sell11" , OBJPROP_COLOR , Magenta ) ; ObjectSet ( "Sell11" , OBJPROP_STYLE , 0 ) ; ObjectSet ( "Sell1" , OBJPROP_WIDTH , 2 ); ObjectSet ( "Sell11" , OBJPROP_BACK , 0 ) ; } else if(OrderType()==OP_BUY ) ObjectDelete("Sell1"); for(int cnt=0;cnt=1) { ObjectCreate ( "Buy2" , OBJ_HLINE , 0 , 0 , PreviousClose *(1 - ((step*2)/100)) ) ; ObjectSet ( "Buy2" , OBJPROP_COLOR , Blue ) ; ObjectSet ( "Buy2" , OBJPROP_STYLE , 0 ) ; ObjectSet ( "Buy2" , OBJPROP_WIDTH , 2 ); ObjectSet ( "Buy2" , OBJPROP_BACK , 0 ) ; } else ObjectDelete("Buy2"); if(OpenOrders>=2) { ObjectCreate ( "Buy3" , OBJ_HLINE , 0 , 0 , PreviousClose *(1 - ((step*3)/100)) ) ; ObjectSet ( "Buy3" , OBJPROP_COLOR , Blue ) ; ObjectSet ( "Buy3" , OBJPROP_STYLE , 0 ) ; ObjectSet ( "Buy3" , OBJPROP_WIDTH , 2 ); ObjectSet ( "Buy3" , OBJPROP_BACK , 0 ) ; } else ObjectDelete("Buy3"); if(OpenOrders>=3) { ObjectCreate ( "Buy4" , OBJ_HLINE , 0 , 0 , PreviousClose *(1 - ((step*4)/100)) ) ; ObjectSet ( "Buy4" , OBJPROP_COLOR , Blue ) ; ObjectSet ( "Buy4" , OBJPROP_STYLE , 0 ) ; ObjectSet ( "Buy4" , OBJPROP_WIDTH , 2 ); ObjectSet ( "Buy4" , OBJPROP_BACK , 0 ) ; } else ObjectDelete("Buy4"); } if(OrderType()==OP_SELL) { if(OpenOrders>=1) { ObjectCreate ( "Sell2" , OBJ_HLINE , 0 , 0 , PreviousClose *(1 + ((step*2)/100)) ) ; ObjectSet ( "Sell2" , OBJPROP_COLOR , Magenta ) ; ObjectSet ( "Sell2" , OBJPROP_STYLE , 0 ) ; ObjectSet ( "Sell2" , OBJPROP_WIDTH , 2 ); ObjectSet ( "Sell2" , OBJPROP_BACK , 0 ) ; } else ObjectDelete("Sell2"); if(OpenOrders>=2) { ObjectCreate ( "Sell3" , OBJ_HLINE , 0 , 0 , PreviousClose *(1 + ((step*3)/100)) ) ; ObjectSet ( "Sell3" , OBJPROP_COLOR , Magenta ) ; ObjectSet ( "Sell3" , OBJPROP_STYLE , 0 ) ; ObjectSet ( "Sell3" , OBJPROP_WIDTH , 2 ); ObjectSet ( "Sell3" , OBJPROP_BACK , 0 ) ; } else ObjectDelete("Sell3"); if(OpenOrders>=3) { ObjectCreate ( "Sell4" , OBJ_HLINE , 0 , 0 , PreviousClose *(1 + ((step*4)/100)) ) ; ObjectSet ( "Sell4" , OBJPROP_COLOR , Magenta ) ; ObjectSet ( "Sell4" , OBJPROP_STYLE , 1 ) ; ObjectSet ( "Sell4" , OBJPROP_WIDTH , 2 ); ObjectSet ( "Sell4" , OBJPROP_BACK , 0 ) ; } else ObjectDelete("Sell4"); } }}}} //---- //---- return(0); } //+------------------------------------------------------------------+