request for help for mql5 programming

 
hi everyone, i'm new to programming and i need your help.

I needed an ea to start studying the nature of the financial instrument, so I established these rules:

- every day marks the high and low of the current day
- we will use smaller timeframes for the visualization but we will refer to the high and low of the current day
- open a buy if the price exceeds the high of the current day (no sl, no tp)

- open a sell if the price breaks the low of the current  day (no sl, no tp)

- when a position is opened, the one in the opposite direction is closed

- at a certain time of the day defined in input, all open positions are closed.


failing to program the input signal referring to the current daily candle,

I found an indicator similar to what my purpose is and I linked it to the expert I programmed with all the other established rules.


does exactly what I say, it sounded perfect.


the problem is that the backtest is performed only with the visualization and it does not allow me to do backtesting and optimization, because the way in which I connected the expert to the indicator was through a search of the objects present on the chart.


I am not interested in the visualization of the indicator objects but only the piece of code that is needed to execute the trades.


(I have to return the high and low of the current day to me and use them if

ask> High (0) daily -> buy

bid <Low (0) daily -> sell


I am attaching the file of the expert and of the indicator to which it refers.

(there will be a lot of errors in the code because I'm a beginner, sorry)


I really hope you can help me to insert the entry signal directly into the ea without using indicators and displays, thanks to all



 
Hi!
You can use such expressions:
iHigh(_Symbol, PERIOD_D1, 0) - for getting high of current day;
iLow(_Symbol, PERIOD_D1, 0) - for getting low of current day.

 
hi, thank you very much for the reply.

unfortunately it was the first thing I tried to do but it doesn't open any orders for me in this way.

if I ask him
iHigh (_Symbol, PERIOD_D1, 1) opens otherwise if I want the current candle with iHigh (_Symbol, PERIOD_D1, 0)
 no.
 
TigerJS2 #:
hi, thank you very much for the reply.

unfortunately it was the first thing I tried to do but it doesn't open any orders for me in this way.

if I ask him


no.

Can I looked at code with this?
Reason: