Highest order price in "last time"

 
Hi, I need help. Seriously. Please. I'm trying to solve my problem for a couple days, but still can't solve it.

I'm trying to open trades with stoploss in direction of trend (based on moving average) on each $1 move. Like : Price is above moving average, BUY on price $5, SL $4. Price goes to $6, open BUY $6 with SL $5. Then is price goes down to $5 and hit SL of last order. Then price goes up, and I dont want to BUY on price $6, but on $7, because last highest order was on $6 (+1).

I can check all trades from HISTORY POOL and then in ACTIVE ORDERS POOL, check highest price. That is easy. But in this way I would get the highest trade in all history. I would like to check highest trade since price crossed moving average not from whole history.


I thank for all suggestions. Thank you so much and have a wonderful day.

P.S. I don't need code (would be great if you have it but ...), just need to know HOW to do it.
 

When the first trade is placed, save the time in a global datetime variable and simply check trades that have been placed later.

or

When the first trade is placed, save the price in a global double variable and simply with every new higher trade price, update the variable.

or

when the first trade is placed, open a series of buy stops.

 
Keith Watford:

When the first trade is placed, save the time in a global datetime variable and simply check trades that have been placed later.

or

When the first trade is placed, save the price in a global double variable and simply with every new higher trade price, update the variable.

or

when the first trade is placed, open a series of buy stops.

thank you for your suggestion. About 10 minutes ago, the idea with saving price came to my mind.

Thank you. It is good suggestion.

Reason: