Jump to content

Well, Tom Bombadil? Sing us a new song.


Recommended Posts

The following code is Pinescript (you can use it on tradingview.com).  It is the 'famous' 4-9-18 (E)MA crossover strategy.

Quote

//@version=4
strategy("3 MAcross_alert", shorttitle="MAcross_Alert", overlay=true)
EMA_Fast =input(4, minval=1) // To input period for 1st sma, default period set as 10
EMA_Medium =input(9, minval=1)
EMA_Slow =input(18, minval=1)
s1=ema(close,EMA_Fast) // sma values stored in s1 and s2 variables
s2=ema(close,EMA_Medium)
s3=ema(close,EMA_Slow)
plot(s1, color=#2196F3,linewidth=2) // Plots the MA
plot(s2, color=#FF9800,linewidth=2)
plot(s3, color=#9C27B0,linewidth=2)
long= crossover(s1,s2) and s2 > s3 // Define our buy/sell conditions, using pine inbuilt functions.
//long= close > s1 and s1 > s2 and s2 > s3
short= crossunder(s1,s2) and s1 < s2
//short= close < s1 and s1 < s2 and s2 < s3
//exitLong = crossunder(s1,s2)
exitLong= close < s3
exitShort = crossover(s1,s2) and s2 < s3
strategy.entry("long",strategy.long,when=long) // Buys when buy condition met
strategy.close("long",when=exitLong)
strategy.entry("short",strategy.short, when = short ) // Closes position when sell condition met
strategy.close("short",when=exitShort)

 

Try applying it to the various indices on a 15 minute time frame.

For example on the U.S. 30, 15 minute time frame, it gives this:

Net Profit
ALL
$ 2852.40
2.85 %
LONG
$ 3318.70
3.32 %
SHORT
$ 466.30
0.47

 

I did manage to tweak the exit conditions to get this to generate profit going short as well as long but I've forgotten what it was.  Otherwise you would only ever take long trades on this market.

The maximum drawdown was $ 2160.60

The real kicker though, is the equivalent buy and hold profit: $ 25609.35

Interestingly - if you apply it to other indices such as Australia 200 and French 30 the exact same system generates a pure loss (it makes profit on several others)  Hence, the same MAs on the same time frame do not generate results for different securities that are remotely similar.  (So much for the techniques of TA being applicable to everything.)

Link to comment
20 hours ago, dmedin said:

the same MAs on the same time frame do not generate results for different securities that are remotely similar

 

And there's nothing to suggest that these EMAs will keep on working on the DJIA into the future, either. 

So, we have made another discovery: the same TA approach, applied to different markets, different times, or the same market at different times, provides completely different results.  :D 

Link to comment

The search goes on though.  Why?

With buy and hold we typically have to buy an ETF.  There are plenty of S&P 500 ETFs, but few for indices like Nasdaq and Dow Jones.  (I found a good Nasdaq ETF, but it's about $500 for a single share.)

Also, we have no chance of profiting from shorting unless we buy short ETFs, which are probably more arcane and pointless even than spread betting.

Also, we have no exposure to FX or commodities if we buy and hold.  But then again, why should a fat smelly punter sitting at home in his underpants (like me) have 'access' to complex financial instruments in the first place :D 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • image.png

  • Posts

    • We are together on this trade, the 24 hours trading volume is interesting, I believe it will make a nice price trend.
    • Fits in well with my cycle low expectation  
    • Natural Gas Mode - Impulsive  Structure - Impulse Wave  Position - Wave (iii) of 5 Direction - Wave (iii) of 5 still in play   Details:  Price now in wave iii as it attempts to breach 1.65 wave i low. Wave (iii) is still expected to extend lower in an impulse.   Natural Gas is currently breaching the previous April low, marking a decisive move as the impulse initiated on 5th March continues its downward trajectory, further extending the overarching impulse wave sequence that commenced back in August 2022. This decline is anticipated to persist as long as the price remains below the critical resistance level of 2.012.   Zooming in on the daily chart, we observe the medium-term impulse wave originating from August 2022, which is persisting in its downward trend after completing its 4th wave - delineated as primary wave 4 in blue (circled) - at 3.666 in October 2023. Presently, the 5th wave, identified as primary blue wave 5, is underway, manifesting as an impulse at the intermediate degree in red. It is envisaged that the price will breach the February 2024 low of 1.533 as wave 5 of (3) seeks culmination before an anticipated rebound in wave (4). This confluence of price movements underscores the bearish sentiment prevailing over Natural Gas in the medium term.   Analyzing the H4 chart, we initiated the impulse wave count for wave (3) from the level of 2.012, which marks the termination point of wave 4. Notably, price action formed a 1-2-1-2 structure, with confirmation established at 1.65 and invalidation set at 2.012. The confirmation of our anticipated direction materialized as price breached the 1.65 mark, signifying a resumption of bearish momentum. Presently, there appears to be minimal resistance hindering the bears, thereby reinstating their dominance in the market. It is projected that wave iii of (iii) of 5 will manifest around 1.43, indicative of the potential for the wave 5 low to extend to 1.3 or even lower. This comprehensive analysis underscores the prevailing bearish outlook for Natural Gas in the immediate future.       Technical Analyst : Sanmi Adeagbo Source : Tradinglounge.com get trial here!
×
×
  • Create New...
us