Instantiate class signal and trade with them  [SOLVED]

Questions about MultiCharts .NET and user contributed studies.
mathematicurve
Posts: 1
Joined: 06 Jun 2018

Instantiate class signal and trade with them

Postby mathematicurve » 12 Jun 2018

Hello,
It's my first message in the forum!

I would like to instantiate several class signal by a global signal.

But, there is an error with the IOrderMarket. It can't be used by my global signal to trade.

Is it possible to trade in this way ? I don't want to use the Portfolio because the backtest can't calculate Ask and Bid datas in the calculation.

Thank you if you have an advice.

Code: Select all

using System;
using System.Drawing;
using System.Linq;
using PowerLanguage.Function;
using ATCenterProxy.interop;

namespace PowerLanguage.Strategy {
public class test_2 : SignalObject {
public test_2(object _ctx):base(_ctx){ctx = _ctx;}

public test_3 T3;
public object ctx;

protected override void Create() {
// create variable objects, function objects, order objects etc.
T3 = new test_3(ctx);
T3.CreateOrder();

}
protected override void StartCalc() {
// assign inputs
}
protected override void CalcBar(){

T3.MyAction();

// strategy logic

}

public class test_3 : SignalObject {
public test_3(object _ctx):base(_ctx){}

public IOrderMarket buy_order;

public void CreateOrder(){
buy_order = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, EOrderAction.Buy));
}

protected override void Create() {
// create variable objects, function objects, order objects etc.
// buy_order = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, EOrderAction.Buy));

}
protected override void StartCalc() {
// assign inputs
}
protected override void CalcBar(){
// strategy logic
//
}
public void MyAction(){
buy_order.Send();
}

}
}
}

User avatar
Anna MultiCharts
Posts: 405
Joined: 14 Jul 2017
Has thanked: 28 times
Been thanked: 103 times

Re: Instantiate class signal and trade with them  [SOLVED]

Postby Anna MultiCharts » 20 Jun 2018

Hello, mathematicurve!

Unfortunately this is not possible.


Return to “MultiCharts .NET”