This is a basic question regarding boolean logic. Please see the code below.
Question 1:
For the statement,
IF ((OrdersTotal() > 0) && (OrderType() == OP_BUY) && (MarketInfo(Trade,MODE_BID) > OrderOpenPrice() + (30*Point)))
DT3B = true; DT2B = false; DT1B = false;
Will MT4 keep DT1B = false and DT1B = false even though in reality the actual is still true in that the market will be over OOP by 10 and 20 at that point as well? (In reality, if the market is plus 30, then it is also over 10 and over 20 as well.)
Question 2:
Once DT3B = true is activated and triggered, will it revert to false if the market falls below OOP plus 30?
Inserted Code
bool DT1B = false; bool DT2B = false; bool DT3B = false; bool DT1S = false; bool DT2S = false; bool DT3S = false; if ((OrdersTotal() > 0) && (OrderType() == OP_BUY) && (MarketInfo(Trade,MODE_BID) > OrderOpenPrice() + (10*Point))) DT1B = true; if ((OrdersTotal() > 0) && (OrderType() == OP_BUY) && (MarketInfo(Trade,MODE_BID) > OrderOpenPrice() + (20*Point))) DT2B = true; DT1B = false; if ((OrdersTotal() > 0) && (OrderType() == OP_BUY) && (MarketInfo(Trade,MODE_BID) > OrderOpenPrice() + (30*Point))) DT3B = true; DT2B = false; DT1B = false; // (etc., continues to X amount of Pips) if ((OrdersTotal() > 0) && (OrderType() == OP_SELL) && (MarketInfo(Trade,MODE_ASK) < OrderOpenPrice() - (10*Point))) DT1S = true; if ((OrdersTotal() > 0) && (OrderType() == OP_SELL) && (MarketInfo(Trade,MODE_ASK) < OrderOpenPrice() - (20*Point))) DT2S = true; DT1S = false; if ((OrdersTotal() > 0) && (OrderType() == OP_SELL) && (MarketInfo(Trade,MODE_ASK) < OrderOpenPrice() - (30*Point))) DT3S = true; DT2S = false; DT1S = false; // (etc., continues to X amount of Pips)
Question 1:
For the statement,
IF ((OrdersTotal() > 0) && (OrderType() == OP_BUY) && (MarketInfo(Trade,MODE_BID) > OrderOpenPrice() + (30*Point)))
DT3B = true; DT2B = false; DT1B = false;
Will MT4 keep DT1B = false and DT1B = false even though in reality the actual is still true in that the market will be over OOP by 10 and 20 at that point as well? (In reality, if the market is plus 30, then it is also over 10 and over 20 as well.)
Question 2:
Once DT3B = true is activated and triggered, will it revert to false if the market falls below OOP plus 30?