Experts: N-_Candles_v3

 

N-_Candles_v3:

The Expert Advisor searches for N identical candlesticks in a row. It buys on bullish candlesticks and sells on bearish ones.

N-_Candles_v3

Author: Vladimir Karputov

 
Automated-Trading:

N-_Candles_v3:

Author: Vladimir Karputov


Good afternoon, Vladimir. Something does not work Maximum Pozitions parameter, at least in the tester - opens as in v2 positions without limits.
 
venecpl:

Good afternoon, Vladimir. Something does not work Maximum Pozitions parameter, in any case in the tester - it opens positions without limits as in v2.

Do you have a netting account by any chance?

 
Vladimir Karputov:

Do you have a netting account by any chance?


Good day. I have an account with Otkritie broker, I don't know what netting account is, I trade futures (futures market). Maybe the problem is that when opening another trade in the same direction, MT5 averages the position, and unlike your screens, where I see a lot of trades with their price and stop, my position is averaged - the price changes, and the stop is set from the last open trade. The Expert Advisor, apparently, evaluates these two averaged trades as one and continues to open further.
 
venecpl:

Good day. I have an account at Otkritie broker, I don't know what netting is, I trade futures (futures market). Maybe the problem is that when opening another trade in the same direction, MT5 averages the position, and unlike your screens, where I see a lot of trades with their price and stop, my position is averaged - the price changes, and the stop is set from the last open trade. The Expert Advisor apparently evaluates these two averaged trades as one, and continues to open further.

"Otkritie" provides access to trading on the Exchange and in such trading type of trading accounting - netting - that is, for a given symbol in one direction can be only ONE position.

This Expert Advisor is not suitable for such a trading account.

 
venecpl:

Good day. I have an account at Otkritie broker, I don't know what netting is, I trade futures (futures market). Maybe the problem is that when opening another trade in the same direction, MT5 averages the position, and unlike your screens, where I see a lot of trades with their price and stop, my position is averaged - the price changes, and the stop is set from the last open trade. The Expert Advisor apparently evaluates these two averaged trades as one, and continues to open further.

Now I googled, yes, I do have a netting account, and apparently there are no other accounts in Otkritie. It's a pity, the robot is good. Maybe you can make an Expert Advisor with this parameter for a netting account? At the moment I optimise the parameters almost manually, but I would like to run it fully on the tester.
 
venecpl:

Now I googled, yes, I do have a netting account, and apparently there are no other accounts at Otkritie. It's a pity, the robot is good. Maybe you can make an Expert Advisor with this parameter for a netting account? At the moment I optimise the parameters almost manually, but I would like to run it fully on the tester.

You can do the following: when netting take into account not the number of positions, but the volume of minimum lots in the current position. That is, if the minimum volume of a symbol is 1.0 lot, then the input parameter "x3" will mean:

minimum volume * 3.

Then you just need to check the volume of the current open position. However, there may be nuances: complete closing of a position or even reversal.

 
Vladimir Karputov:

We can do this: when netting, consider not the number of positions, but the volume of minimum lots in the current position. That is, if by symbol the minimum volume is 1.0 lot, then the input parameter "x3" will mean:

minimum volume * 3.

Then you just need to check the volume of the current open position. However, there may be nuances: complete closing of a position or even reversal.


Yes, you are right, instead of the number of open positions you should set the maximum position volume in one direction, and then optimise the "lot" parameter, which will be obtained based on the maximum volume. I am waiting for the next version, Thank you!
 
venecpl:

Yes, you are right, instead of the number of open positions you should set the maximum position volume in one direction, and then optimise the "lot" parameter, which will be obtained based on the maximum volume. I am waiting for the next version, Thank you!

Regarding the nuances you mentioned: full closing of a position is not necessary - sometimes there are situations when there is a correction, the Expert Advisor partially closes the position,

in case of a trend continuation it opens again, in case of a deep correction it closes it completely and opens it in parts in another direction. In order not to lose profit, the number of openings and closings should be optimal.

 
venecpl:

Regarding the nuances you mentioned: full closing of a position is not necessary - sometimes there are situations when a correction occurs and the EA partially closes the position,

In case of a trend continuation it opens again, in case of a deep correction it closes it completely and opens it again in another direction. In order not to lose profit, the number of openings and closings should be optimal.


In case of a trend reversal, we have a stoploss, which closes the entire volume at once, freeing us from the need for partial closing, as well as trailing.
 
venecpl:

Yes, you are right, instead of the number of open positions you should set the maximum position volume in one direction, and then optimise the "lot" parameter, which will be obtained based on the maximum volume. I am waiting for the next version, Thank you!

Preliminary announcement:

N-_Candles_v4

Tested on RTS-9.17 on netting account - limitation on position volume (Max position volume (only for netting)) works.