Need help with a profitable automated trading strategy - futures io
futures io futures trading



Need help with a profitable automated trading strategy


Discussion in MultiCharts

Updated by hoang101483
    1. trending_up 4,806 views
    2. thumb_up 0 thanks given
    3. group 5 followers
    1. forum 41 replies
    2. attach_file 2 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 100,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
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

(If you already have an account, login at the top of the page)

 
Search this Thread
 

Need help with a profitable automated trading strategy

(login for full post details)
  #31 (permalink)
Miami Lakes
 
Experience: Beginner
Platform: Multicharts
Broker: Interactive Brokers
Trading: Emini ES
 
Posts: 19 since Oct 2016
Thanks: 2 given, 3 received


hoang101483 View Post
It said build suceeded, but still have that RED icon next two the signal icon list. does it works on your computer? Perhaps I need to reboot mine?

It works for me just fine. See attached, you should be able to unzip and import it to your Multicharts.NET. I have the latest version.

Attached Files
Register to download File Type: zip BB.zip (2.2 KB, 7 views)
Reply With Quote

Can you help answer these questions
from other members on futures io?
Evening session trading
NinjaTrader
Horizontal Line Indicator
Platforms and Indicators
Need a near crosses scan help for TOS
ThinkOrSwim
OPEN_CLOSE_DOTS
ThinkOrSwim
How to place NT8 indicator output into a grid, under each bar?
NinjaTrader
 
 
(login for full post details)
  #32 (permalink)
Oklahoma City USA
 
 
Posts: 47 since Oct 2016
Thanks: 0 given, 1 received


alex20037 View Post
It works for me just fine. See attached, you should be able to unzip and import it to your Multicharts.NET. I have the latest version.

Thanks Alex,

It is working now. One small issue. If you open the default BB LE and SE it will basically reverse at each signal. Can we do exactly that?

Your code basically have entry long, exit long and vice versa instead of reversal at each signal. If you add the signal to the chart, you will see what I'm talking about. I wonder if you code each signal on a separate file would fix this issue. Let me know if you can fix this.

Reply With Quote
 
(login for full post details)
  #33 (permalink)
Miami Lakes
 
Experience: Beginner
Platform: Multicharts
Broker: Interactive Brokers
Trading: Emini ES
 
Posts: 19 since Oct 2016
Thanks: 2 given, 3 received



hoang101483 View Post
Thanks Alex,

It is working now. One small issue. If you open the default BB LE and SE it will basically reverse at each signal. Can we do exactly that?

Your code basically have entry long, exit long and vice versa instead of reversal at each signal. If you add the signal to the chart, you will see what I'm talking about. I wonder if you code each signal on a separate file would fix this issue. Let me know if you can fix this.

See attached now. I can't get it to actually show the reverse in the chart, show 2 contracts instead of 1, that'll be something to look into later on when we have good numbers. But you can see that it is doing it, if you see the performance report for example. So if it is long one contract it sells it and short sells a second one, if it is short then it covers it and then buys another one.

Attached Files
Register to download File Type: zip BBv2.zip (2.3 KB, 8 views)
Reply With Quote
 
(login for full post details)
  #34 (permalink)
Oklahoma City USA
 
 
Posts: 47 since Oct 2016
Thanks: 0 given, 1 received

Alex,

thanks for that. i think you misunderstood me. you see how the default bb has LE and SE. what we can do is spliting up the BB file into two file. one foe LE LX, another for SE and SX. this way we have perfect reversal I hope. let me know if you can do it

Reply With Quote
 
(login for full post details)
  #35 (permalink)
Miami Lakes
 
Experience: Beginner
Platform: Multicharts
Broker: Interactive Brokers
Trading: Emini ES
 
Posts: 19 since Oct 2016
Thanks: 2 given, 3 received


hoang101483 View Post
Alex,

thanks for that. i think you misunderstood me. you see how the default bb has LE and SE. what we can do is spliting up the BB file into two file. one foe LE LX, another for SE and SX. this way we have perfect reversal I hope. let me know if you can do it

Splitting in two files won't make a difference, code is still the same. I will look into it when I have a chance, however this is for sure doing now what we want to, see the strategy performance report please, it does reverse, only doesn't show in the chart.
I was looking and also the you see how the default bb LE and SE that come with multicharts also behave like this, they do reverse, but the chart only shows the new open order.

Reply With Quote
 
(login for full post details)
  #36 (permalink)
Oklahoma City USA
 
 
Posts: 47 since Oct 2016
Thanks: 0 given, 1 received

Alex,

I got it to work. Here is the code

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.SellShort));
m_BBandSE = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "BBandSE", EOrderAction.SellShort));
m_BBandSX = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "BBandSX", EOrderAction.Buy));
}

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
 
(login for full post details)
  #37 (permalink)
Miami Lakes
 
Experience: Beginner
Platform: Multicharts
Broker: Interactive Brokers
Trading: Emini ES
 
Posts: 19 since Oct 2016
Thanks: 2 given, 3 received

I guess now the question is, how do we make this profitable long term?

Reply With Quote
 
(login for full post details)
  #38 (permalink)
Oklahoma City USA
 
 
Posts: 47 since Oct 2016
Thanks: 0 given, 1 received

argh. never mind. It did create a double order. so That code didn't work

Reply With Quote
 
(login for full post details)
  #39 (permalink)
Oklahoma City USA
 
 
Posts: 47 since Oct 2016
Thanks: 0 given, 1 received

Alex,

I think the issue is somewhere here.

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
 
(login for full post details)
  #40 (permalink)
Oklahoma City USA
 
 
Posts: 47 since Oct 2016
Thanks: 0 given, 1 received


I think I might have fixed the issue by getting rid of the position argument all together

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.SellShort));
m_BBandSE = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "BBandSE", EOrderAction.Sell));
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 (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 (Bars.CurrentBar > 1 && Bars.Close.CrossesUnder(m_UpperBand, ExecInfo.MaxBarsBack))
m_BBandLX.Send();
if (Bars.CurrentBar > 1 && Bars.Close.CrossesUnder(m_UpperBand, ExecInfo.MaxBarsBack))
m_BBandLX.Send();
}



}
}

Reply With Quote


futures io Trading Community Platforms and Indicators MultiCharts > Need help with a profitable automated trading strategy


October 26, 2016


Upcoming Webinars and Events
 

Live Video Panel: Ask Me Anything w/Ironbeam Brokerage

Aug 6
     



Copyright © 2020 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