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
  • General Statistics

    • Total Topics
      23,561
    • Total Posts
      96,853
    • Total Members
      44,135
    • Most Online
      7,522
      10/06/21 11:53

    Newest Member
    CBusst
    Joined 28/11/23 15:58
  • Posts

    • DXY updated chart - note discount on previous chart should have been premium 
    • I believe this is nothing but a witch hunt cos apparently Binance is on its way to been the biggest company world over. Also, there are rumours that all this hapenings could be BlackRock making a move to clear the house ahead of the most awaited ETF. Notwithstanding, i took precautionary measures and moved my funds to Bitget and Bybit, better to be safe than sorry yah.
    • Crypto industry maybe seen as one of the fastest growing industries in the world today, boasting of a remarkable growth that is capable of making many forget in a hurry all the hurdles it had to beat during its infancy. Although not void of limitations still, no industry is anyways, it has well exceeded early expectations and earned global interest. So scrolling through my Instagram feeds today and seeing the footballing icon and 8th time Ballon d'or winner, Lionel Messi’s post of him celebrating his 1 year anniversary partnership with the crypto exchange, Bitget, I was left reminiscing all the challenges the industry had to overcome to get to where it is today. As a crypto enthusiast who is eager to see the industry reach greater heights, such high-profile partnership thrills me. For one, for the industry to leap further, the issue of lack of trust must be resolved. Lionel Messi well understands his position in his country Argentina as a demi-god, his 500m global followers on IG idolise him. He and his crew must have done their background checks before endorsing the crypto exchange to protect his reputation and also for his followers’ interest. The global reach from this partnership is also a win for the exchange and the industry in general. It portrays the exchange as trustworthy and reliable, and readily welcomes newbies, further boosting crypto adoption. 2009-2023 has been an adventurous journey for the crypto industry, there might have been some tides here and there but the ship is sailing smoothly. Has crypto industry striked mainstream adoption to afford sealing high-profile partnerships like this? 
×
×
  • Create New...
us