Trying my hand at Expert Advisor, unable to use printf

Back to topics list To post a new topic, please log in or register
avatar
3
Pronoe 2016.03.11 11:01
 

Hi guys,


I started fooling around with MetaEditor and I'm not able to do a simple printf. Here is my code

double down = 10;
double fast=iMA(NULL,0,10,0,MODE_SMA,PRICE_CLOSE,0);

void OnTick()
{
  printf("fast=",fast);
  printf("slow=",down);
}

The code compile without error, I'm able to make it run in the Strategy Tester.

However when I'm looking at the journal this is all I can see over and over again.


2016.03.11 22:50:20.738    2016.03.10 19:28  test EURUSD,M5: slow=
2016.03.11 22:50:20.738    2016.03.10 19:28  test EURUSD,M5: fast=
2016.03.11 22:50:20.738    2016.03.10 19:28  test EURUSD,M5: slow=
2016.03.11 22:50:20.738    2016.03.10 19:28  test EURUSD,M5: fast=
2016.03.11 22:50:20.738    2016.03.10 19:28  test EURUSD,M5: slow=
2016.03.11 22:50:20.500    2016.03.10 17:44  test EURUSD,M5: fast=
2016.03.11 22:50:20.500    2016.03.10 17:44  test EURUSD,M5: slow=

What am I doing wrong?


Thanks in advance

avatar
Moderator
3418
GumRai 2016.03.11 11:54 #
 
You have no format flags. It looks like you just need to use Print()
avatar
3
Pronoe 2016.03.11 11:59 #
 
I tried but the software doesn't seem to know this function, first I don't get the auto completion when I type it, then when I type it, it doesn't change color like other functions and when I try to compile it I have an error : 'print' - function not defined
avatar
872
eevviill 2016.03.11 12:04 #
 
Pronoe:
I tried but the software doesn't seem to know this function, first I don't get the auto completion when I type it, then when I type it, it doesn't change color like other functions and when I try to compile it I have an error : 'print' - function not defined
Print
avatar
3
Pronoe 2016.03.11 12:09 #
 
oooooh, didn't pay attention of the Capital p. thanks for your help guys it worked.
Back to topics list  

To add comments, please log in or register