[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 170

 
What 50/50? Run through the long story without being lazy, calculate the probabilities and best tp/sl - and take money out of the market if you see an opportunity
 
who knows how to find out the ibarshift of the last visible bar on the chart?
 
polsvv:

The question is this.

Is it possible to draw not only arrows on the chart at the trade opening point, but also arrows on the trade exit point and the line between entry and exit point during a real trade, like during a tester run???


https://www.mql5.com/ru/code/8804
 
eddy:
Who knows how to find out the ibarshift of the last visible bar on the chart?
it is zero, if I understand the question correctly.
 
from the end of the last one) we're looking at the end of the story
 
sealdo:

Eh, sometimes (as always :), it bounces so nicely off the level before a sharp bounce.

According to my lazy observations, price should form a fractal, then break through it very sharply and fly off further.

And in the end there will probably be those unevenly distributed 50/50 again :(

Who trades on such bounces?

Anything of interest here?
 
DhP:

Don't be lazy to run through all the DCs and you'll find that there are a lot of them.

Google will help you.


Alpari
 

Hi all! I have a question: in this function for two positions (buy and sell) I set stop-loss so that for sell SL=open buy+18 pips, and vice versa for buy:

void SimpleLock(string sy="", int mn=-1) {
  double po, pp, ops1=0, ops2=0, opb;
  int    i, k=OrdersTotal();

  if (sy=="0") sy=Symbol();
  for (i=0; i<=k; i++) {
    if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {
      if (OrderSymbol()==sy || sy=="") {
        po=MarketInfo(OrderSymbol(), MODE_POINT);
        if (mn<0 || OrderMagicNumber()==mn) {
          if (OrderType()==OP_SELL) {
            opb=OrderStopLoss();
            ops2=NormalizeDouble(OrderPrice(OP_BUY),Digits);
            if (ops2>0 && opb!=0) {
                ModifyOrder(-1, ops2+18*po, -1);
              }
            
          }
          if (OrderType()==OP_BUY) {
            opb=OrderStopLoss();
            ops1=NormalizeDouble(OrderPrice(OP_SELL),Digits);
            if (ops1>0 && opb!=0) {
                ModifyOrder(-1, ops1-18*po, -1);
              }
            
          }
        }
      }
    }
  }
}

Opening prices of opposite positions are obtained from the function:

double OrderPrice(int type) {
   double price;
   int i, k=OrdersTotal();
      
      for (i=0; i<k; i++) {
         if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {
            if (OrderType()==type) {
            price=OrderOpenPrice();
            }
         }
      }
   return(price);
}

We know the ModifyOrder function as a standard KIMIW function, we use it to set the calculated stoplosses...

The question is that the EA sets stoplosses only for a sell and not for a buy? Who thinks so?

 
eddy:
from the end of the last one) we're looking at the end of the story
WindowFirstVisibleBar( ) does what you want.
 
todem:

The question is that the EA only sets the stoploss for a sell, but not for a bai??? Who thinks so? I'd appreciate it.

What's in the log? If there are errors, check it out. If not, put prints in the code and see why your condition does not work.
Reason: