How to create Market order for Bollinger Band SE and LE - MultiCharts | futures io social trading
futures io futures trading


How to create Market order for Bollinger Band SE and LE
Updated: Views / Replies:462 / 12
Created: by hoang101483 Attachments:0

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
 
Thread Tools Search this Thread
 

How to create Market order for Bollinger Band SE and LE

  #1 (permalink)
Trading Apprentice
Oklahoma City USA
 
Futures Experience: Intermediate
Platform: Multicharts
Favorite Futures: ES
 
Posts: 44 since Oct 2016
Thanks: 0 given, 1 received

How to create Market order for Bollinger Band SE and LE

Hi all,

I'm struggling to rewrite the defaults Bollinger Band SE LE signal. I want enter and exit based on market order. I tried something like below. I changed private IOrderMarket m_BBandLE; AND m_BBandLE = OrderCreator.MarketNextBar (new SOrderParameters(Contracts.Default, "BBandLE", EOrderAction.Buy)); as you see below. I'm getting getting an error.

using System;

namespace PowerLanguage.Strategy
{
public class Bollinger_Bands_LE : SignalObject
{
private IOrderMarket m_BBandLE;

public Bollinger_Bands_LE(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;

protected override void Create()
{
m_LowerBand = new VariableSeries<Double>(this);
m_BBandLE = OrderCreator.Stop(new SOrderParameters(Contracts.Default, "BBandLE", EOrderAction.Buy));
}

protected override void CalcBar()
{
m_LowerBand.Value = Bars.Close.BollingerBandCustom(Length, -NumDevsDn);
if (Bars.CurrentBar > 1 && Bars.Close.CrossesOver(m_LowerBand, ExecInfo.MaxBarsBack))
m_BBandLE.Send(m_LowerBand.Value);
}
}
}

Reply With Quote
 
  #2 (permalink)
Trading Apprentice
Oklahoma City USA
 
Futures Experience: Intermediate
Platform: Multicharts
Favorite Futures: ES
 
Posts: 44 since Oct 2016
Thanks: 0 given, 1 received

This is the error I'm getting

https://snag.gy/KyavZo.jpg

Reply With Quote
 
  #3 (permalink)
Elite Member
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,284 since Apr 2013
Thanks: 203 given, 724 received


hoang101483,

take a look at the MC.NET programming guide. Besides explaining how to operate the different order types, you can likely use the code snippet in section 2.2. and adapt it to your needs.

Regards,

ABCTG

Reply With Quote
 
  #4 (permalink)
Trading Apprentice
Oklahoma City USA
 
Futures Experience: Intermediate
Platform: Multicharts
Favorite Futures: ES
 
Posts: 44 since Oct 2016
Thanks: 0 given, 1 received


ABCTG View Post
hoang101483,

take a look at the MC.NET programming guide. Besides explaining how to operate the different order types, you can likely use the code snippet in section 2.2. and adapt it to your needs.

Regards,

ABCTG

ABCTG,

Thanks for for the link. I tried to modify it but still getting the same error. Something is wrong with this part. Can you help me?

m_LowerBand.Value = Bars.Close.BollingerBandCustom(Length, -NumDevsDn);
if (Bars.CurrentBar > 1 && Bars.Close.CrossesOver(m_LowerBand, ExecInfo.MaxBarsBack))
m_BBandLE.Send(m_LowerBand.Value);

Reply With Quote
 
  #5 (permalink)
Trading Apprentice
Oklahoma City USA
 
Futures Experience: Intermediate
Platform: Multicharts
Favorite Futures: ES
 
Posts: 44 since Oct 2016
Thanks: 0 given, 1 received


hoang101483 View Post
ABCTG,

Thanks for for the link. I tried to modify it but still getting the same error. Something is wrong with this part. Can you help me?

m_LowerBand.Value = Bars.Close.BollingerBandCustom(Length, -NumDevsDn);
if (Bars.CurrentBar > 1 && Bars.Close.CrossesOver(m_LowerBand, ExecInfo.MaxBarsBack))
m_BBandLE.Send(m_LowerBand.Value);

It is saying can not double to init.... Can you tell me how to fix it?

Reply With Quote
 
  #6 (permalink)
Elite Member
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,284 since Apr 2013
Thanks: 203 given, 724 received

hoang101483,

you are trying to send the value of the bollinger band as quantity of a market order. You can for example issue the order without specifying a quantity and have MC use the default one as specified in your workspace.

Regards,

ABCTG

Reply With Quote
 
  #7 (permalink)
Trading Apprentice
Oklahoma City USA
 
Futures Experience: Intermediate
Platform: Multicharts
Favorite Futures: ES
 
Posts: 44 since Oct 2016
Thanks: 0 given, 1 received


ABCTG View Post
hoang101483,

you are trying to send the value of the bollinger band as quantity of a market order. You can for example issue the order without specifying a quantity and have MC use the default one as specified in your workspace.

Regards,

ABCTG

Can you just tell me how to fix it. I'm not very good with coding. I tried this. But failed.

m_HigherBand.Value = Bars.Close.BollingerBandCustom(Length, NumDevsUp);
if ( Bars.Close.CrossesUnder(m_HigherBand, ExecInfo.MaxBarsBack))
m_BBandSE.Send(m_HigherBand.Value);

Reply With Quote
 
  #8 (permalink)
Trading Apprentice
Oklahoma City USA
 
Futures Experience: Intermediate
Platform: Multicharts
Favorite Futures: ES
 
Posts: 44 since Oct 2016
Thanks: 0 given, 1 received


hoang101483 View Post
Can you just tell me how to fix it. I'm not very good with coding. I tried this. But failed.

m_HigherBand.Value = Bars.Close.BollingerBandCustom(Length, NumDevsUp);
if ( Bars.Close.CrossesUnder(m_HigherBand, ExecInfo.MaxBarsBack))
m_BBandSE.Send(m_HigherBand.Value);

This is what I have currently. which line do I need to fix?

using System;

namespace PowerLanguage.Strategy
{
public class Bollinger_Bands_LE : SignalObject
{
private IOrderMarket m_BBandLE;

public Bollinger_Bands_LE(object ctx) :
base(ctx)
{
Length = 10;
NumDevsDn = 1;
}

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

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

private VariableSeries<double> m_LowerBand;

protected override void Create()
{
m_LowerBand = new VariableSeries<Double>(this);
m_BBandLE = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "BBandLE", EOrderAction.Buy));
}

protected override void CalcBar()
{
m_LowerBand.Value = Bars.Close.BollingerBandCustom(Length, -NumDevsDn);
if (Bars.CurrentBar > 1 && Bars.Close.CrossesOver(m_LowerBand, ExecInfo.MaxBarsBack))
m_BBandLE.Send(m_LowerBand.Value);
}
}
}

Reply With Quote
 
  #9 (permalink)
Trading Apprentice
Oklahoma City USA
 
Futures Experience: Intermediate
Platform: Multicharts
Favorite Futures: ES
 
Posts: 44 since Oct 2016
Thanks: 0 given, 1 received

ABCTG,

Please Please help me. tI would a lot to me if I can automate this strategy

Reply With Quote
 
  #10 (permalink)
Trading Apprentice
Oklahoma City USA
 
Futures Experience: Intermediate
Platform: Multicharts
Favorite Futures: ES
 
Posts: 44 since Oct 2016
Thanks: 0 given, 1 received


Pump. Would someone please help me !

Reply With Quote

Reply



futures io > > > > How to create Market order for Bollinger Band SE and LE

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Introducing iSystems with Stage 5 Trading

Apr 27

FIO Journal Challenge featuring NinjaTrader ($2,000+ of prizes)

May

Prototyping Python Strategies (part 2) w/Ran Aroussi

Elite only

Ask Me Anything w/Raymond Deux @ NinjaTrader

May 3

An Afternoon with FIO member Softsoap

Elite only
 

Machine Learning & Data Mining Bias w/Kris Longmore @ Robot Wealth

Elite only

Brannigan Barrett (TBA)

Elite only

FIO member Gomi (TBA)

Elite only

FuturesTrader71 (TBA)

Elite only

EasyLanguage Programming w/Chris @ ABC Trading Group

Elite only

Portfolio Diversification w/Brendon Delate

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Bollinger Band in the Market Analyzer? chrille NinjaTrader 0 March 10th, 2016 04:51 AM
Bollinger Band Price Markers Only stockgoblin NinjaTrader 8 March 22nd, 2014 03:36 PM
(Request) Bollinger Band and %B aseemmv23 AmiBroker 2 August 28th, 2013 07:13 AM
Bollinger Band settings? Joseph689 NinjaTrader 3 March 17th, 2013 12:03 PM
CCI bollinger band booker777 NinjaTrader 1 September 10th, 2012 03:25 AM


All times are GMT -4. The time now is 10:22 PM.

no new posts
Page generated 2017-04-27 in 0.12 seconds with 20 queries on phoenix via your IP 54.80.203.145