//+------------------------------------------------------------------+ //| VSA_YJZ.mq4 | //| Copyright © 2009, yijomza@gmail.com | //| yijomza@gmail.com | //+------------------------------------------------------------------+ #property copyright "Copyright © 2009, yijomza@gmail.com." #property link "yijomza@gmail.com" #property indicator_chart_window //----Input extern int txtDegree =45; extern int SizeText =9; extern int SpreadPeriod=20 ,VolumePeriod=20; extern color TextColor=Orange; //---- buffers int o; int c=0; string updnbar,spreadtype,volumetype,closebar,VSAType,newVSA; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { //---- static int oldBars=0; int counted_bars=IndicatorCounted(); bool isBuy,isSell; if(counted_bars<0) return(-1); if(counted_bars>0) counted_bars--; int limit=MathMin(Bars-counted_bars,Bars-1); if(oldBars!=Bars) //for(c=1000;c>=0;c--) for(int i=0; i < (int) limit; c++) { /* double upArrow1 = iCustom(NULL, PERIOD_CURRENT, "Trade-Confirmed-Indicator",100,1,16777184,8421504,8421504,16748574,255,0,16777215,true,false,false,true,16776960,65535,65280,255,1,0,0,0,0); double downArrow1 = iCustom(NULL, PERIOD_CURRENT, "Trade-Confirmed-Indicator",100,1,16777184,8421504,8421504,16748574,255,0,16777215,true,false,false,true,16776960,65535,65280,255,0,1,0,0,0); double upArrow2 = iCustom(NULL, PERIOD_CURRENT, "Trade-Confirmed-Indicator",100,1,16777184,8421504,8421504,16748574,255,0,16777215,true,false,false,true,16776960,65535,65280,255,0,0,1,0,0); double downArrow2 = iCustom(NULL, PERIOD_CURRENT, "Trade-Confirmed-Indicator",100,1,16777184,8421504,8421504,16748574,255,0,16777215,true,false,false,true,16776960,65535,65280,255,0,0,0,1,0); */ double upArrow1 = iCustom(NULL, PERIOD_CURRENT, "Trade-Confirmed-Indicator",1,0,0,0,0); double downArrow1 = iCustom(NULL, PERIOD_CURRENT, "Trade-Confirmed-Indicator",0,1,0,0,0); double upArrow2 = 0;//iCustom(NULL, PERIOD_CURRENT, "Trade-Confirmed-Indicator",0,0,1,0,0); double downArrow2 = 0;//iCustom(NULL, PERIOD_CURRENT, "Trade-Confirmed-Indicator",0,0,0,1,0); /* Trade-Confirmed-Indicator parameters: CountBars=100 Corner=1 BGcolor=16777184 NeutralBarClr=8421504 BuyBarClr=16748574 SellBarClr=255 TextClr=0 PercentClr=16777215 c50=--------------- Notifications -------------- alertsMessage=true alertsNotify=false alertsEmail=false alertsSound=true c51=------------- Arrows Settings -------------- upArrowColor1=16776960 dnArrowColor1=65535 upArrowColor2=65280 dnArrowColor2=255 */ double lossArrow = 0;//1; double itfm = iCustom(NULL, PERIOD_CURRENT, "itmf_sigalert",14,5,0.618,0,1,0); double trend_up = iCustom(NULL, 0, "pzlopeztrend", 0, 1,0); double trend_down = iCustom(NULL, 0, "pzlopeztrend", 1, 1,0); if(upArrow1 || downArrow1 || upArrow2 || downArrow2 ||itfm ||trend_up ||trend_down ) { if(upArrow1) Print("upArrow1 = "+upArrow1); if(downArrow1) Print("downArrow1 = "+downArrow1); if(upArrow2) Print("upArrow2 = "+upArrow2); if(downArrow2) Print("downArrow2 = "+downArrow2); if(itfm) Print("itfm = "+itfm); if(trend_up) Print("trend_up = "+trend_up); if(trend_down) Print("trend_down = "+trend_down); } else Print("not right"); return(GetLastError()); if( trend_up && ( itfm >0 ) && upArrow1<=0 && upArrow2<0 ) isBuy= true; if( trend_down && ( itfm >0 ) && upArrow1<=0 && upArrow2<0 ) isSell=true; //itfm[1]*0.05 < itfm[0] || } Comment("Decision: isBuy",isBuy , "isSell ",isSell); }