Below is a snip of a section of my automated strategy.
This bot focuses on entering short trades only.
"Benchmark" - is used as a level that is set manually from technical/fundamental analysis, while all other inputs are essentially offsets.
The Profit Target is set to One point away while the Stop Loss is also set to One point away from the "ShortEntry".
What I want is:
When the bot enters a trade and takes its One point profit target, then great, we take profit and the strategy will place another order when my Benchmark is reached again.
and
After we have our first realized loss, before placing the next order, the bot will look at the AccountItem.GrossRealizedProfit and divide it by 100 (100 is derived from the currency amount that one /ES point is worth based on how many contracts you trade, in this case: OrderQuantity = 2 or $100 per point.). The result from this math is essentially the amount of points lost during the life of the strategy. Now, the points lost from that trade, or "LossInPoints" should then be added to the profit target on the next trade.
It seems to only work for one loop, so when we have one loss before reaching profit it will add one extra point on the next trade. Then after that if we have three losses before reaching profit it should add three extra points but it adds only one point again.
How can I have the profit target update after the first loop and so on?

Comment