Three moving average strategies
If the short term (Default 7) moving average cuts the medium term (default 25) moving average, BUY. Conversely, it generates the SELL signal. If the long term (Default 99) moving average cuts its short term moving average, Quick SELL. Conversely, it can be interpreted as Fast SELL. You can change the moving average and the number of days as you wish, and you can trade in the short or long term. I hope it was useful.
Strategies
Strategy Quadratic Semaphore I add a basic strategy for the "Quadratic traffic light" indicator, it can help to find a good configuration.
Regards.
BEST Trailing Stop StrategyHello traders
Here we go again.... with the second strategy snippet.
Reminder: the first snipper was a Trailing Profit strategy script
What's on the menu?
A trailing stop is designed to protect gains by enabling a trade to remain open and continue to profit as long as the price is moving in the investor's favor.
The order closes the trade if the price changes direction by a specified percentage or dollar amount.
Trigger me I'm famous
I developed many trading strategies in my career and often I've been asked to trigger a trailing-stop once a certain % move has been made.
On the screenshot below, the SL trigger is plotted in maroon.
Once the price goes past that level for the first time, I'll start trailing the trailing stop level.
In other words, when we see a price makes an interesting move in percentage value - we decide to trail the stop for at least not losing any more
All the BEST
Dave
BEST Trailing Take Profit StrategyHello traders
Hope you enjoyed your weekend on my behalf. Was staying home working ... ^^
This is my first strategy educational post I'm doing ever
While I'm generally against posting strategies because it's very easy to fake performance numbers... I cannot prevent myself from sharing a few cool strategy snippets anyway.
So from now on, I'll be sharing a few strategies also - generally not to showcase performance but only to show what pinescript can do.
As once again strategy performance can be faked is so many ways... :)
What's on the menu?
We all know what a trailing-stop is. right? right? Ok... sharing the definition here :)
A trailing stop is designed to protect gains by enabling a trade to remain open and continue to profit as long as the price is moving in the investor's favor. The order closes the trade if the price changes direction by a specified percentage or dollar amount.
But...do you know what a trailing profit is?
Short definition : Well the same but with your profit limit order.
Long definition : A trailing profit is designed to increase your gains by enabling a trade to remain open and continue to profit as long as the price is moving in the investor's favor. The order closes the trade if the price hits the trailing profit level specified percentage or dollar amount.
Some trading strategies used both a trailing stop AND trailing profit. Not making any recommendation here - only sharing what's possible in the realm of trading and pinescripting
Trigger me I'm famous
I developed many trading strategies in my career and often I've been asked to trigger a trailing-stop or trailing-profit once a certain % move has been made.
I integrated here a Take Profit trigger - once hit, it will activate the trailing profit
On the screenshot below, the TP trigger is plotted in orange. Once the price goes past that level for the first time, I'll start trailing the profit level.
In other words, when we see a price makes an interesting move in percentage value - we decide to offset the profit as we concluded that once it reached such distance - then it leads often to more profit
Of course, using only a trailing profit without stop/trailing-stop/invalidation isn't smart and the surest way to kiss goodbye a trading capital and trading and your good mood
See you tomorrow for another strategy snippet
All the BEST
Dave
Cowabunga System from babypips.comPlease do read the information below as well, especially if you are new to Forex.
The Cowabunga System is a type of Mechanical Trading System that filters trades based on the trend of the 4 hour chart with EMAs and some other familiar indicators (RSI, Stochastics and MACD) while entering trades base on 15 minute chart.
I have coded (quite amateurishly) the basic system onto a 15 minute chart (the 4 hour settings are coded as well). The author says the system is to be traded off the 15 minute chart with the 4 hour chart only as a reference for trend direction.
4 Hour Chart Settings
5 EMA
10 EMA
Stochastics (10,3,3)
RSI (9)
Then we move onto the 15 minute chart, where he gives us the trade entry rules.
15 Minute Chart Settings
5 EMA
10 EMA
Stochastics (10,3,3)
RSI (9)
MACD (12,26,9)
Entry Rules - long entry rules used, obviously reverse these for shorting.
1. EMA must cross above the 10 EMA.
2. RSI must be greater than 50 and not overbought.
3. Stochastic must be headed up and not be in overbought territory.
4. MACD histogram must go from negative to positive OR be negative and start to increase in value.
What I did.
1. Set the RSI and Stochastic levels to avoid entries when they indicate overbought conditions for long and oversold conditions for short (80 and 20 levels).
2. Users can input specific times they want to backtest.
3. User's can configure profit targets, trailing stops and stops. Default is set it to was 100 pips profit target with a 40 pip trailing stop. (Note, when you are changing these values, please note that each pip is worth 10, so 100 pips is entered as 1000.)
The Cowabunga System from babypips.com is another popular and active system. The author, Pip Surfer, continues to post wins and losses with this system. It shows there is a lot of honesty and integrity with this system if the author keeps up to date even 10 years later and is not afraid of sharing the times the system causes losses.
As an example of this, here is post he shared just last week . It's almost like a journal, he gives specific times and reasons why he entered, lets the readers know when he was stopped out, etc. I think that what he does is equally important as his system.
To read more about this system, visit the thread on babypips.com, click here.
Simple Strategy Code StubThis is a very basic strategy implementation
Use as a code stub for your strategy code. I wrote it because I could not find one.
This particular strategy goes long on Tuesdays at 10 am and goes short at 3 pm on Thursdays.
Because US markets open at 9:30 you have to have your chart in 30 minute or less resolution for trades to fire.
You can gut that code and replace it with your own to start testing your own indicators and strategies.
If you build a strategy that doesn't use "hour" like I have this resolution requirement won't apply.
For giggles, compare its performance to other strategies. Weird, huh? About 53% effective on most equities and indexes.
This strategy does the minimum needed to get a strategy working
and uses default position sizes and buys at market with no stops.
Again, it is the minimal code stub needed to test an indicator/rule based strategy.
A great code reference for building more sophisticated strategies can be
found here =>
The code is written by @greatwolf and is very well structured for anyone looking to fully utilize
strategy features for position sizing, limit orders, stops and cancellations.