Forum

[Solved] Trying to select the last closed order

Original code (it returns the first closed order from History): for(int i= OrdersHistoryTotal (); i>= 0 ; i--){ if ( OrderSelect (i- 1 ,SELECT_BY_POS,MODE_HISTORY && OrderSymbol ()== Symbol ()){ double L astTradeClose= OrderClosePrice ();}} The right one: for(int i= 0 ; i< OrdersHistoryTotal ();

How to get the min value excluding “zero”

I want to get the Minimum value from the following external variables excluding the empty fields. It could be something like this: A = 1.354; B = 3.762; C = 0.0; D = 0.0 Below the external variables and the formula: extern double A = 0.0; extern double B = 0.0; extern double C = 0.0; extern