Experts: VR Breakdown level - Trading strategy based on a breakout of the previous High or Low

 

VR Breakdown level - Trading strategy based on a breakout of the previous High or Low:

A simple trading strategy based on breakouts of prior Highs and Lows.

VR Breakdown level - Trading strategy based on a breakout of the previous High or Low

Author: Vladimir Pastushak

 

So much noise, and the code is strange in some places.

For example, the lot verification part.

// Get the minimum lot step for the symbol
  double stepvol = ::SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_STEP);
  if(stepvol > 0)
    // Calculate lot size rounded to the nearest valid step
    lt = stepvol * (int)(iLots / stepvol);
// Check if calculated lot is less than minimum allowed lot
  if(lt < ::SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_MIN))
    lt = 0.0;  // Set to 0 if below minimum (invalid)
// Return successful initialisation
  return(INIT_SUCCEEDED);
}

We got lot 0.0

Then we go to OnTick() and open a position with lot "0.0".

if(trade.Buy(lt))

This is an interesting approach, I think trading will be profitable.

--

No simple check for sufficient funds, without this check EA is scary to run even in the tester, not to mention in the demo mode

--

I don't understand the intent, why such an approach, to make it different from "like everyone else and everywhere else" --

  if(new_time != old_time)
    // Update old_time and return true (new bar detected)
    if((old_time = new_time) != NULL)
      return(true);

--

TP and SL order setting check is implemented incorrectly - if it fails, the position is left at random with zero values.



 
Vitaly Muzichenko #:

So much noise, and the code is kind of weird in some places

For example, the lot verification part

We got lot 0.0

Then go to OnTick() and open a position with lot "0.0".

Interesting approach, it will probably be profitable for trading

--

No simple check for sufficient funds, without this check EA is scary to run even in the tester, not to mention in the demo mode

--

I don't understand the intent, why such an approach, to make it different "like everyone else and everywhere else".

--

TP and SL order setting check is implemented incorrectly - if it fails, the position is left at random with zero values

Part of the code was made using help, i.e. I didn't write my own codes, but took them from off sources, so that beginner programmers could see the familiar code.

So the code is shorter by 1 line, it is more convenient and familiar to me, plus beginners will see the additional possibility of the language.

if(new_time != old_time)
    // Update old_time and return true (new bar detected)
    if((old_time = new_time) != NULL)
      return(true);

и

if(new_time != old_time)
    // Update old_time and return true (new bar detected)
      {
       old_time = new_time;
       return(true);
      }
 
Vitaly Muzichenko #:

The check for setting TP and SL orders is implemented incorrectly - in case of failure the position is left at random with zero values

What should be done with this?

My vision is to set TP and SL in any case, if we get an error that the distance is less than the minimum allowable = set it to the minimum allowable.

Now in the current form, the order is not set, and the position remains abandoned at random.

 
Hello, I saw a post that in the MT4 version of the EA the code has been fixed, but in the MT5 version has the code been fixed?
 

Hello. This Expert Advisor trades well on the lower timeframes (0-3 minutes in the settings) when the price is moving and there is no flat, on the higher timeframes it does not open the grid in a timely manner and goes into drawdown.

I raced it on demo, in it it is necessary to insert trawl-stop it is possible to use external trawl and distance of opening of a grid of orders to correct to add in settings, as with external trawl it trades in plus without stop on distance (without trawl in settings of owl one take profit without stop to the order at opening is not attached), and with small distance of opening of orders in flat it goes into drawdown.

It seems that there is an error in it because of uneven opening of the number of opposite orders to form a lock and reduce the drawdown (opening orders when breaking the level of the previous candle and after a certain distance are different things, as a long minute candle can shoot out and no order will be opened for a profit or for a lock), if the number of such orders is specially uneven, a more accurate entry and opening of the first order according to the trend indicator with fixing the total profit and closing the entire positive grid. It would be desirable. that it did not go into drawdown without a stop due to more accurate opening of orders and accurate varnishing, perhaps add a coefficient of lot increase and decrease automatically to quickly achieve a profit and close the entire grid.

 
At one profit without a stop in the settings, it does not set a profit to orders at all, that is, orders are not closed grid grows and eventually goes into drawdown.