#include extern int cSeconds = 14; extern int MinPriceShot = 7; extern int MaxOrdersCount = 1; extern double RiskPercent = 1.0; double Lots = 0.1; extern int TakeProfit = 22; extern int StopLoss = 10; extern int TrailingStop = 5; extern int Slippage = 3; extern int BuyMagic = 11; extern int SellMagic = 12; int TimeLastTicked = 0; double LastClose = -1.0; string EA_Name = "XOX"; double myPoint; double UsePoint; int init() { myPoint = SetPoint(); return(0); } int deinit() { return (0); } int BarsCount = 0; datetime newbar; int start() { int NumOrders; double ArrowUp; double ArrowDown; if (!IsOptimization() && !IsTesting() && !IsVisualMode()) { DrawStats(); } Lots = LotsOptimized(); if(newbar==Time[0]) return(0); else newbar=Time[0]; ArrowUp = iCustom(NULL,0,"vr",0,1); ArrowDown = iCustom(NULL,0,"vr",1,1); Print("ArrowUp: "+ArrowUp+", ArrowDown: "+ArrowDown+", Time: "+TimeToStr(Time[1])); if(ArrowDown != EMPTY_VALUE ) { Print("hello from Up : "+ ArrowUp); NumOrders = OrdersTotalCountByTypeANDMagic(OP_BUY, BuyMagic) + OrdersTotalCountByTypeANDMagic(OP_SELL, SellMagic); if (NumOrders < MaxOrdersCount) { Print("hello from Down : "+ArrowDown); Alert("Up"); OpenSell(Lots); } } if(ArrowUp != EMPTY_VALUE ) { Print("hello from Down : "+ArrowDown); NumOrders = OrdersTotalCountByTypeANDMagic(OP_BUY, BuyMagic) + OrdersTotalCountByTypeANDMagic(OP_SELL, SellMagic); if (NumOrders < MaxOrdersCount) { Print("hello from Down : "+ArrowDown); Alert("Down"); OpenBuy(Lots); } } DoTrail(); return(0); }