Myestimatedvol = volume*(CurrentHour-21)
// Conditions to enter long positions
c1 = close > close[1]*1.035
c2 = close[1] <= close [2]*1.02
c3 = close[2] <= close [3]
c5 = average[7]/average[65]>=1.05
c6 = Myestimatedvol>volume[1]
IF NOT LongOnMarket AND c1 AND c2 AND c3 AND c5 AND C6 THEN
BUY 10 CONTRACTS AT MARKET
ENDIF
// Stops and targets : Enter your protection stops and profit targets here
SET STOP LOSS LOWEST [0]
// Conditions to exit long positions
c7 = close >= POSITIONPRICE*(1+(LOWEST[0]-POSITIONPRICE)/POSITIONPRICE)*4)
If LongOnMarket AND c7 THEN
SELL 5 CONTRACTS AT MARKET
ENDIF
// conditions to trail the rest
c7 = close >= POSITIONPRICE*(1+(LOWEST[0]-POSITIONPRICE)/POSITIONPRICE)*4)
If LongOnMarket AND c7 THEN
SET STOP %TRAILING 5
ENDIF
I tried with your suggestions and now the first part, until “Condictions to exit long positions” seems to be fine. But I get a missing character warning first line of “conditions to exit long positions (line 17).
The conditions for exiting the positions I want is: at 4R, close 50% of position and trail the rest either by lows of the day or 5% (the code I put is with 5%). I’m not completely suremy code is fine for this conditions, but I think it is.
Help would be appreciated!
Will the “Myestimatedvol” condition I added work? Is basically the same the “estimatedvolume” one does?
Line 17: you seem to have only 2 “(” for 3 “)”, that would be your missing character (same for line 23)
There’s a missing “(“.
I could tally 2 “(“s and 3 “)”s.
Your Estimatedvolume is similar, though not the same, to PRT’s.
In a 1h TF that started 10 minutes ago it should be:
MyEstimatedVol = volume * (60/10)