OnTick does not execute

Keith Watford  
Fredyrik:

Hi,

I'm new to this and I'm stuck. My code does not seem to execute at all. Here my very simple code :

Are there any incoming ticks?

Show your complete code and use the code button (Alt+S) when pasting code.

Fernando Carreiro  
Fredyrik: I'm new to this and I'm stuck. My code does not seem to execute at all. Here my very simple code: Nothing appears in the "Experts" log when I run my EA. I don't know where to look or what to look for...
Are you sure that the your code is in the Experts folder and not in the Indicators or Scripts folder?
Fredyrik  

I'm in mql5/mt5. It is in the Experts/Advisors folder in meta editor and in the Expert Advisors/Advisors folder in MetaTrader.

My complete code is:

//+------------------------------------------------------------------+

//|                                                       AutoTP.mq5 |

//|                                                   Copyright 2022 |

//|                                                                  |

//+------------------------------------------------------------------+

#property copyright "Copyright 2022"

#property link      ""

#property version   "1.00"



//--- input parameters

input int      TakeProfit=10;

//+------------------------------------------------------------------+

//| Expert initialization function                                   |

//+------------------------------------------------------------------+

int OnInit()

  {

   return(INIT_SUCCEEDED);

  }

//+------------------------------------------------------------------+

//| Expert deinitialization function                                 |

//+------------------------------------------------------------------+

void OnDeinit(const int reason)

  {}

//+------------------------------------------------------------------+

//| Expert tick function                                             |

//+------------------------------------------------------------------+

void OnTick()

  {

//---

   Print("OnTick");

  }

//+------------------------------------------------------------------+

Keith Watford  
Fredyrik #:

It is in the Experts/Advisors folder in meta editor and in the Expert Advisors/Advisors folder in MetaTrader.

My complete code is:


That code does exactly what it is coded to do.

Fernando Carreiro  
Fredyrik #: I'm in mql5/mt5. It is in the Experts/Advisors folder in meta editor and in the Expert Advisors/Advisors folder in MetaTrader. My complete code is:

Is your MetaTrader 5 connected to the broker account?

On what symbol chart are you attaching the EA and is the chart updating quote prices?

Please provide some screenshots.

Fredyrik  

I'm on EUR/USD 1M chart, the EA name is written in the top right so it's active. The chart is updating, I can place trades and all, so the account is connected. 

Fernando Carreiro  
Fredyrik #:I'm on EUR/USD 1M chart, the EA name is written in the top right so it's active. The chart is updating, I can place trades and all, so the account is connected. 

Please note that the Market for EUR/USD is currently closed for the weekend. So, the chart cannot be updating (at least not now).

Either test on a different symbol that has activity during the weekend, or wait for Monday to continue testing.

When that happens please provide a full screenshot that includes the Chart, the Market Window and Journal log that shows something like this ...

2022.11.26 21:01:54.903 Experts expert AutoTP (EURUSD,M1) loaded successfully

And then a second screenshot of the Experts log.

Fredyrik  
Fernando Carreiro #:

Please note that the Market for EUR/USD is currently closed for the weekend. So, the chart cannot be updating (at least not now).

Either test on a different symbol that has activity during the weekend, or wait for Monday to continue testing.

When that happens please provide a full screenshot that includes the Chart, the Market Window and Journal log that shows something like this ...

And then a second screenshot of the Experts log.

I know markets are closed, I was just providing details of my previous testing. I will retest and provide screenshot when markets reopen.
Keith Watford  
Fredyrik #:
Here is the screenshots. My EA is named AutoTP.

I find it difficult to believe that you have pasted the complete code in post #3.