Nasdaq has a minimum position of 1.
No, 0.5 ist also possible. Maybe 0.5 is the smallest unit
It used positionprice[1] and when there’s no market position and opened a new one it went off the rails.
I ran some quick tests and using positionprice[0] definitely works better with the sensitivity settings and is more consistent with Roberto’s mod.
Strangely though, with ts2sensitivity = 0, I’m seeing better performance using positionprice[1] … which doesn’t really make sense. I’ll do some more tests with other algos.
If I set custom trading hours in PRT that matches the exchange, for Nasdaq UTC-4. I just set the regular trading hours (9:30-16:00) in the script?
Not sure how custom trading hours works tbh. I always run PRT on my computer time and then adjust the algos accordingly as different indices are optimal at different times.
Bear in mind that positionprice[1] is NOT the average price before the last position accumulated, but the value that positionprice retained the previous bar. They may, or may not, be the same. They will different anytime a new position is added, otherwise they will be the same.
It’s not equivalent to Dclose and Dclose(1) which will always differ.
I keep seeing that he makes many entries in a row without closing the first ones. For that you have to have a large capital. I have also tried reducing the 0.4lotti, but it keeps coming in with 1lotti. Can you help me please? is there something that escapes me?
This was designed to run with cumulativeorders=true so yes it will make more entries. If you don’t want that, you can change cumulativeorders=false or you can set MaxPositionsAllowed = 1*positionsize
In demo mode the min position on US Tech 100 is 1, when running live min position is 0.5
PaulParticipant
Master
thnx for looking into it.
If using positionprice[1] and sensitivity 0 or 1, you find in the detailed rapport a lot of very short trades of mainly 3 bars with a no cumulative orders algo.
mmm it seems with your algo, using positionprice[0], you still have a lot off trades of 0 bars, but that must be a bug in the detailed rapport because of cumulative orders. Was mentioned somewhere?
positionprice[1] works not (always) as it is supposed to, visible when using graphonprice newsl with sensitivity 0 or 1
Thank you first. I knew about FLASE Y TRUE and it works well. But I have observed that if we put MaxPositionsAllowed = 1 * positionize it makes 2, if we put MaxPositionsAllowed = 2 * positionize it makes 3 at most … that is, it always makes one more as I see in the tests.
Thanks for the work you do nonetheless
You can change
COUNTOFLONGSHARES <= MaxPositionsAllowed
COUNTOFSHORTSHARES <= MaxPositionsAllowed
to
COUNTOFLONGSHARES < MaxPositionsAllowed
COUNTOFSHORTSHARES < MaxPositionsAllowed
variation on the 1m version for forward testing.
Thanks @nonetheless I have learned something new. Thank you very much
Now to try in demo the last version that you have uploaded today. Do you have it on real?
Nonetheless, take a look at the entry conditions in v7.5. There should be SL and TP for the first position as well, not only for the additional, right?
// Conditions to enter long positions
IF not longonmarket and Ctime and c1 and c1a AND C3a and c3b and c3c AND C5a and c5b THEN
BUY positionsize CONTRACT AT MARKET
elsif longonmarket and Ctime and c1 and c1a and c3 and c3a and c5 and COUNTOFLONGSHARES < MaxPositionsAllowed then
BUY positionsize CONTRACT AT MARKET
SET STOP %LOSS 1.4
SET TARGET %PROFIT 1.5
ENDIF
Hmm, I had assumed that the stop and target would apply to everything within that IF … ENDIF, but adding it again at line 4 does give a different result
// Conditions to enter long positions
IF not longonmarket and Ctime and c1 and c1a and c1b AND C3a and c3b and c3c AND C5a and c5b THEN
BUY positionsize CONTRACT AT MARKET
SET STOP %LOSS sl
SET TARGET %PROFIT tp
elsif longonmarket and Ctime and c1 and c1a and c3 and c3a and c5 and COUNTOFLONGSHARES < MaxPositionsAllowed then
BUY positionsize CONTRACT AT MARKET
SET STOP %LOSS sl
SET TARGET %PROFIT tp
ENDIF
unfortunately though the result was slightly worse. I’m not sure which is technically correct but I think I’ll keep it the way it is for now. It seems to behave as expected in trading.
I added a default macd with no optimisation as an additional confirmation. Less max profit but less drawdown and higher Avg profit/loss ratio.
Only tested for 100k, i just cant get it to work on premium 200k. What instrument is it? dow jones industrial average? not working. If someone can advice me that’d be helpful.
PaulParticipant
Master
200k, the mod uses an addition that for each cumulative position, the trigger to activate the trailingstop get’s lower. Not sure If I leave it in or if this strategy is suited for that addition.
if countoflongshares=0 or countofshortshares=0 then
trailingpercentlong = 0.35 // %
trailingpercentshort = 0.38 // %
endif
if countoflongshares>0.2 then
trailingpercentlong = max(0.1,trailingpercentlong-(countoflongshares*0.02))
endif
if countofshortshares>0.2 then
trailingpercentshort = max(0.1,trailingpercentshort-(countofshortshares*0.02))
endif
once accelerator = 0.03 // 1 = default; always > 0 (i.e. 0.5-3)
once accelerator2 = 0.1 // 1 = default; always > 0 (i.e. 0.5-3)
once ts2sensitivity = 0 // [0]close;[1]high/low;[2]low;high
//====================
once steppercentlong = (trailingpercentlong/10)*accelerator
once steppercentshort = (trailingpercentshort/10)*accelerator2
if onmarket then
trailingstartlong = positionprice[0]*(trailingpercentlong/100)
trailingstartshort = positionprice[0]*(trailingpercentshort/100)
trailingsteplong = positionprice[0]*(steppercentlong/100)
trailingstepshort = positionprice[0]*(steppercentshort/100)
endif
Which variable must be modified to divide by 2 or by 3 the maximum losses of the NAS-1M-HULL-SAR-v7.5 strategy ?