MT5 DDE Server Last Price not showing

 

Hi,

I got this code from the forum as well as the DDE. I am trying to display the last price of the Symbol but the value is not showing on the DDE server.


This is the code:

void OnTimer()

  {

//--- filling an array MA[] with current values of iMA

//--- Copying 100 elements



double LAST = SymbolInfoDouble(_Symbol,SYMBOL_LAST);



// Check & Add Item DDE



if(!CheckItem(_Symbol,"LAST")) 

     {

      if(!AddItem(_Symbol,"LAST")) return; 

     }



   if(!CheckItem("COMPANY","Value")) AddItem("COMPANY","Value");

   if(!CheckItem("TIME","Value")) AddItem("TIME","Value");



// Set Item Value DDE    

   SetItem("COMPANY","Value",(string)AccountInfoString(ACCOUNT_COMPANY));

   SetItem("TIME","Value",(string)TimeCurrent());



   

   SetItem(_Symbol,"LAST",DoubleToString(LAST));



  }


As you can see the value stays 0