NexusFi: Find Your Edge


Home Menu

 





VIDEO TUTORIAL: How to create an advanced MultiCharts EasyLanguage Strategy


Discussion in MultiCharts

Updated
      Top Posters
    1. looks_one ABCTG with 7 posts (3 thanks)
    2. looks_two Big Mike with 6 posts (82 thanks)
    3. looks_3 andby with 3 posts (1 thanks)
    4. looks_4 Lampert with 2 posts (7 thanks)
      Best Posters
    1. looks_one Big Mike with 13.7 thanks per post
    2. looks_two Lampert with 3.5 thanks per post
    3. looks_3 Family Trader with 2 thanks per post
    4. looks_4 ABCTG with 0.4 thanks per post
    1. trending_up 44,754 views
    2. thumb_up 96 thanks given
    3. group 36 followers
    1. forum 42 posts
    2. attach_file 16 attachments




 
Search this Thread

VIDEO TUTORIAL: How to create an advanced MultiCharts EasyLanguage Strategy

  #11 (permalink)
 
Lampert's Avatar
 Lampert 
Calgary, Canada
 
Experience: Intermediate
Platform: Multicharts
Broker: IB, IQFeed
Trading: GC
Posts: 76 since Nov 2011
Thanks Given: 73
Thanks Received: 142


erchis View Post
Hi,
I wrote some code according to the video and my trading rules above and tried it
on day chart of google, but it doesn't make any trades...is the algorithm correct?
. . . . . .

money ( 70000 ),

stocks ( Close/money ),
. . . . . .

@erchis - Your code will make trades if you just change from Close/money to money/Close. I did not check all of your code but here is a picture of the GOOG trades that it made in Jan-Feb 2011 (very few trades were made in 2012).

If you want to continue the discussion, you should open a new thread in this same sub-forum so that we don't get too far away from the topic of Mike's video tutorial. Also, there is more discussion of EasyLanguage strategies in the Elite section if you want to become a member.

Len


Reply With Quote
The following user says Thank You to Lampert for this post:

Can you help answer these questions
from other members on NexusFi?
NexusFi Journal Challenge - April 2024
Feedback and Announcements
ZombieSqueeze
Platforms and Indicators
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
Request for MACD with option to use different MAs for fa …
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Retail Trading As An Industry
58 thanks
Battlestations: Show us your trading desks!
55 thanks
NexusFi site changelog and issues/problem reporting
48 thanks
What percentage per day is possible? [Poll]
31 thanks
GFIs1 1 DAX trade per day journal
29 thanks

  #12 (permalink)
 
Lampert's Avatar
 Lampert 
Calgary, Canada
 
Experience: Intermediate
Platform: Multicharts
Broker: IB, IQFeed
Trading: GC
Posts: 76 since Nov 2011
Thanks Given: 73
Thanks Received: 142


guppy View Post
Hi Mike,

In your example, what if your profit or stop loss gets hit on the entry bar. How can you make it so that it will exit on the entry bar and not on the next bar?

@guppy - The important setting is intra-bar order generation. This allows orders to be made before the bar has been completed. This can be turned on under Format > Signal > Properties. Or you can add the following statement at the beginning of your code:
[IntrabarOrderGeneration = True]
Under Format > Signal > Properties, there are three options for setting the number of entries and exits per bar. You can try these different settings to see their effects.

In addition, the keywords SetProfitTarget and SetStopLoss generate orders before the bar has been completed even if IntrabarOrderGeneration is turned off.

For backtesting, it is also necessary to turn on the bar magnifier under Format > Strategy Properties > Backtesting. This allows data within the bar to be used for intrabar order generation. Calculations can be done on tick data or intra-day data depending on which box is checked.

In general, I always use [IntrabarOrderGeneration = True] in my code. For backtesting, I also use the bar magnifier with either tick data or 1 minute data depending availability.

Here are 4 different results from 4 different settings. Each of these results used the same nexusfi.com (formerly BMT) MoneyMaker code that is shown at the beginning of this thread.

Len





Reply With Quote
The following 6 users say Thank You to Lampert for this post:
  #13 (permalink)
 Arich 
Springfield, Missouri
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Interactive Brokers
Trading: EUR/USD
Posts: 28 since Sep 2012
Thanks Given: 29
Thanks Received: 5


Hello,

This video will not play for me. Says: "300: Player initialization failed..."

Is this video located elsewhere too? Or could you upload it again BigMike? Thanks!

Reply With Quote
  #14 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,322 since Jun 2009
Thanks Given: 33,143
Thanks Received: 101,477


Arich View Post
Hello,

This video will not play for me. Says: "300: Player initialization failed..."

Is this video located elsewhere too? Or could you upload it again BigMike? Thanks!

Try a different browser, like chrome, make sure you have the latest Flash player, make sure you aren't using any blocking scripts. Video works fine.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
The following user says Thank You to Big Mike for this post:
  #15 (permalink)
 
andby's Avatar
 andby 
Norwich, UK
 
Experience: Intermediate
Platform: Multiple:research&executi
Broker: Started with Stage5/OEC ... multiple
Trading: Anything found profitable goes ...
Posts: 167 since Jul 2012
Thanks Given: 88
Thanks Received: 88

Hi Mike,

How do you debug in easylanguage / Multicharts ?
If for example, you want to log variables in a logfile / logview, or want to do some execution stop at some point in your program to watch your variables, is this possible ?

Thx

Reply With Quote
  #16 (permalink)
 NW27 
Newcastle, Australia
 
Experience: Intermediate
Platform: Multicharts 8 - Full Version
Broker: IB
Trading: SPI,FTSE100, 6E, 6A
Posts: 285 since Oct 2010
Thanks Given: 108
Thanks Received: 188

In the easy language editor, you use the print command in your code and view the output at the bottom of the editor screen.
Don't forget about my printtext function in the download area.

Regards,
Neil.

Reply With Quote
The following user says Thank You to NW27 for this post:
  #17 (permalink)
sagetrade
Frankfurt / Germany
 
Posts: 47 since Jul 2013
Thanks Given: 28
Thanks Received: 11


Big Mike View Post
Here is the code for jtHMA function if you need it:

 
Code
                            


{jtHMA Hull Moving Average Function}
{
AuthorAtavachron}
{
May 2005}

Inputsprice(NumericSeries), length(NumericSimple);
VarshalvedLength(0), sqrRootLength(0);

{
Original equation is:
---------------------
waverage(2*waverage(close,period/2)-waverage(close ,period), SquareRoot(Period)
Implementation below is more efficient with lengthy Weighted Moving Averages.
In additionthe length needs to be converted to an integer value after it is halved and
its square root is obtained in order for this to work with Weighted Moving Averaging
}

if ((
ceiling(length 2) - (length 2)) <= 0.5then
halvedLength 
ceiling(length 2)
else
halvedLength floor(length 2);

if ((
ceiling(SquareRoot(length)) - SquareRoot(length)) <= 0.5then
sqrRootLength 
ceiling(SquareRoot(length))
else
sqrRootLength floor(SquareRoot(length));

Value1 WAverage(pricehalvedLength);
Value2 WAverage(pricelength);
Value3 WAverage((Value1 Value2), sqrRootLength);

jtHMA Value3
Mike

Hey Guys,

thanks a lot first to BigMike for uploading this gerat Video. I just started to teach myself easylanguage and used this video as a starting point. This is realy awesome to learn!
Now that I succesfully mirror-coded your strategy and did the same with adding the HMA function, I ran into two issues now:

1. If I want to use the HMA within the chart, I do have to add it as an "indicator" I suppose. Unfortunately, this won't compile in my case. Giving me this message:

------ Compiled with error(s): ------
Wrong expression
errLine 9, errColumn 14, errLineEnd 9, errColumnEnd 27
causal study: (Function)

2. If I want to add the futures.io (formerly BMT) Test Strategy to a chart, it tells me that system tried to reference back more bars (51) than allowed by the current MaxBarsBack setting.

Im new to MC so thanks a lot for helping me out!

Reply With Quote
  #18 (permalink)
 dcsf 
Tremonton
 
Experience: Intermediate
Platform: ???? still looking
Broker: IB
Trading: TF
Posts: 4 since Aug 2011
Thanks Given: 4
Thanks Received: 0

I am converting from Tradestation to MC, but am struggling with some of the settings I need. In viewing the tutorial on youtube, it seems as if I might have a different version of MC than the video. I only have the option of putting in $1 on commissions, and I can't figure out how I set the point value to $100 when testing the Russell 2000.
Any help would be greatly appreciated!

Thanks

Reply With Quote
  #19 (permalink)
sagetrade
Frankfurt / Germany
 
Posts: 47 since Jul 2013
Thanks Given: 28
Thanks Received: 11

has anybody help for my problem?

Reply With Quote
  #20 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,431 since Apr 2013
Thanks Given: 481
Thanks Received: 1,623


Hi sagetrade,

the code posted is for a function. It sounds like you tried to compile it within an indicator.
Paste it within a function called jtHMA and call the function from an indicator.

MC will raise a Max bars back error when something in the code calls for more than the default 50 bars. If you are using a length input for an average of 100 for example, you will need a "Maximum number of bars study will reference" of 100 at least.
To change this go to Format Signal -> Properties and within the Strategy Properties switch to the Properties tab.
There you'll find the input field to raise the max bars setting.



Regards,
ABCTG



sagetrade View Post
Hey Guys,

thanks a lot first to BigMike for uploading this gerat Video. I just started to teach myself easylanguage and used this video as a starting point. This is realy awesome to learn!
Now that I succesfully mirror-coded your strategy and did the same with adding the HMA function, I ran into two issues now:

1. If I want to use the HMA within the chart, I do have to add it as an "indicator" I suppose. Unfortunately, this won't compile in my case. Giving me this message:

------ Compiled with error(s): ------
Wrong expression
errLine 9, errColumn 14, errLineEnd 9, errColumnEnd 27
causal study: (Function)

2. If I want to add the nexusfi.com (formerly BMT) Test Strategy to a chart, it tells me that system tried to reference back more bars (51) than allowed by the current MaxBarsBack setting.

Im new to MC so thanks a lot for helping me out!


Follow me on Twitter Reply With Quote
The following 2 users say Thank You to ABCTG for this post:





Last Updated on August 2, 2021


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts