You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
anyone help me?
here's the code:
{ if (OrdersTotal() == 0 && iRSIm51 > 70 && iRSIh41 > iRSIh42){ int ticket = OrderSend (Symbol() , OP_SELL , 0.1 , Bid , 0 ,Bid + 100*Point , Bid - 220*Point , "venda" , 0, TimeCurrent ()+ 3600 * 24 , clrRed );} } for (int i = 0; i < OrdersHistoryTotal(); i++){ if (OrderSelect(i,SELECT_BY_POS, MODE_HISTORY)== true){ // to get OrderProfit int profit = OrderProfit(); if (OrderSelect(i,SELECT_BY_POS, MODE_TRADES)== true){ // to make sure the last order made is a sell order int type = OrderType();} {if (profit < 0 && type == OP_SELL ) //if profit is negative and last operation == sell, make an ordersend ticket = OrderSend (Symbol(), OP_BUY, 0.1, Ask, 0, Ask - 100*Point, Ask + 220*Point, "compra", 0, TimeCurrent ()+ 3600 * 24, clrGreen); i++; //+1 to i since OrderHIstoryTotal is increasing by 1 for the buy order //code should've ended here and gone again to the top }I actually wanted it to wait the s/l from the order 1 and then make 1 only order, but it is making 2 sell orders first and then infinite buy orders