TradingView
BobVanders
16 ตุลา 2018 เวลา 20 นาฬิกา 39 นาที

Strategy - Bobo's Pivot ATR Swing 

S&P 500 index of US listed sharesFXCM

คำอธิบาย

Hi there, welcome to my pivot ATR swing bot. I put this out there with source code hidden to see what ideas others have to use it. Also if there are any coders of trading systems out there who wanted to work with me to put this into a form that could trade automatically we could both use... I'd welcome that kind of collaboration and will happily share the underlying rules of this and the more highly developed version that isn't public.

But as it is, the signals are free for all, use them as you wish and at your own risk. If you want to discuss the code, strategy or ideas, I'm around fairly regularly just message.

The bot is fairly simple design that will give you signals for long and short intraday/week on equity futures / CFDs / ETFs. You'll see it backtests fairly well on an hourly SPX500 chart as configured. You will need to set up certain parameters to account for any different timeframes and markets you wish to trade. For me it's most effective pick out a few good swing trades per week in equity futures. However part of the idea of putting this in the public domain is to see if other people will have good but different ideas how to use it. Please share with me if so :).

The basic concept is a series of 3 lines that define the area and movement we wish to trade. The daily pivot is the central line (blue). We are looking to capture reversions to this middle line from extremes (red and green). Therefore the bot will signal exit at the close of every candle that has passed through the pivot.

Entry is decided by the outer bands around the blue line. Red is the top band, green the bottom. As configured, these are simply placed a daily ATR value apart, centred around the pivot. You can change this quite a lot though, so let's go through the settings:

Pivot Timeframe - simple, a daily pivot is calculated from the previous day's values (high + low + close)/3 . BUt the same calculation can be applied to any length candle, day, minute, month or whatever. This makes the middle target line more or less responsive to recent price action.

ATR Band Timeframe
- When we calculate the average range, we need to know what candle length makes up our series. Daily candles is the default, but you can change that here.

ATR Lookback - When we calculate the average range, we need to know how many instances of the timeframe (day, minute, hour etc) we look back to create an average. The lower the lookback value, the more the width of the bands (the distance from pivot) will change quickly based on the volatility of previous candles. The higher the lookback value, the more stable the band width will be to recent volatility.

ATR divisor - The ATR value above is divided by this value, before being added or subtracted to the pivot to create the red and green lines. Default value is 2, and this means the distance from the red band to the green band will be equal to 1 ATR, as calculated according to the parameters above. Setting this to 1 would mean that each band is one ATR away from pivot (ie the bands got wider apart). Set this to 4, and it means that it is only 1/2 an ATR from green to red.

Take Profit / Stop Loss. - We know what a stop and profit target are, but worth nothing that a 0 value disables stop loss or profit targets. The bot will still close positions when crossing pivot.

Also, note the mintick value of the instrument you apply this to. For example for the CFD chart SPX500 the mintick value is 0.1. So a 100 value for stop loss = 10 points on SPX500. but if you were to trade the same thing basically, but the emini future ES, the mintick value is 0.25. So for a 10 point stop on the ES chart, you would need a value of 40 in this bot. US30 and YM have convenient mintick values of 1. Currencies can be a bit of a nightmare :).

เอกสารเผยแพร่

Clearer title, no code changes
ความคิดเห็น
G13Man
so we can use , but do not get script ,
sounds fair
my programming days are gone
migraines affected me terribly when they started , memory loss
why i trade , can not work any more forgot can not remember how to
program , electrical formulas [ was actually top tech , 17 people under me ]
[sigh ]
G13Man
@G13Man, probably why i am a marginal / subsistence trader , lol
fabio10
Very interesting Bob! Good Work putting this together. Could this be used for individual stocks as well?
BobVanders
@fabio10, In theory it can work with anything, but I've not ever managed to configure it to get good results with stocks. I haven't spent a lot of time looking at that though, best results are in markets that range a lot within the timeframe you want to trade (IE price strikes the pivot often)... so rangey stocks should work if you configure it right. Strong trending markets are not an ideal condition for these signals, it will be fighting the trend.
tap1234
Hi can I access plz
BobVanders
@tap1234, You should have access and be able to add to your charts. Am I just going to give you the source script? No, not without more info. Message me directly if you want to discuss.
เพิ่มเติม