Tag: how to use afl codes

MarketSecrets - Learn To Trade Like a Pro

How to use Bar Replay Tool in Amibroker?

Here is another much awaited and most requested episode on amibroker, which is “Bar Replay window” Bar Replay tool is available from Tools->Bar Replay menu. Bar Replay feature plays back data for all symbols at once with user-defined speed. It means that data for all symbols will end at specified “playback position”.   Controls description Navigation bar:  – Rewind to the…
Read more

How to create algo for MACD Intraday Trend Following strategy?

How to create algo for MACD Intraday Trend Following strategy?

In this episode , we are going to learn how to code MACD Intraday Trend Following Strategy.
Let’s get into the set-up.

Condition:
This is a slightly complicated strategy, we will be using Bollinger Band in combination with MACD to take buying, selling, shorting and short covering decisions.

Buy: When MACD line crosses signal line, with histogram above 0 and closing price of the candle is above Top Bollinger Band.
Short: When signal line crosses MACD line, with histogram below 0 and closing price of the candle is below Bottom Bollinger Band.
Sell: When we get Short signal
Cover: When we get Buy signal

Example:
Buy: When MACD line crosses signal line, with histogram above 0 and current time is within the allowable trade time of 9.30 & 3.15 and closing price of the candle is above Top Bollinger Band.
Short: When signal line crosses MACD line, with histogram below 0 and current time is within the allowable trade time of 9.30 & 3.15 and closing price of the candle is below Bottom Bollinger Band.
Sell: When we get Short signal or if time crosses 3.15
Cover: When we get Buy signal or if time crosses 3.15

How to create algo for Wilders Moving Average Crossover Trading strategy?

How to create algo for Wilders Moving Average Crossover Trading strategy?

In this episode , we are going to learn how to code Wilders Moving Average Crossover Trading strategy.
Let’s get into the set-up.

Condition:
This is simple strategy, we use wilders indicator and using Moving Average crossover of 2 wilders indicator to take buying or selling decisions.
Buy: When 7.5 period Wilders Moving Average crosses above 11 Period Wilders Moving Average
Sell: When 7.5 period Wilders Moving Average crosses below 11 Period Wilders Moving Average

Wilders is a very complicated strategy in itself and we won’t be getting into the details of this strategy. Since it is algo, we can use just 1 line of code to pull the Wilders data and it is enough for us. If you are interested in learning Wilders strategy, let us know in the comments section, we will cover it as part of “Trading Strategy” series if there is enough interest,

We will Buy: When 7.5 period Wilders Moving Average crosses above 11 Period Wilders Moving Average
We will Sell: When 7.5 period Wilders Moving Average crosses below 11 Period Wilders Moving Average

How to create algo for Stochastic DK strategy?

How to create algo for Stochastic DK strategy?

In this episode , we are going to learn how to code Stochastic DK strategy.
Let’s get into the set-up.

Condition:
We have 2 conditions for Buying/Selling. Stoch should be above/below specific level and there should be a stoch crossover
Buy: When Stoch K is less than 15 and Stoch K crosses above Stoch D
Sell: When Stoch K is above 85 and Stoch K crosses below Stoch D

Limit of 15 or 85 is just a placeholder for oversold and overbought conditions and can be adjusted dynamically.

How to color code charts and simplify chart reading using amibroker AFL?

How to color code charts and simplify chart reading using amibroker AFL?

Colour charts will simplify out work during intraday trading. We can color the candles in such a way that is we see a specific color in the chart, it indicates, we are getting closer to our entries and we need to be alert.
This will greatly reduce our work and also make the charts colourful. This will definitely come in handy in reducing the screentime if you are an active trader and trading everyday for 6-8 hours. Having multiple screens will simplify this even further.
You can play around the RSI setting and colors, you can also make similar colourful charts for any of the indicators you use as well.

How to create algo for RSI Trigger Line strategy?

How to create algo for RSI Trigger Line strategy?

Condition:
The moving average of RSI indicates the average momentum, while RSI indicates current momentum. So we are trying to buy when RSI crosses above its moving average.The short RSI period of 7 is used to generate sufficient signals. The Moving Average period used is 15, arbitrarily the double of RSI period.
Buy: When RSI crosses above its trigger line and RSI>60
Sell: When RSI goes below trigger line and RSI<40 Reverse is applicable for shorting.

How to write algo for Stoch Crossover System?

How to write algo for Stoch Crossover System?

Condition:
Stochastic is an oscillator that measures the position of a stock compared with its recent trading range indicating overbought OR oversold conditions. It displays current Day price at a percentage relative to it’s trading range over the specified period of time. In a Slow Stochastic, the highs AND lows are averaged over a slowing period. The default is usually 3 for slow AND 1 for fast. The line can then be smoothed using an exponential moving average, Weighted, OR simple moving average. Confirming Buy/Sell signals can be read at intersections of the %D with the %K as well.
The Stochastic Oscillator always ranges between 0% AND 100%.
• A reading of 0% shows that the security’s Close was the Lowest price that the security has traded during the preceding x-time periods.
• A reading of 100% shows that the security’s Close was the Highest price that the security has traded during the preceding x-time periods.
• When the closing price is near the top of the recent trading range (above 80%), the security is in an overbought condition AND may Signal for a possible correction.
• Oversold condition exists at a point below %20. The security is in an oversold condition AND may Signal for a possible upmove.
• Whenever stoch makes a crossover we will initiate the trades accordingly.

How to create algo for RSI Crossover System?

How to create algo for RSI Crossover System?

Condition:
The Trading Idea is to Buy when short-term momentum crosses above long-term momentum and vice versa.
RSI is a oscillator which depicts momentum in prices. We try using two RSI of different periods to judge the short-term momentum and long-term momentum. So trade entries will be based on RSI indicator.
However, by construction, RSI gives a lot of whipsaws while it oscillates up and down. So trade exits are done using RSI levels to avoid too frequent re-entries.
So when it comes to trade condition,
Buy: When short-term RSI crosses above long-term RSI
Sell: When RSI goes below 40 level

How to create algo for MACD Momentum Trading strategy?

How to create algo for MACD Momentum Trading strategy?

Condition:
The MACD indicator is one of the most popular indicators to determine trending prices. The basic trading rules is to buy when it cuts above zero line or buy when its cuts above signal line. When the direction of trend is not clear, MACD stays close to the zero line.

The trading idea is simple.
We need to buy when
• trend is strong
• there is momentum in market
• the market is not sideways

Buy Condition: MACD above 0 and MACD above Signal Line and MACD above 25 and Signal candle is beyond Bollinger Band
Sell Condition: When either MACD below 0 or MACD below Signal Line

Reverse is applicable for shorting.

error: Content is protected !!