tomParticipant
New
Hi Team, recently started playing around with building a trade system, however run in some behaviour i can’t explain.
I built a simple indicator:
If 2 consecutive green bars, return 1, if 2 consecutive red bars, return -1
Then I added a very simple trading system. Buy when the indicator returns 1, sell when indicator returns -1. It also draws a black arrow on the graph in these instances.
I also configured simple SL and TP.
When I run the system on dax against past data (21 ticks), i get seemingly weird behaviour. a buy or sell should occur at the start of the next bar according to my understanding, but this is not always the case. also some buy/sells seem to happen in middle of nowhere. Any thoughts what I’m missing?
Do the problem exist on a time based timeframe? such as a 1 minute one for instance?
Also, please share the indicator’s code to get a complete understanding. Thank you.
tomParticipant
New
Hi Nicolas,
not sure for the 1 minute. Are you saying it’s because I’m at a ticks based timeframe? Is that supported by PRT?
Please find hereby the code.
currentopen = open
currentclose = close
currentrange = currentclose - currentopen
currentRSI = RSI[14](close)
IF (currentrange > 0 and subsequent >= 0) or (currentrange = 0 and subsequent > 0) THEN
subsequent = subsequent + 1
ELSIF (currentrange < 0 and subsequent <= 0) or (currentrange = 0 and subsequent < 0) THEN
subsequent = subsequent - 1
ELSE
subsequent = 0
ENDIF
IF subsequent = 2 and (currentRSI-PreviousRSI >= 0) THEN
output = 1
DRAWARROWUP(barindex, open)
ELSIF subsequent = -2 and (currentRSI-PreviousRSI <= 0)THEN
output = -1
DRAWARROWDOWN(barindex, close)
ELSE
output = 0
ENDIF
previousRSI = currentRSI
return output
Cheers
Tom
Non time-based chart are not compatible with real automatic trading (such as the ticks chart), but it works in backtests. I think that the differences you get between the indicator and the ticks chart are coming from the fact that the data history between ProBacktest and ProBuilder are not starting from the same exact tick, depending on how much bars are displayed on your price chart.
21 ticks chart are automatically rebuild from 1 tick chart each time they are loaded.
Test the strategy on a 1 or 5 minutes timeframe to see if the differences still occur.
tomParticipant
New
Mmm, ok, This was just a simple test. was looking to build something for scalping. 1 minute timeframes therefore would not be granular enough. Any plans to add tick based automated trading?
Thanks for the quick reply.
Cheers
Tom