Need help with a profitable automated trading strategy - MultiCharts | futures.io
futures io futures trading


Need help with a profitable automated trading strategy
Started: by hoang101483 Views / Replies:1,464 / 41
Last Reply: 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

  #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
 
  #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
 
  #23 (permalink)
Elite Member
Miami Lakes
 
Futures Experience: Beginner
Platform: Multicharts
Broker/Data: Interactive Brokers
Favorite Futures: Emini ES
 
Posts: 19 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
 
  #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
 
  #25 (permalink)
Elite Member
Milan (Italy)
 
Futures Experience: Advanced
Platform: TradeStation, MC, TWS
Broker/Data: TradeStation, IB
Favorite Futures: Futures, Forex
 
tradingest's Avatar
 
Posts: 80 since Dec 2014
Thanks: 4 given, 8 received

Futures Edge on FIO

Which time slot for our live webinar events works best for you?

 

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
 
  #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
 
  #27 (permalink)
Trading Apprentice
Oklahoma City USA
 
Futures Experience: Intermediate
Platform: Multicharts
Favorite Futures: ES
 
Posts: 39 since Oct 2016
Thanks: 0 given, 0 received

I was able to get the code kinda work. But need further refinement. You can find the thread here. Can you help?
https://futures.io/multicharts/40758-how-create-market-order-bollinger-band-se-le.html

Reply With Quote
 
  #28 (permalink)
Elite Member
Miami Lakes
 
Futures Experience: Beginner
Platform: Multicharts
Broker/Data: Interactive Brokers
Favorite Futures: Emini ES
 
Posts: 19 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
 
  #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
 
  #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 > > > > 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)
 

NinjaTrader 8: Tips and Tricks (part 2)

Mar 2
 

An Afternoon With FIO member @michaelleemoore

Elite only
 

Jigsaw Trading: Keys to successfully trading the open

Mar 9

Macro view: Trump Market Risk w/Piers Curran @ Amplify Trading

Elite only

Reading the Psychology of the Market w/Brett Steenbarger & Trading Technologies

Elite only

Hybrid Machine Learning (R and TradeStation) w/Murray Ruggiero

Elite only

Spring Grains Outlook w/Sean Lusk @ Walsh Trading

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Building a PC for Discretionary/Automated Trading and Strategy Development nlhaines Tech Support 50 January 13th, 2017 06:18 PM
Creating a successful automated trading strategy Big Mike Elite Automated Trading 69 December 27th, 2016 06:32 PM
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
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 03:04 PM.

no new posts
Page generated 2017-02-26 in 0.12 seconds with 20 queries on phoenix via your IP 54.204.130.94