#include // Create an instance from CTrade CTrade trade; void OnTick() { // We calculate the Ask price double Ask=NormalizeDouble(SymbolInfoDouble(_Symbol,SYMBOL_ASK),_Digits); // We calculate the Bid price double Bid=NormalizeDouble(SymbolInfoDouble(_Symbol,SYMBOL_BID),_Digits); // Create a string for the signal string signal=""; // Create an Array for prices MqlRates PriceInformation[]; // Sort the array from the current candle downwards ArraySetAsSeries(PriceInformation,true); // Copy price data into the array int Data=CopyRates(Symbol(),Period(),0,3,PriceInformation); // Create an Array for the EA data double myPriceArray[]; // Sort the array from the current candle downwards ArraySetAsSeries(myPriceArray,true); // Define the Bulls Power EA int BullsPowerDefinition =iBullsPower(_Symbol,_Period,13); // Fill the Array with data CopyBuffer(BullsPowerDefinition,0,0,3,myPriceArray); // Calculate the Array value float BullsPowerValue=(myPriceArray[0]); // If Bulls Power value is above 0 if (BullsPowerValue>0) signal="buy"; // If Bulls Power value is below 0 if (BullsPowerValue<0) signal="sell"; // sell 10 Microlot if (signal =="sell" && PositionsTotal()<1) trade.Sell(0.10,NULL,Bid,0,(Bid-150 * _Point),NULL); // buy 10 Microlot if (signal =="buy" && PositionsTotal()<1) trade.Buy(0.10,NULL,Ask,0,(Ask+150 * _Point),NULL); // Create a chart output Comment ("The current signal is: ",signal); }