strategy with EMA and range - comaprison of codes in MultiCharts /.NET / AmiBroker - MultiCharts | futures io social day trading
futures io futures trading

strategy with EMA and range - comaprison of codes in MultiCharts /.NET / AmiBroker
Updated: Views / Replies:1,109 / 0
Created: by jamesfisher Attachments:0

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 100,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Thread Tools Search this Thread

strategy with EMA and range - comaprison of codes in MultiCharts /.NET / AmiBroker

  #1 (permalink)
Trading Apprentice
City Poland
Trading Experience: Advanced
Platform: MT4,AmiBroker,MultiCharts
Favorite Futures: FX, futures, options, commodities, stocks
Posts: 14 since Sep 2012
Thanks: 1 given, 3 received

strategy with EMA and range - comaprison of codes in MultiCharts /.NET / AmiBroker

I'm doing some comparsion between possibilities (long of the code in some platforms) for strategy with rules:
- We open long positions when the current bar closes above the highest close of the preceding 10 bars. Short positions are initiated when the bar closes below the 10-bar lowest close.
- Long positions are closed when the bar crosses below the 50-period Exponential Moving Average (EMA). We exit short positions when the bar closes above this EMA.
- We use two inputs to set the EMA length and the number of bars that the highest and lowest close is calculated on.

I started coding this in EasyLanguage for MultiCharts. I'm newbie with this language (1 day of exp.). My code:

Inputs: Price(Close), Ema_Length(50), Length_Lookback(10); 
Variables: emaCurrent(0);
emaCurrent= XAverage(Price, Ema_Length);

condition1 = Price > Highest(Close[1],Length_Lookback);
condition2 = Price < emaCurrent;
condition3 = Price < Lowest(Close[1],Length_Lookback);
condition4 = Price > emaCurrent;
IF  condition1 then
Buy 1 contract this bar at Close;

IF  condition2 then
Sell this bar at Close;

IF  condition3 then
sellshort 1 contract  this bar at Close;

IF  condition4 then
buytocover this bar at Close;

This same strategy is coded for MultiCharts.NET and present on with length 103 lines in C#.

My working code for AmiBroker (32 lines of the code):

PeriodEMA= Param("PeriodEMA", 50,1,60,1);
PeriodLookback= Param("PeriodLookback", 10,1,60,1);

wartosc_EMA = EMA(C,PeriodEMA);
gorna_banda = Ref(HHV(C,PeriodLookback),-1);
dolne_banda = Ref(LLV(C,PeriodLookback),-1);

otworz_LONG = Cross(C,gorna_banda);
otworz_SHORT = Cross(dolne_banda,C);
zamknij_LONG  = Cross(wartosc_EMA,C);
zamknij_SHORT = Cross(C,wartosc_EMA);

Buy = otworz_LONG;
Sell = zamknij_LONG;
Short = otworz_SHORT;
Cover = zamknij_SHORT;

BuyPrice = ShortPrice = SellPrice = CoverPrice = C;

Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);
Short = ExRem(Short,Cover);
Cover = ExRem(Cover,Short);
-- --

I will be greatful for finishing my code for MultiCharts, so I will have full picture of length of the code. Thanks a lot!

Last edited by jamesfisher; May 29th, 2016 at 05:54 AM.
Reply With Quote


futures io > > > > strategy with EMA and range - comaprison of codes in MultiCharts /.NET / AmiBroker

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Upcoming Webinars and Events (4:30PM ET unless noted)

Journal Challenge $1600 in Prizes & Free Journalytix for all participants!


The Driving Force Behind the Market w/Earn2Trade

Mar 5

TBA w/Stage5 & iSystems

Mar 12

TBA w/John Grady @ No BS Day Trading

Mar 19

Day Trading Oil Futures: Reducing Risk & Increasing Profits w/DTN IQFeed

Mar 26

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sma, ema and range bar charts... thoth trader0204 Emini Index Futures Trading 2 May 19th, 2014 09:49 AM
Strategy based on the Color of an EMA Line jhunt NinjaTrader Programming 1 November 21st, 2013 06:08 PM
Multi-Charts EMA strategy optimization Ryan26986 MultiCharts 8 May 11th, 2013 06:05 PM
Range Breakout Strategy stefan416 NinjaTrader Programming 3 January 9th, 2013 01:53 PM
MACD: The 12-period (EMA) minus 26 EMA emini_Holy_Grail Traders Hideout 1 February 22nd, 2010 01:04 PM

amibroker, average, c#, code, coding, easylanguage, ema, lookback, moving average, multicharts, newbie, short, strategy, xaverage

All times are GMT -4. The time now is 11:08 PM. (this page content is cached, log in for real-time version)

Copyright © 2019 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432 WhatsApp Business,
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts
Page generated 2019-02-23 in 0.17 seconds with 14 queries on phoenix