The code provided is a function called "HisTPSL" that returns an integer value.

The function iterates through the order history in reverse order, starting from the most recent order and going back to the oldest order. It uses a for loop with the variable "pos_8" initialized as the total number of orders in the history minus one.

Inside the loop, the function selects each order using the OrderSelect() function. It then checks if the selected order's symbol matches the current symbol and if its magic number matches the variable "magic".

If both conditions are met, it increments the variable "count_4" and checks if it is less than 2. If so, it checks the order's profit using the OrderProfit() function. If the profit is greater than 0.0, it assigns the value 0 to the variable "Li_ret_0". If the profit is less than 0.0, it assigns the value 1 to "Li_ret_0".

Finally, if "count_4" reaches 2, the loop breaks. The function then returns the value of "Li_ret_0".

Note: The code assumes that the variables "magic" and "Symbol()" are defined and accessible within the function

int HisTPSL int Li_ret_0 = -1; int count_4 = 0; for int pos_8 = OrdersHistoryTotal - 1; pos_8 = 0; pos_8-- OrderSelectpos_8 SELECT_BY_POS MODE_HISTORY; if count_4 2 && OrderSymbol =

原文地址: https://www.cveoy.top/t/topic/hBi5 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录