I know a code in simpler syntax and I am new to the Forex (about a month)
I am attempting to make adjustments to an EA and thus going line by line to comprehend that the Forex logic (and syntax) with certain segments... this is a section that I'm trying to understand as I wish to ensure that the code does not open orders on Friday, however if transactions are still open going into Friday to allow it to manage them without closing them
Thanks so much for your help!
=========================
Variables:
int OpenOrders=0, cnt=0;
extern bool TradeOnFriday=False;
int OrdersTimeAlive=0; // in moments
bool ContinueOpening=True;
datetime LastOrderOpenTime=0;
================================
Code Block:
// should dont trade fridays then we shut all
if (! TradeOnFriday DayOfWeek()==5)
PreviousOpenOrders=OpenOrders 1;
ContinueOpening=False;
text = text\nClosing all orders and stop trading since TradeOnFriday protection.;
Print(Closing all orders and stop trading since TradeOnFriday protection.) ;
// Orders Time living protection
if (OrdersTimeAlivegt;0 CurTime() - LastOrderOpenTimegt;OrdersTimeAlive)
PreviousOpenOrders=OpenOrders 1;
ContinueOpening=False;
text = text \nClosing all orders since OrdersTimeAlive protection.;
Printing(Closing all orders since OrdersTimeAlive protection.) ;
======================================