ProBack test – Exit Trade during bar
- This topic has 3 replies, 2 voices, and was last updated 2 years ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
Forums › ProRealTime English forum › ProBuilder support › ProBack test – Exit Trade during bar
Hi,
Is it possible to exit a trade when the ask price crosses a level rather than having to wait fore the closed price?
If this is possible how do i modify this?
1 2 3 4 5 6 7 |
// Conditions to exit long positions indicator28 = ExponentialAverage[50](close) c22 = ( CROSSES OVER indicator28) IF c22 THEN SELL AT MARKET ENDIF |
You can achieve that by using multiple time frames, so you can access, say 1-hour candle, every minute or every second.
Searching this forum for MTF will return you many useful articles, examples and code snippets.
My coding is in its infancy along with my knowledge of Probacktest. I can’t seem to find what I’m looking for.
Can you do this in the simplified or must you do it in creation by programming?
Based on PRT attachement above my default timeframe is 2m.
I want to exit the trade when price crosses the 20ema or a.s.a.p
Am I write in thinking that I need to select a lower T/F (lets say 1 second) & we can use 1s closed bars to trigger the exit.
How would this code be written?
There you go:
1 2 3 4 5 6 7 |
timeframe(default) // Conditions to exit long positions indicator28 = ExponentialAverage[20](close) c22 = (CROSSES OVER indicator28) IF c22 THEN SELL AT MARKET ENDIF |
append it to your code and run it on a TF lower than 2 minutes (and of which 2 minutes is a multiple, say 10 secondfs or 1 second).