%Stop @ -2%
Forums › ProRealTime English forum › ProOrder support › %Stop @ -2%
- This topic has 6 replies, 3 voices, and was last updated 6 years ago by
Inertia.
-
-
05/13/2019 at 5:57 PM #98379
Hi all !
I’d like to create a %Stop @ -2% (like today for instance) but from the “Dopen”.
Why? Cause most of the time, the instrument bounce back a bit from the specific % amount of distribution…
It should be something like the following but I have trouble replacing the (0) by the correct value…
Any help please ?
Thank you 😉
% Stop loss when -2% reached ...123456// Conditions pour fermer une position en vente à découvertc1 = (DOpen(0) < 0)IF c1 THENEXITSHORT AT MARKETENDIF05/13/2019 at 6:04 PM #9838205/13/2019 at 8:18 PM #9840105/13/2019 at 8:24 PM #98402From 1.0 onwards C1 will be false and there will be no exit due to stop loss.
I think you also added some target profit.
I am not sure I could understand what you really meant.
1 user thanked author for this post.
05/13/2019 at 9:13 PM #98406Hi Robertogozzi,
Thank you for your time !
Your are right, it should mostly have a second “%TP” from the “Dopen” this time !
Not a %stop cause it’s a short position :/ ! My mistake…
So the strategy should then have “technically” two %Target Profit with and IF somewhere in the middle I suppose…like and OCO order.
- (1) SET TARGET %PROFIT 1 like the code
- AND
- (2) If the TP (1) is not triggered then (2) … c1 = close <= (DOpen(0) * 2%)
Is it clearer Roberto?
Good night and thank you for your help.
Description12345678910111213141516171819202122232425262728IF (c1) AND (c2) AND (c3) AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry THENSELLSHORT positionsize CONTRACT AT MARKETENDIFc4 = close <= (DOpen(0) * 0.8)IF c4 THENEXITSHORT AT MARKETENDIF//trailing stoptrailingstop = (close*0.0045)/pointsizeif not onmarket thenMINPRICE = closepriceexit = 0endifif shortonmarket thenMINPRICE = MIN(MINPRICE,close)if tradeprice(1)-MINPRICE>=trailingstop*pointsize thenpriceexit = MINPRICE+trailingstop*pointsizeendifendifif onmarket and priceexit>0 thenEXITSHORT AT priceexit STOPSELL AT priceexit STOPendifSET STOP %LOSS 0.5SET TARGET %PROFIT 105/13/2019 at 9:19 PM #98407In your code this is a 20% gain on a short:
1234c4 = close <= (DOpen(0) * 0.8)IF c4 THENEXITSHORT AT MARKETENDIF2% would be 0.98 as Robertogozzi already said.
This condition whether 2% or 20% will never be hit if you also have SET TARGET %PROFIT 1 in your code – which you do have.
1 user thanked author for this post.
05/13/2019 at 9:37 PM #98408 -
AuthorPosts
Find exclusive trading pro-tools on