I have a number of questions and ideas in regards to what I would like to implement into the Strategy testing I am doing and hoping someone can help me figure them out.
1. MACD Crossovers:
I am trying to utilize one of my strategies to enter long/short based on how the MACD line crosses over the average line, but there are instances where a trade might occur 3 bars in a row (each getting stopped out in the same bar they began in), because the MACD line is just barely breaching the average line, either barely breaking below to go short, or barely breaking above to go long. There have been instances where this has happened for 3 bars in a row, where the MACD line never truly crosses over the average line, yet I get stopped out of 3 different short positions because of it. Is there any way to avoid this without changing the way the strategy/MACD is calculated to "bar close"? I am trying to have everything be calculated by "each tick" to be as accurate and precise as possible.
2. Selective Orders:
Following up the situation from above, is there a way to selectively remove orders from happening if the MACD line is effectively moving in a flat manner? i.e If the slope or gain/fall of the MACD line is near 0%, can I use this parameter in some way to eliminate these trades from going through? Ideally, I would like only the trades that are clearly breaking through the average line to be taken, and none where the MACD line is essentially flatlining.
3. Order Reversals:
Is there a way to set up in Strategy Builder where if a stop loss is hit, a reverse position is immediately entered, but perhaps at a different profit/stop loss target? I.e, if I enter a long position with a profit goal of 8 ticks and a stop loss of 12 ticks, if I get stopped out, is there a way for a reverse order to be placed immediately with say a profit goal of 4 ticks and stop loss of 6 ticks for example?
4. Enter+Exit Positions:
I've also been compiling a different strategy that essentially looks at the MACD's momentum or current trajectory and acts upon it sooner without having to wait for any form of crossover. I've attempted this by asking the strategy to enter a long position if the MACD value 0 bars ago (i.e current bar) is greater than the MACD value 1 bar ago. On the other side, I have a LongExit condition set that links to my LongEnter position, and exits when the MACD value 0 bars ago is less than the MACD value 1 bar ago, i.e when the momentum of the MACD is swinging in the other direction.
Conversely, I've attempted the same strategy with short positions, where I have the strategy execute a short if the MACD value 0 bars ago is less than the MACD value 1 bar ago and vice versa for the exit strategy. Oddly enough, no matter what I try, when I enable the strategy, only the long positions ever execute. Why is this or how can I fix it?
Also, is there a better, or more accurate way of achieving what I am attempting here in regards to capturing the momentum swings? As you can see from the screenshot I attached, in the first Long Entry, where the Long position is initially exited should not have happened until 5 bars later seeing how the MACD line never decreased during that time span. Also, during the second Long Exit, based on my conditions stating that when the MACD (0) is less than MACD (1), this second long exit happens a full bar late based on how the MACD peaked on that last green bar and dropped immediately in the next bar.
How can I better capture this movement within the strategy builder or am I using the "bars ago" function incorrectly? It just seems that often the orders are delayed by a full bar from where I believe they should enter/exit based on the conditions I have set. And of course, you can notice that after the second Long Exit, that no short position was entered for whatever reason.
5. Target Order + Runner:
If I wanted to combine my above enter+exit strategy with some profit/stop losses, how could I submit an order for say 2 contracts, one with a target of 20 points for example and a set stop loss of 10 points, with the second contract either having a much larger target of lets say 50 points and a stop of 10, or just setting the second contract with a trailing stop of 10-15 points? I've tried inputting another "do action" under my Enter Long set of conditions, but the problem I'm having, is when an entry triggers, and I am now in a position with 2 contracts, if one contract hits its target or stop loss, I would like there to be only the one remaining contract open until it is closed. What I am finding, is if one hits its target or stop, and the conditions are right, a 3rd contract might open while the initial "runner" is still active. Is there a way to limit this such that one my initial entry of two contracts begins, that no other entries may occur until they have both exited?
****
I know there is a lot of information here and a lot of questions, but I really appreciate anyone who takes the time to help me out here. Spending my evenings now just tinkering with this Strategy Builder and running backtests and feel I can get a decently profitable strategy going if I can figure out these quirks.
Thanks again
Comment