Does anyone know of a way to have an exit signal based on the bar that caused the entry signal?
For example:
If the bar that caused the entry signal was size A (close minus open) then set the profit target equal to size B (open minus close * 2) of that specific bar though. That is the key, I have it so that it moves along looking at the last bar and doing that calculation, however, I need it to fix on the original bar.
Any ideas?
Thanks in advance
Can you help answer these questions from other members on futures io?
Logic being the target will continually update until you enter a position, presumably at bar open, then target will keep referring to the prior target figure until the position is closed. Anyone feel free to correct me if that is wrong or better way to do it.
The following user says Thank You to vegasfoster for this post:
Apologies - this is quite a bit over my head at the moment. The scripts that I am writing are a lot simpler.
Do I replace the SetProfitTarget line with this? If so I am getting the following errors:
The name "math" does not exist
The name "target" does not exist
Or do I need to define the following terms somewhere?
Thank a lot for your help,
Todd
The strategy is very short term in nature. It is only concerned with the most recent level of volatility and it should complete within 1-3 bars after the trade takes place (ideally). If we're in the middle of a strong move the target should be larger, if we're in a consolidation phase the target may be very small.