Newbie over here- Please Help me add some arrows to this EA...

 

I have this EA I made and I want to add a up arrow on buy signals below the candle and a down arrow on sell signals above the the candle. I'm posting the code below, Thanks in advance...



//+------------------------------------------------------------------+
//|                                             Yua-Scalping-1.0.mq5 
//|                                            Copyright 2022, ART13
//| ============================CHANGE LOGS==========================
//      1. The entry rules are the same as Test2.
//      2. The Default Stoch and Profit/Loss settings have been changed for scalping.
//      3. This is a rebranding of Test2 with sound effects at the entries and at beginning.
//
//                            
//+------------------------------------------------------------------+


#include <Trade\Trade.mqh> // Get code from other places
#resource "\\Files\\warn.wav"
//--- Input Variables (Accessible from MetaTrader 5)

input double            lot = 0.3;
input int               SmmaPeriods = 365;
input ENUM_MA_METHOD    SmmaMethod = MODE_SMMA;
input ENUM_STO_PRICE    SmmaCalculatedOn = STO_CLOSECLOSE;
input int               slippage = 3;
input bool              useStopLoss = true;
input double            stopLossPips = 15;
input bool              useTakeProfit = true;
input double            takeProfitPips = 5;
input int               KPeriods = 13;
input int               DPeriods = 8;
input int               SlowingPeriods = 8;
input ENUM_MA_METHOD    Stoc_Method = MODE_SMA;
input ENUM_STO_PRICE    StocCalculatedOn = STO_LOWHIGH; 
//--- Service Variables 

CTrade myTradingControlPanel;
MqlRates PTable[];     // PART 1- Of getting the OHLC Prices.....
double SmmaData[], Stocstoch[], Stocsignal[];  //Declaring the arrays
int noofPTable, noofSmmaData, noofStoc_stoch, noofStoc_signal;   // Array initializing variables 
int SmmaControlPanel, Stoc_ControlPanel;
int P;
double currentBid, currentAsk;
double stopLossPipsFinal, takeProfitPipsFinal, stopLevelPips;
double stopLossLevel, takeProfitLevel;
double Smma, stoc1, stoc2, signal1, signal2; 





//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---

    PlaySound("::Files\\warn.wav");
   ArraySetAsSeries(PTable,true); // Setting up table/array for time series data   Part 2- Of getting the OHLC Prices
   ArraySetAsSeries(SmmaData,true);    // Setting up table/array for time series data
   ArraySetAsSeries(Stocstoch,true);  // Setting up table/array for time series data 
   ArraySetAsSeries(Stocsignal,true); // Setting up table/array for time series data
  
   SmmaControlPanel = iMA(_Symbol, _Period, SmmaPeriods, 0, SmmaMethod, SmmaCalculatedOn); // Getting the Control Panel/Handle for SMMA
   Stoc_ControlPanel = iStochastic(_Symbol, 0, KPeriods, DPeriods, SlowingPeriods, Stoc_Method, StocCalculatedOn);
   
   if(_Digits == 5 || _Digits == 3 || _Digits == 1) P = 10;else P = 1; // To account for 5 digit brokers

   return(INIT_SUCCEEDED);
  }
  
  
  
  
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   IndicatorRelease(SmmaControlPanel);
   IndicatorRelease(Stoc_ControlPanel);
  }
  
  
  
  
  
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
  
         // enough bars to work with?
if(Bars(_Symbol,_Period)<60)
// if total bars is less than 60 bars
{
Alert("We have less than 60 bars, EA will now exit!!");
return;
}
// use the static Old_Time variable for the bar time.
// At each OnTick execution we will check the current bar time with
// If the bar time isn't equal to the saved time, it indicates that
static datetime Old_Time;
datetime New_Time[1];
bool IsNewBar=false;
// copying the last bar time to the element New_Time[0]
int copied=CopyTime(_Symbol,_Period,0,1,New_Time);

if(copied>0) // ok, the data has been copied successfully
{
if(Old_Time!=New_Time[0])
// if old time isn't equal to new bar time
{
IsNewBar=true;
// if it isn't a first call, the new bar has appeared
if(MQL5InfoInteger(MQL5_DEBUGGING)) 
Print("We have new bar here ",New_Time[0]," old time was ",Old_Time);
Old_Time=New_Time[0]; // saving bar time
}
}
else
{
Alert("Error in copying historical times data, error =",
GetLastError());
ResetLastError();
return;
}
//--- EA should only check for new trade if we have a new bar
if(IsNewBar==false)
{
return;
}
  
  
  
  
   // -------------------- Collect most current data --------------------
   
   currentBid = SymbolInfoDouble(_Symbol,SYMBOL_BID); // Get latest Bid Price
   currentAsk = SymbolInfoDouble(_Symbol,SYMBOL_ASK); // Get latest Ask Price
   
   noofPTable = CopyRates(_Symbol,0,0,10,PTable); // Collects data from shift 0 to shift 9 ==== PART 3 - of getting the OHLC Prices
   noofSmmaData = CopyBuffer(SmmaControlPanel, 0, 0, 3, SmmaData); // Collect most current SMMA(365) Data
   noofStoc_stoch = CopyBuffer(Stoc_ControlPanel, 0, 0, 5, Stocstoch); 
   noofStoc_signal = CopyBuffer(Stoc_ControlPanel, 1, 0, 5, Stocsignal); 
   
   
   Smma = SmmaData[1];
   stoc1 = Stocstoch[1];
   stoc2 = Stocstoch[2];
   signal1 = Stocsignal[1];
   signal2 =Stocsignal[2];
    

   // -------------------- --------------------
   
  
   
   stopLevelPips = (double) (SymbolInfoInteger(_Symbol, SYMBOL_TRADE_STOPS_LEVEL) + SymbolInfoInteger(_Symbol, SYMBOL_SPREAD)) / P; // Defining minimum StopLevel

   if (stopLossPips < stopLevelPips) 
      {
      stopLossPipsFinal = stopLevelPips;
      } 
   else
      {
      stopLossPipsFinal = stopLossPips;
      } 
      
   if (takeProfitPips < stopLevelPips) 
      {
      takeProfitPipsFinal = stopLevelPips;
      }
   else
      {
      takeProfitPipsFinal = takeProfitPips;
      }
      
 
   // -------------------- ENTRIES --------------------  
 
      
      // --------------------------------------------------------- //
     
    if (Smma<PTable[1].high && Smma>PTable[1].low)
         {
         }
    else 
    {
      if(stoc1>stoc2 && signal1>signal2 && stoc1>20 && stoc1<40 && signal1>25 && signal1<40) // Rule to enter long trades
      // --------------------------------------------------------- //
     
         {   
         
         if (useStopLoss) stopLossLevel = currentAsk - stopLossPipsFinal * _Point * P; else stopLossLevel = 0.0;
         if (useTakeProfit) takeProfitLevel = currentAsk + takeProfitPipsFinal * _Point * P; else takeProfitLevel = 0.0;
        
         myTradingControlPanel.PositionOpen(_Symbol, ORDER_TYPE_BUY, lot, currentAsk, stopLossLevel, takeProfitLevel, "Buy Trade. Magic Number #" + (string) myTradingControlPanel.RequestMagic()); // Open a Buy position
         PlaySound("::Files\\warn.wav");
         
         if(myTradingControlPanel.ResultRetcode()==10008 || myTradingControlPanel.ResultRetcode()==10009) //Request is completed or order placed
            {
            Print("Entry rules: A Buy order has been successfully placed with Ticket#: ", myTradingControlPanel.ResultOrder());
            }
         else
            {
            Print("Entry rules: The Buy order request could not be completed. Error: ", GetLastError());
            ResetLastError();
            return;
            }
           
         }
         
         
      // --- Entry Rules (Short Trades) ---

                                                    
      else if(stoc2>stoc1 && signal2>signal1 && stoc1>25 && stoc1<40 && signal1>20 && signal1<40 ) // Rule to enter short trades
      
      // --------------------------------------------------------- //

         {   
         
         if (useStopLoss) stopLossLevel = currentBid + stopLossPipsFinal * _Point * P; else stopLossLevel = 0.0;
         if (useTakeProfit) takeProfitLevel = currentBid - takeProfitPipsFinal * _Point * P; else takeProfitLevel = 0.0;

         myTradingControlPanel.PositionOpen(_Symbol, ORDER_TYPE_SELL, lot, currentBid, stopLossLevel, takeProfitLevel, "Sell Trade. Magic Number #" + (string) myTradingControlPanel.RequestMagic()); // Open a Sell position
         PlaySound("::Files\\warn.wav");
         
         if(myTradingControlPanel.ResultRetcode()==10008 || myTradingControlPanel.ResultRetcode()==10009) //Request is completed or order placed
            {
            Print("Entry rules: A Sell order has been successfully placed with Ticket#: ", myTradingControlPanel.ResultOrder());
            }
         else
            {
            Print("Entry rules: The Sell order request could not be completed.Error: ", GetLastError());
            ResetLastError();
            return;
            }
         
         } 
        }
       }
    


//+------------------------------------------------------------------+
Discover new MetaTrader 5 opportunities with MQL5 community and services
Discover new MetaTrader 5 opportunities with MQL5 community and services
  • 2022.12.09
  • www.mql5.com
MQL5: language of trade strategies built-in the MetaTrader 5 Trading Platform, allows writing your own trading robots, technical indicators, scripts and libraries of functions
 
Thamira Wijerathne: I have this EA I made and I want to add a up arrow on
  1. Code has no eyes; EA doesn't need to see them, just the values. If you want to see it, you modify the indicator and add it to the chart.

  2. You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your difficulty.
              No free help (2017)

    Or pay someone. Top of every page is the link Freelance.
              Hiring to write script - General - MQL5 programming forum (2018)

    We're not going to code it for you (although it could happen if you are lucky or the issue is interesting).
              No free help (2017)

Reason: