[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 144

 
Tried it, still can't fool the brain...there's probably no such thing, ok, but is writing to a specialist a long one or not?
 
shuli:
Tried it, still can't fool the brain...there's probably no such thing, ok, but is writing to a specialist a long one or not?


If your Expert Advisor is losing, it does not mean that if you do the opposite, you will make a profit)))
 
Sepulca:


If your Expert Advisor is losing, it does not mean you will make a profit if you do the opposite))).

From my experience, I can tell you that you can take a profitable EA, turn it upside down, and it will still be profitable. If you take a losing EA and invert it, it will still be losing. This is the paradox
 
Sepulca:


If you have an EA, it does not mean that if you do the opposite, you will make a profit))))
So there is no advisor, I'm nowhere has not written that trades an advisor, all my hands, I want to trade as usual, but only that the script or expert open transaction opposite to mine, ie mine would not open that at all, but the opposite. If I have not done it or it is difficult to do, tell me, I will understand. I just asked yes, yes, no, no.
 
supernyb:

I can tell you from experience that you can take a profitable EA, flip it over and it will still be profitable. If you take a losing EA and invert it, it will still be losing. This is a paradox

Yes, I know about this paradox, I searched the forum for what I want and found a lot of such proposals and studies, but this is not what I want.
 
How do I know the profit of the last trade? Thank you in advance.
 
arabon:
How do I know the profit of the last trade? Thanks in advance.
See Kim's "Useful Functions", do a search! It's almost all there.
 
shuli:
I want to trade as usual, but only for the script or expert to open a deal opposite to mine, i.e. mine would not open at all, but only the opposite one. If I have not done it or it is difficult to do, tell me, I will understand. Just asking yes, yes, no, no.
You're doing it with your hands. Well, you've got your hands in the air. You don't have to do everything the other way around. Why, say, instead of "open" close, if nothing is open. For example, you think you have to open buy, then open sell, vice versa. Good luck, i.e. a lot of g...!
 
borilunad:
You act with your hands. So you have your "hands in the air"! You don't have to do everything the other way round. Why, say, instead of "open" you should close if you have nothing open. For example, you think that you have to open buy, then open sell, vice versa. Good luck, i.e. a lot of g...!
I appeal to you as a programming professional, tell me if such a script or expert is difficult to write or not? (the rest of the statement is unnecessary - all people are different)
 
borilunad:
See Kim's "Useful features", do a search! It's almost all there.

Unfortunately, I couldn't find it. There was something similar, but not the same...


Will this code work?

double CalculateProfit_last() {//прибыль от последенй сделки
   double Profit = 0;
   int cnt;
   if(OrdersTotal()!=0)
   {
   cnt = OrdersTotal() - 1;
      OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber)
         if (OrderType() == OP_BUY || OrderType() == OP_SELL) Profit = OrderProfit();
    }
    Profit=0.0;
   Print(Profit);
   return (Profit);
}