My First EasyLanguage Strategy - Need some help - EasyLanguage Programming | futures io social day trading
futures io futures trading


My First EasyLanguage Strategy - Need some help
Updated: Views / Replies:534 / 3
Created: by bluefightingcat 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 90,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

Reply
 
Thread Tools Search this Thread
 

My First EasyLanguage Strategy - Need some help

  #1 (permalink)
Trading Apprentice
Espoo Finland
 
Futures Experience: Intermediate
Platform: TradingBlox
Favorite Futures: Stocks
 
Posts: 32 since Sep 2015
Thanks: 0 given, 10 received

My First EasyLanguage Strategy - Need some help

Ok,

So I've recently taken a step to make my trading more reliable and hopefully more successful. I am trying out Multicharts and one of the features I wish to use is the backtesting feature. It seems, that to use this feature I have to learn "easylanguage" to write my strategy. So I did some reading on the internet and jumped right in the deep end and wrote my first easylanguage strategy. First the strategy:

Show Stocks where RSI(2) is below 5
and price is above 5.00
and average volume(21) is above 250000
and close reached a new 10 day low
and close less than MA(5)
and close less than MA(200)
and close has been decreasing for 5 days
and where ADX(10) is above 30

This is what I have so far:

 
Code
Inputs:

	MinPrice (10),  //Minimum stock price for stock to be considered
	Avg_Vol_Len (21), //The length used to calculate average volume
	Min_Avg_Vol (250000), //The minimum average volume required for stock to be considered
	RSI_Len (2), //Length of RSI
	ema_fast_len (10), //Speed of fast EMA
	ema_slow_len (200), //Speed of slow EMA
	rsi_oversold (5), //Threshold for when RSI is considered oversold.
	ADX_len (10); //The length of ADX
	
Variables:

	price (close),
	intrabarpersist ema_fast (0),
	intrabarpersist ema_slow (0),
	intrabarpersist rsi_val (0),
	intrabarpersist last_rsi_oversold_dt (0),
	intrabarpersist mp (0), 
	intrabarpersist ep (0),
	intrabarpersist exitbar (0),
	intrabarpersist rsi_xdown_bar (0),
	intrabarpersist ADX (0)
	;
	
mp = marketposition(0);
ep = entryprice(0);

ema_fast = xaverage( close, ema_fast_len); //Calculate the fast EMA
ema_slow = xaverage( close, ema_slow_len); //Calculate the slow EMA
rsi_val = rsi( close, rsi_len);	        //Get the latest RSI value    
Min_Avg_Vol = average(close, Avg_Vol_len); //Calculate the average volume for the specified length
ADX_val = ADX(close, adx_len); 		//Get the latest ADX value

if price > 10
and Min_Avg_Vol > 250000
and price < ema_fast
and price < ema_slow
and ADX_val > 25
then

if rsi_val crosses below 5 then
	rsi_xdown_bar = barnumber;

if mp = 0 then
begin
	buy 10 stocks next bar at Open;
	
end;

if mp = 1 then
end;
Now here are my questions:

1. How do I code this "and price reached a new 10 day low".
2. How do I code this "and price has been decreasing for 5 days."
3. I am having trouble with coding the position size and entries as well as the exits. But I will save that for another post.
4. Essentially when backtesting and maybe in future in automated trading, I want this strategy to pick 4-6 stocks (depending on my current positions and position size) from any of the stocks in the NYSE, NASDAQ or AMEX that fill the criteria. I want the strategy to constantly scan all these stocks and buy the ones that best fulfill my criteria.

So initially I just want to make sure that the strategy criteria are correct first and get some answers.

Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
Elite Member
Huntsville, AL
 
Futures Experience: Intermediate
Platform: TradeStation
Broker/Data: Tradestation
Favorite Futures: Index Futures
 
Posts: 9 since Jun 2014
Thanks: 0 given, 0 received



Quoting 

Now here are my questions:

1. How do I code this "and price reached a new 10 day low".
2. How do I code this "and price has been decreasing for 5 days."
3. I am having trouble with coding the position size and entries as well as the exits. But I will save that for another post.
4. Essentially when backtesting and maybe in future in automated trading, I want this strategy to pick 4-6 stocks (depending on my current positions and position size) from any of the stocks in the NYSE, NASDAQ or AMEX that fill the criteria. I want the strategy to constantly scan all these stocks and buy the ones that best fulfill my criteria.

So initially I just want to make sure that the strategy criteria are correct first and get some answers.

I'm a TradeStation user but I believe the easylanguage code is the same across platforms so see if this helps:

*note: the code below assumes you're using daily bars. If you were not using daily bars then you can use LowD and CloseD to access the daily values on an intraday chart.

1) I would use the "Lowest" function:
 
Code
If L < Lowest(L, 10) then //your code

2) Probably at least two ways to do this and I'm not sure which method represents what you're after so you can decide:
Method 1: this will only check if the current close is lower than the close 5 periods ago
 
Code
    
if C < C[5] then //your code
Method 2: this will ensure the last five consecutive closes are each lower than the previous
 
Code
if C < C[1] and C[1] < C[2] and C[2] < C[3] and C[3] < C[4] and C[4] < C[5] then //your code
I can't help with answers for 3 or 4.

Reply With Quote
 
  #4 (permalink)
Trading Apprentice
Espoo Finland
 
Futures Experience: Intermediate
Platform: TradingBlox
Favorite Futures: Stocks
 
Posts: 32 since Sep 2015
Thanks: 0 given, 10 received

Thanks. That provides a great solution to those 2 questions!

Reply With Quote

Reply



futures io > > > > > My First EasyLanguage Strategy - Need some help

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
VIDEO TUTORIAL: How to create an advanced MultiCharts EasyLanguage Strategy Big Mike MultiCharts 39 November 9th, 2017 04:35 AM
EasyLanguage Strategy - Help! Stormkicker EasyLanguage Programming 3 May 15th, 2015 06:11 AM
Wild Swinging Fills; Tradestation // Easylanguage Strategy djvie11 Currency Futures 2 June 4th, 2014 08:08 PM
Looking for BigMike video for strategy in Easylanguage ushnisha Traders Hideout 1 July 8th, 2012 11:20 AM
EasyLanguage Code to stop strategy for the day skiman721 EasyLanguage Programming 12 June 23rd, 2012 02:18 PM


All times are GMT -4. The time now is 09:09 AM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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 2017-12-16 in 0.10 seconds with 19 queries on phoenix via your IP 54.83.122.227