Multi-Charts EMA strategy optimization - MultiCharts | futures io social day trading
futures io futures trading


Multi-Charts EMA strategy optimization
Updated: Views / Replies:1,481 / 8
Created: by Ryan26986 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
 

Multi-Charts EMA strategy optimization

  #1 (permalink)
Trading Apprentice
Whitewater, WI
 
Futures Experience: Intermediate
Platform: GFT forex
Favorite Futures: Forex
 
Posts: 5 since May 2013
Thanks: 0 given, 0 received

Multi-Charts EMA strategy optimization

In multi-charts i have written a system using power language that I am looking to optimize I am having issues getting the trade to actually play out the way I want

The entry for the strategy is determined by the cross of a fast ema and a slow ema on the 1 day chart of the USD/JPY and is also limited by whether price is above the 20 day moving average when optimized I should be able to test it on the 1 hour chart with the same code and instead just use a 480 period MA

My problem is I am able to write the code for an entry order but I cannot figure out why it wont recognize the ema's crossing under represented by a condition to exit a position I am using multi charts and the regular PowerLanguage if anyone can help I can send you the code to see whats wrong

Reply With Quote
 
  #2 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,524 since Apr 2013
Thanks: 229 given, 852 received
Forum Reputation: Legendary

What do you have for the exit part so far? Post it here and we can take a look at it.

Reply With Quote
 
  #3 (permalink)
Trading Apprentice
Whitewater, WI
 
Futures Experience: Intermediate
Platform: GFT forex
Favorite Futures: Forex
 
Posts: 5 since May 2013
Thanks: 0 given, 0 received



ABCTG View Post
What do you have for the exit part so far? Post it here and we can take a look at it.


inputs:
Price (Close),
emafastlength ( 5 ),
emaslowlength ( 13 ),
stopdist ( 200 ),
NumContractsbuy ( 5 ),
NumContractssell ( 4 ),
smalength ( 480 );

vars:
smav ( 0 ),
emafv ( 0 ),
emasv ( 0 );

smav = Average ( Price, smalength );
emafv = XAverage ( Price, emafastlength );
emasv = XAverage ( Price, emaslowlength );

Condition1 = emafv crosses over emasv;
Condition2 = emafv crosses under emasv;

// Open new positions

if Condition1 and CurrentBar > smav then

Buy ("Enter xma long") (NumContractsbuy) Contracts Next Bar At open;
SetStopLoss ( Stopdist );


if Condition2 and CurrentBar < smav then

Sell ("Enter xma short") (NumContractssell) Contracts Next Bar At open;
SetStopLoss ( Stopdist );

// Open order management

if Marketposition = 1 then begin

if Condition2 then

Sell from Entry ("Enter xma long") this bar At close;


if Marketposition = -1 then begin

if condition1 then

Buy from Entry ("Enter xma short") this bar at close

Reply With Quote
 
  #4 (permalink)
Trading Apprentice
Whitewater, WI
 
Futures Experience: Intermediate
Platform: GFT forex
Favorite Futures: Forex
 
Posts: 5 since May 2013
Thanks: 0 given, 0 received


ABCTG View Post
What do you have for the exit part so far? Post it here and we can take a look at it.

I also forgot to mention that I have an optimizable number of contracts relative to the Buy and Sell orders

Reply With Quote
 
  #5 (permalink)
Trading Apprentice
Whitewater, WI
 
Futures Experience: Intermediate
Platform: GFT forex
Favorite Futures: Forex
 
Posts: 5 since May 2013
Thanks: 0 given, 0 received


ABCTG View Post
What do you have for the exit part so far? Post it here and we can take a look at it.

My error as of right now is coming in when I am in a short position trying to exit that position

Reply With Quote
 
  #6 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,524 since Apr 2013
Thanks: 229 given, 852 received
Forum Reputation: Legendary

Okay, at a quick glance I am seeing the problem that you are using the wrong reserved words for the short entry and for the exit.

The reserved words for entering and exiting positions are:

Buy - for entering a long positon
Sell - to exit a long position

SellShort - to enter a short position
BuyToCover - to exit a short position


Having said this your long entry and exit seems correct, just exchange the reserved words for the short entry and exit.

That might do it already.

Regards,
ABCTG


Last edited by ABCTG; May 11th, 2013 at 05:54 PM.
Reply With Quote
 
  #7 (permalink)
Trading Apprentice
Whitewater, WI
 
Futures Experience: Intermediate
Platform: GFT forex
Favorite Futures: Forex
 
Posts: 5 since May 2013
Thanks: 0 given, 0 received


ABCTG View Post
Okay, at a quick glance I am seeing the problem that you are using the wrong reserved words for the short entry and for the exit.

The reserved words for entering and exiting positions are:

Long - for entering a long positon
Sell - to exit a long position

SellShort - to enter a short position
BuyToCover - to exit a short position


Having said this your long entry and exit seems correct, just exchange the reserved words for the short entry and exit.

That might do it already.

Regards,
ABCTG


ABCTG

I am able to use "Buy" for entering positions but some of the other reserve words were incorrect and I think I had a misplaced End; but I was finally able to compile thanks for the help

Best,
Ryan

Reply With Quote
 
  #8 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,524 since Apr 2013
Thanks: 229 given, 852 received
Forum Reputation: Legendary


Ryan26986 View Post
ABCTG

I am able to use "Buy" for entering positions but some of the other reserve words were incorrect and I think I had a misplaced End; but I was finally able to compile thanks for the help

Best,
Ryan

Ryan, my bad it should read "Buy" for entering a long position. That's the correct reserved word for entering a long position.

One thing I also noticed, that you only need to use "SetStopLoss ( Stopdist );" once, in case you are using it with the same value. If you want to use different stops for a long and short, you'd have to place it within a
 
Code
if MarketPosition = 1 then 
begin
....
end;

if MarketPosition = -1 then 
begin
....
end;
bracket.

You can use the default stop code, to choose if the stop amount should be used for the whole position or per contract
 
Code
inputs: PositionBasis( false ); //if true, the stop amount will be used for the total position, if false it's per 
                                              //contract/share

if PositionBasis then 
	SetStopPosition
else
	SetStopShare ;
Have a nice weekend,
ABCTG

Reply With Quote
 
  #9 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,524 since Apr 2013
Thanks: 229 given, 852 received
Forum Reputation: Legendary

Your code might look like this:

 
Code
inputs:
Price (Close),
emafastlength ( 5 ),
emaslowlength ( 13 ),
stopdist ( 200 ),
NumContractsbuy ( 5 ),
NumContractssell ( 4 ),
smalength ( 480 ),
PositionBasis( false ); {if true, the stop amount will be used for the total position, if false it's per 
                                              contract/share}

vars:
smav ( 0 ),
emafv ( 0 ),
emasv ( 0 );

smav = Average ( Price, smalength );
emafv = XAverage ( Price, emafastlength );
emasv = XAverage ( Price, emaslowlength );

Condition1 = emafv crosses over emasv;
Condition2 = emafv crosses under emasv;

// Open new positions

if Condition1 and CurrentBar > smav then

Buy ("Enter xma long") (NumContractsbuy) Contracts Next Bar At open;



if Condition2 and CurrentBar < smav then

SellShort ("Enter xma short") (NumContractssell) Contracts Next Bar At open;

// Open order management

if Marketposition = 1 and Condition2 then
Sell from Entry ("Enter xma long") this bar At close;

if Marketposition = -1 and condition1 then
BuyToCover from Entry ("Enter xma short") this bar at close;


//stop loss
if PositionBasis then 
	SetStopPosition
else
	SetStopShare ;

SetStopLoss ( Stopdist );

Reply With Quote

Reply



futures io > > > > Multi-Charts EMA strategy optimization

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
XavMTF Debugging and Optimization Thread - Multi Time Frame Indicator Xav1029 The Elite Circle 47 June 20th, 2015 07:55 AM
Connect Multi Charts to TT X Trader ? Mehul MultiCharts 3 February 12th, 2012 04:51 PM
Multi Timeframe EMA indicator kulu NinjaTrader Programming 3 November 14th, 2010 06:10 PM
Ninja Strategy multi-timeframe issue/Strategy to indicator nw123 NinjaTrader Programming 2 December 20th, 2009 07:24 PM


All times are GMT -4. The time now is 02:11 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-11 in 0.13 seconds with 37 queries on phoenix via your IP 54.226.34.209