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

    • Futureplay offers a substantial bonus of 4BTC and 400 free spins using the code “HELLA” for 2024. This bonus provides a significant boost to players’ gaming experience. How to Use Bonus Code: Visit Futureplay: Go to the Futureplay website. Sign Up or Log In: Create an account or log in. Navigate to Promo Code Section: Locate where to input the bonus code. Enter Code: Type “HELLA” and submit. Claim Bonus: Receive 4BTC and 400 free spins.
    • GGDrop offers a free wheel spin using the promo code “Hella11” for 2024. This bonus allows players to win various prizes and enhance their gaming experience. How to Use Promo Code: Visit GGDrop: Go to the GGDrop website. Sign Up or Log In: Create an account or log in. Navigate to Promo Code Section: Locate where to input the promo code. Enter Code: Type “Hella11” and submit. Claim Free Spin: A free wheel spin will be credited to your account.
    • Rollbit is a popular online platform known for offering exciting opportunities to win valuable prizes. For 2024, Rollbit has introduced the promo code “HellaGood,” which grants users free money to kickstart their gaming journey. This code is an excellent way for new and existing players to explore the platform without any initial investment. How to Use Rollbit Promo Code: Visit Rollbit: Open your web browser and navigate to the Rollbit website. Sign Up or Log In: If you don’t already have an account, click on “Sign Up” and fill in the required details to create one. If you already have an account, simply log in. Navigate to Promo Code Section: Once logged in, find the section where you can enter promo codes. This is typically found in the account settings or under a dedicated rewards section. Enter the Promo Code: Type “HellaGood” into the designated promo code field and click on “Submit.” Claim Your Free Money: Once the code is accepted, your account will be credited with free money, which you can use to explore and enjoy various games on Rollbit.
×
×
  • Create New...
us