vastavista
Active Member
- Messages
- 2,327
- Joined
- Jun 20, 2010
- Messages
- 2,327
- Reaction score
- 191
- Points
- 33
Salam..
Aku lama fikir-fikir..tapi tk dapat ilham nk wt cami..
katakan kt history bulan ni aku dh dapat profit usd20.
yg dh close:
kemudian..
position yg blum close masih dibawah negatif -USD10..
Yg masih floating
Jadi aku nk close All supaya aku dpt la untung USD10 tanpa floating..
Ada idea tak..?
Tapi tk tk jalan gk..
Code untuk close All..
Code untuk tgok bulan ni sampai target:-
Aku lama fikir-fikir..tapi tk dapat ilham nk wt cami..
katakan kt history bulan ni aku dh dapat profit usd20.
yg dh close:
kemudian..
position yg blum close masih dibawah negatif -USD10..
Yg masih floating
Jadi aku nk close All supaya aku dpt la untung USD10 tanpa floating..
Ada idea tak..?
Code:
ld_36 = AccountEquity() - AccountBalance();
if (profitofthemonth() - (-ld_36) >= profitofthemonth() / 2) {
CloseBuySellSymbolAll();
**
Tapi tk tk jalan gk..
Code untuk close All..
Code:
void CloseBuySellSymbolAll() {
for (int l_pos_0 = OrdersTotal() - 1; l_pos_0 >= 0; l_pos_0--) {
OrderSelect(l_pos_0, SELECT_BY_POS, MODE_TRADES);
if (OrderType() == OP_BUY) OrderClose(OrderTicket(), OrderLots(), Bid, g_slippage_96, Blue);
if (OrderType() == OP_SELL) OrderClose(OrderTicket(), OrderLots(), Ask, g_slippage_96, Red);
Sleep(5000);
**
**
Code untuk tgok bulan ni sampai target:-
Code:
double profitofthemonth() {
double l_hist_total_0 = OrdersHistoryTotal();
double ld_ret_8 = 0;
for (int g_pos_272 = 0; g_pos_272 < l_hist_total_0; g_pos_272++) {
OrderSelect(g_pos_272, SELECT_BY_POS, MODE_HISTORY);
if (OrderMagicNumber() != g_magic_192) continue;
if (OrderMagicNumber() == g_magic_192) {
if (TimeMonth(OrderOpenTime()) == TimeMonth(TimeCurrent()))
if (TimeYear(OrderOpenTime()) == TimeYear(TimeCurrent())) ld_ret_8 += OrderProfit();
**
**
return (ld_ret_8);
**
Last edited: