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

    • MEXC Referns Kod u: “mexc-rb” olarak kullanilir. Dünyada en çok kullanılan, ömür boyu geçerli, en yüksek indirim oranına sahip MEXC referns kod udur. MEXC kripto para borsasına kayıt olurken “Davet Kod u” yazan yere “mexc-rb” yazınız. Alacağınız işlem ücreti indirimi % 100'dür. Ayrıca 1000$ USDT komisyon iade bonusu alacaksınız. Kripto para borsası MEXC Referns Kod u: “mexc-rb” ile vadeli işlem yani futures işlem ücreti indirimleri ve spot ve marjin işlem ücreti indirimleri kazanırsınız. Ayrıca bonuslar ve bir çok promosyon kazanırsınız. Teknoloji ve finans dünyasında yatırım ve ticaret yapmak için hemen MEXC borsasına: “mexc-rb” referns kod u ile kayıt olun.
    • MEXC Referns Kod u: “mexc-rb” olarak kullanilir. Dünyada en çok kullanılan, ömür boyu geçerli, en yüksek indirim oranına sahip MEXC referns kod udur. MEXC kripto para borsasına kayıt olurken “Davet Kod u” yazan yere “mexc-rb” yazınız. Alacağınız işlem ücreti indirimi % 100'dür. Ayrıca 1000$ USDT komisyon iade bonusu alacaksınız. Kripto para borsası MEXC Referns Kod u: “mexc-rb” ile vadeli işlem yani futures işlem ücreti indirimleri ve spot ve marjin işlem ücreti indirimleri kazanırsınız. Ayrıca bonuslar ve bir çok promosyon kazanırsınız. Teknoloji ve finans dünyasında yatırım ve ticaret yapmak için hemen MEXC borsasına: “mexc-rb” referns kod u ile kayıt olun.
    • Gain Advantages in the Crypto World with Gateio ReferrlCode: 3930511 Introduction: Gate.io is known as a reliable and innovative platform for cryptocurrency trading. By joining the platform with the Gateio Referrlcode "3930511", you can take advantage of various benefits. In this article, we will explore the opportunities offered by the Gate.io referrl code, how to use it, and the technical benefits it provides. What is the Gate.io ReferrlCode? The Gate.io Referrlcode "3930511" is a unique code that new users can use when signing up on the platform. Entering this code during the registration process or while managing your account grants you various bonuses and rewards. Benefits of the ReferrlCode: Trading Fee Discount: By signing up with the Gate.io Referrlcode "3930511", you can receive a discount on trading fees. This can reduce your trading costs over time and help you earn more profit. Bonus Cryptocurrency: When you use the code to register, you may receive a certain amount of bonus cryptocurrency. These bonuses can help increase your trading capital. Reward Programs: Gate.io offers various reward programs for users who use the Referrlcode. These programs allow you to earn extra rewards based on your trading volume. Technical Details and Usage: Registration Process: During the registration on Gate.io, enter the code "3930511" in the "ReferrlCode" field. This step will link the referrl code to your account and enable you to benefit from the associated advantages. API Usage: Gate.io offers API support for advanced users. These APIs allow you to create trading bots and implement automated trading strategies. By signing up with the Referrlcode, you can access additional resources and support for API usage. Security Features: Gate.io provides advanced security measures such as two-factor authentication (2FA), cold storage, and regular security audits to ensure the safety of its users. By registering with the Referrlcode, you can also benefit from these security features. Conclusion: By joining the platform with the Gate.io Referrlcode "3930511", you can reduce your trading costs, earn bonus cryptocurrency, and take advantage of reward programs. Additionally, you can optimize your trading experience with technical benefits like API support and advanced security features. Sign up now and start benefiting from these advantages with the Gate.io Referrlcode!
×
×
  • Create New...
us