Add volume causing buy/sell sequence issues
-
Add volume causing buy/sell sequence issues
At every PSAR cross there should be either:
- Close all positions if basket in profit, then open new position at 0.01
or
- Open new position but at increased volume, as below:
0.01 - BUY
0.02 - SELL
0.03 - BUY
0.04 - SELL
0.05 - BUYThis continues until one of the close conditions are met.
When I include 'For Each Trade' -> 'Add To Volume' it is opening a BUY when it should be a SELL, so I have two consecutive BUYS.
I removed the 'For Each Trade' -> 'Add To Volume' and replaced with a 'Sell Now' and it works OK, so the issue is with the add volume part.
So basically, if the last trade was a buy then I need to open a sell at a higher volume, not add another buy at a higher volume.
Can anyone point out where I'm going wrong please?
-
@maximump One first question, please. Are those opening conditions working correctly? Apparentñy they are doing its job well. Can you please confirm it?
-
They work fine if I remove the add volume section and replace with a simple buy now / sell now. Something about the add volume is messing things up.
I suspect it's because add volume looks to the last position and decides what to do based on that rather than the buy/sell conditions. For example, if the last position was buy then the next open position (when PSAR reverses) should be sell, but add volume looks at the most recent (a buy) and adds volume to that so there are two consecutive buy positions.
Basically, I think I need the correct way to increase volume that doesn't use add volume.
-
@maximump Then I cannot how to do that. I only know two ways to add volume: using that block or opening a new trade. Would the second option be valid for you?
-
Anything that would add additional positions as follows would be valid:
0.01 buy
0.02 sell
0.03 buy
0.04 sellClose condition met, then new positions (following No Trade) is 0.01, and so on.
-
@maximump But how many trades are supposed to be open at the same time?
-
@l-andorrà There is no limit to the number of open positions, other than free margin.
It continues to add a position (opposite direction to last) at a higher volume if the close condition isn't met at the PSAR cross.
All positions are closed if collectively in profit at the PSAR cross, or the equity exceeds the balance by x amount, otherwise an additional position is opened.
-
@maximump Then you will need a structure like this one used in my martingale EA:
https://fxdreema.com/shared/477GtKlKb
However, you will need to modify block ID 52 (on the 'on trade' tab). Theer I multiply each previous lot by. You should add +0.01 instead.