Only one order per day

 

Hello,

maybe it is a strange question but is there any chance to make the EA to open Only one order per day in 5 min chart?

Fore example, if i have:


saveHigh = High[iHighest(Symbol(), 0, MODE_HIGH, 30, 1)];

if (Close[1] > saveHigh) 

int buyticket = OrderSend(Symbol(),OP_BUY,LotSize,Ask,3,Ask-(StopLoss*pips),Ask+(TakeProfit*pips),NULL,MagicNumber,0,Green);


I want to make only one trade per day BUT im using 5 min chart so i cant count the daily bar. Maybe it is easy, but i cant find a way.


than you in advance.

 
  1. Please edit your (original) post and use the CODE button (Alt-S)! (For large amounts of code, attach it.)
              General rules and best pratices of the Forum. - General - MQL5 programming forum (2019)
              Messages Editor

  2. Aleksandar Nedyalkov: make the EA to open Only one order per day in 5 min chart?

    The chart TF is irrelevant.  Go through a OrderSelect loop on open orders and on history and find the latest date. Compare to current date.
              date/time (2017)
              Find bar of the same time one day ago - MQL4 programming forum (2017)

    1. Do not assume history has only closed orders.
                OrderType() == 6, 7 in the history pool? - MQL4 programming forum (2017)

    2. Do not assume history is ordered by date, it's not.
                Could EA Really Live By Order_History Alone? (ubzen) - MQL4 programming forum (2012)
                Taking the last profit and storing it in a variable | MQL4 - MQL4 programming forum #3 (2020.06.08)