Need help with a profitable automated trading strategy (Page 3) - MultiCharts | futures.io
futures.io futures trading
 

Go Back   futures.io

> Futures Trading, News, Charts and Platforms > Platforms and Indicators > MultiCharts


Need help with a profitable automated trading strategy
Started:October 23rd, 2016 (04:36 AM) by hoang101483 Views / Replies:1,095 / 41
Last Reply:October 26th, 2016 (04:30 PM) Attachments:2

Welcome to futures.io.

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • 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, and we will never resell your private information.

-- Big Mike
     

Reply
 2  
 
Thread Tools Search this Thread

Need help with a profitable automated trading strategy

Old October 25th, 2016, 04:54 PM   #21 (permalink)
Trading Apprentice
Oklahoma City USA
 
Futures Experience: Intermediate
Platform: Multicharts
Favorite Futures: ES
 
Posts: 39 since Oct 2016
Thanks: 0 given, 0 received


alex20037 View Post
I think this is what you are looking for:


inputs:
Length( 20 ),
NumDevs( 2 ) ;
variables:
UpperBand( 0 ),
LowerBand( 0 );

UpperBand = BollingerBand( Close, Length, NumDevs );
LowerBand = BollingerBand( Close, Length, -NumDevs );

condition1 = CurrentBar > 1 and Close crosses over UpperBand;
if condition1 then

Buy ( "BB_LE" ) next bar at market;

condition2 = CurrentBar > 1 and Close crosses under LowerBand;
if condition2 then

Sell Short ( "BB_SE" ) next bar at market;

if (MarketPosition = 1) then
begin
if (Close crosses under UpperBand) then sell ("BB_LX") next bar at market;
end;

if (MarketPosition = -1) then
begin
if (Close crosses over LowerBand) then buytocover ("BB_SX") next bar at market;
end;


However, I don't think it can profitable with such simple rules, in any timeframe. It would be too easy.



Thank you. can this code be applied to PowerLanguage on the Multichart .NET?

I tried but it failed.

Reply With Quote
     

Old October 25th, 2016, 05:06 PM   #22 (permalink)
Trading Apprentice
Oklahoma City USA
 
Futures Experience: Intermediate
Platform: Multicharts
Favorite Futures: ES
 
Posts: 39 since Oct 2016
Thanks: 0 given, 0 received

This code doesn't seem to work with PowerLanguage Editor. I tried to added as Signals using C# and VB#NET but both failed. Can you tell me what I'm doing wrong here?

Reply With Quote
     

Old October 25th, 2016, 05:23 PM   #23 (permalink)
Elite Member
Miami Lakes
 
Futures Experience: Beginner
Platform: Multicharts
Broker/Data: Interactive Brokers
Favorite Futures: Emini ES
 
Posts: 18 since Oct 2016
Thanks: 2 given, 3 received



hoang101483 View Post
Thank you. can this code be applied to PowerLanguage on the Multichart .NET?

I tried but it failed.

This is for Multicharts

Reply With Quote
     

Old October 25th, 2016, 05:27 PM   #24 (permalink)
Trading Apprentice
Oklahoma City USA
 
Futures Experience: Intermediate
Platform: Multicharts
Favorite Futures: ES
 
Posts: 39 since Oct 2016
Thanks: 0 given, 0 received


alex20037 View Post
This is for Multicharts

Alex, Can you code this in PowerLanguage?

I will return your favor with copy of my profitable strategy

Reply With Quote
     

Old October 25th, 2016, 07:41 PM   #25 (permalink)
Elite Member
Milan (Italy)
 
Futures Experience: Advanced
Platform: TradeStation, MC, TWS
Broker/Data: TradeStation, LMAX
Favorite Futures: Futures, Forex
 
tradingest's Avatar
 
Posts: 64 since Dec 2014
Thanks: 4 given, 3 received

Futures Edge on FIO

hoang101483 View Post
Alex, Can you code this in PowerLanguage?

The code offered by Alex is power language. You have need the C# code to run the strategy in .NET platform

Sent using the futures.io mobile app

Reply With Quote
     

Old October 25th, 2016, 08:56 PM   #26 (permalink)
Trading Apprentice
Oklahoma City USA
 
Futures Experience: Intermediate
Platform: Multicharts
Favorite Futures: ES
 
Posts: 39 since Oct 2016
Thanks: 0 given, 0 received


tradingest View Post
The code offered by Alex is power language. You have need the C# code to run the strategy in .NET platform

Sent using the futures.io mobile app

Tradingest,

Thanks for the clarification. The editor named powerlanguage so I thought that what it is. Great to know.

Reply With Quote
     

Old October 25th, 2016, 10:08 PM   #28 (permalink)
Elite Member
Miami Lakes
 
Futures Experience: Beginner
Platform: Multicharts
Broker/Data: Interactive Brokers
Favorite Futures: Emini ES
 
Posts: 18 since Oct 2016
Thanks: 2 given, 3 received


hoang101483 View Post
Tradingest,

Thanks for the clarification. The editor named powerlanguage so I thought that what it is. Great to know.

No problem here is the code in C# . I am really interested in seeing how you can get this strategy to work, please do share the results with me.



using System;

namespace PowerLanguage.Strategy
{
public class BB : SignalObject
{
private IOrderMarket m_BBandLE;
private IOrderMarket m_BBandLX;
private IOrderMarket m_BBandSE;
private IOrderMarket m_BBandSX;

public BB(object ctx) :
base(ctx)
{
Length = 20;
NumDevsDn = 2;
}

[Input]
public int Length { get; set; }

[Input]
public double NumDevsDn { get; set; }

private VariableSeries<double> m_LowerBand;
private VariableSeries<double> m_UpperBand;

protected override void Create()
{
m_LowerBand = new VariableSeries<Double>(this);
m_UpperBand = new VariableSeries<Double>(this);
m_BBandLE = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "BBandLE", EOrderAction.Buy));
m_BBandLX = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "BBandLX", EOrderAction.Sell));
m_BBandSE = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "BBandSE", EOrderAction.SellShort));
m_BBandSX = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "BBandSX", EOrderAction.BuyToCover));
}

protected override void CalcBar()
{
m_LowerBand.Value = Bars.Close.BollingerBandCustom(Length, -NumDevsDn);
m_UpperBand.Value = Bars.Close.BollingerBandCustom(Length, NumDevsDn);

if (CurrentPosition.Value == 0) {
if (Bars.CurrentBar > 1 && Bars.Close.CrossesOver(m_LowerBand, ExecInfo.MaxBarsBack))
m_BBandLE.Send();
if (Bars.CurrentBar > 1 && Bars.Close.CrossesUnder(m_UpperBand, ExecInfo.MaxBarsBack))
m_BBandSE.Send();
}

if (CurrentPosition.Value > 0) {
if (Bars.CurrentBar > 1 && Bars.Close.CrossesUnder(m_UpperBand, ExecInfo.MaxBarsBack))
m_BBandLX.Send();
}
if (CurrentPosition.Value < 0) {
if (Bars.CurrentBar > 1 && Bars.Close.CrossesOver(m_LowerBand, ExecInfo.MaxBarsBack))
m_BBandSX.Send();
}

}
}
}

Reply With Quote
     

Old October 25th, 2016, 10:50 PM   #29 (permalink)
Trading Apprentice
Oklahoma City USA
 
Futures Experience: Intermediate
Platform: Multicharts
Favorite Futures: ES
 
Posts: 39 since Oct 2016
Thanks: 0 given, 0 received

Thanks Alex,

I compiled it, didn't give back an error, but It still show Unverified.

Can you double check the code to see if we missing anything?

Reply With Quote
     

Old October 25th, 2016, 10:58 PM   #30 (permalink)
Trading Apprentice
Oklahoma City USA
 
Futures Experience: Intermediate
Platform: Multicharts
Favorite Futures: ES
 
Posts: 39 since Oct 2016
Thanks: 0 given, 0 received


It said build suceeded, but still have that RED icon next to the signal icon on the list on the left hand. does it work on your computer? Perhaps I need to reboot mine?

Reply With Quote
     

Reply



futures.io > Futures Trading, News, Charts and Platforms > Platforms and Indicators > MultiCharts > Need help with a profitable automated trading strategy

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Trading Technologies: ADL hands-on

Dec 13

Normal webinar schedule resumes after the holidays

January

Ernie Chan: Risk Management

Elite only

Dedicated Trading Servers: Advantages/Disadvantages w/sam028

Elite only

An Afternoon with FIO member Massive I

Elite only

Leo Murphy: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
How can a strategy be profitable when backtested but not when actually used? sra18376 NinjaTrader 27 July 14th, 2014 10:48 PM
Automated trading strategy based on an alert dom64 NinjaTrader 0 February 28th, 2013 07:46 AM
Creating a successful automated trading strategy Big Mike Elite Automated Trading 66 March 21st, 2012 10:39 PM
Building a PC for Discretionary/Automated Trading and Strategy Development nlhaines Tech Support 49 June 7th, 2011 02:47 PM
ATW DPTL in automated trading strategy Accumulator NinjaTrader Programming 12 January 11th, 2010 01:17 AM


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

Copyright © 2016 by 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 2016-12-10 in 0.14 seconds with 20 queries on phoenix via your IP 54.166.37.177