breakeven
Download scriptThis script is designed to automatically manage and organize your active trading positions on a specific currency pair or asset. Its primary goal is to streamline the visual workspace of your trading platform by ensuring that certain technical markers are kept clean while maintaining your existing trade parameters.
How it Works
The script performs a systematic review of all open trades currently active in your account. It scans through these positions one by one to identify two specific criteria:
- Asset Matching: It only interacts with trades involving the specific symbol you are currently viewing on your chart.
- Trade Direction: It looks for both "Buy" and "Sell" orders.
Core Actions
Once the script identifies a matching trade, it executes the following logic:
- Position Maintenance: For every qualifying Buy or Sell order, the script refreshes the order's data. While it keeps your original entry price and your set profit target (Take Profit) exactly as they are, it ensures the "Stop Loss" field is cleared and visually highlighted.
- Visual Cleanup: One of the key features of this script is its ability to declutter your screen. Every time it identifies a matching trade, it automatically removes all temporary drawing objects from the chart. This means any lines, arrows, or shapes that may have been placed on the screen by other indicators or manual actions are wiped away, providing you with a clean, unobstructed view of the price action.
Summary for the User
Think of this as an "automatic tidy-up" tool. It constantly monitors your active trades on the current chart and ensures that your trading environment remains clean and organized by removing visual clutter automatically as the script runs.
int start()
{
int totalorders = OrdersTotal();
for(int i=totalorders-1;i>=0;i--)
{
OrderSelect(i, SELECT_BY_POS);
{
if (OrderSymbol()==Symbol()&& OrderType() == OP_BUY ) {
OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice(),OrderTakeProfit(),0,Green);
ObjectsDeleteAll();
}
if (OrderSymbol()==Symbol()&& OrderType() == OP_SELL ) {
OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice(),OrderTakeProfit(),0,Green);
}
}
}
return;
}
Comments