Trade\SymbolInfo.mqh>

 

Hi, i'm trayng to make this work but i can't see the current Ask price and i don' t understand why?

#include <Trade\SymbolInfo.mqh>
#include <Trade\Trade.mqh>

CSymbolInfo Simbolo;

int OnInit()
  {
   
   return(INIT_SUCCEEDED);
  }

void OnDeinit(const int reason)
  {
   
  }

void OnTick()
  {
   double total=(Simbolo.Ask()/_Point)/100;
   Print(_Point);
   Print(total);
   Print(Simbolo.Ask());
   Comment("I want to show and watch: ",total);
   Comment("Ask: ",Simbolo.Ask());
  }

thanks

 
Documentation on MQL5: Standard Library / Trade Classes / CSymbolInfo
Documentation on MQL5: Standard Library / Trade Classes / CSymbolInfo
  • www.mql5.com
CSymbolInfo - Trade Classes - Standard Library - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Thanks a lot. Why should i convert from double to string for  showing the price?
 
5ariel_92 :
Thanks a lot. Why should i convert from double to string for  showing the price?

You don't owe anything to anyone - this is just an example: the example demonstrates that you are getting fresh prices.

 
Vladimir Karputov:

You don't owe anything to anyone - this is just an example: the example demonstrates that you are getting fresh prices.

but
m_symbol.Ask()

returns a double, right? if i want to show the variable "total":

double total=(m_symbol.Ask()/_Point)/100;

why if i do Print(total) it's shows 0?

 
5ariel_92 :
but

returns a double, right? if i want to show the variable "total":

double total=(m_symbol.Ask()/_Point)/100;

why if i do Print(total) it's shows 0?

I can't read other people's minds. Show ALL MQ5 code and then ask your question.

 
Vladimir Karputov:

I can't read other people's minds. Show ALL MQ5 code and then ask your question.

but i show you my code before
 
5ariel_92 :
but i show you my code before

Show all your corrected code (I gave you an example of the correct code). Please provide your corrected code. No fixed code - no answer.

Reason: