.SendFromEntry() [SOLVED]
- Polly MultiCharts
- Posts: 210
- Joined: 20 Jul 2022
- Has thanked: 1 time
- Been thanked: 57 times
Re: .SendFromEntry() [SOLVED]
Hello BD.,
IOrderPriced.SendFromEntry Method allows the generation of Price exit from entry order with 'price' price and 'num_lots' number of contracts.
For more info please see Help Content in PowerLanguage Editor → Help → PowerLanguage Editor .NET Help → PowerLanguage → IOrderPriced Interface → Methods → SendFromEntry Method.
Here is the usage sample you can refer to:
IOrderPriced.SendFromEntry Method allows the generation of Price exit from entry order with 'price' price and 'num_lots' number of contracts.
For more info please see Help Content in PowerLanguage Editor → Help → PowerLanguage Editor .NET Help → PowerLanguage → IOrderPriced Interface → Methods → SendFromEntry Method.
Here is the usage sample you can refer to:
Code: Select all
using System;
using System.Drawing;
using System.Linq;
using PowerLanguage.Function;
using ATCenterProxy.interop;
namespace PowerLanguage.Strategy {
public class test : SignalObject {
public test(object _ctx):base(_ctx){}
private IOrderMarket buy_order;
private IOrderPriced sell_FromEntry;
protected override void Create() {
// create variable objects, function objects, order objects etc.
buy_order = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, "Buy", EOrderAction.Buy));
sell_FromEntry = OrderCreator.Stop(new SOrderParameters(Contracts.Default, "Sell", EOrderAction.Sell, OrderExit.FromEntry()));
}
protected override void StartCalc() {
// assign inputs
}
protected override void CalcBar(){
// strategy logic
buy_order.Send() ;
sell_FromEntry.SendFromEntry(Bars.Close[0]-20*Bars.Point,"Buy");
}
}
}
Re: .SendFromEntry()
Hi @Polly,
Would be lovely if you pinged answers to the following:
- OrderExit is a class having info on the exit type. Among other things, it has following members:
1) EExitType
2) FromAll
3) FromEntry
4) FromEntryTotal
5) Total
Yet, the above are not properly defined, or exemplified in terms of usage nowhere.
- EExitType is an Enumeration w/ following properties:
1) All
2) FromOne
3) FromOneTotal
4) Total
5) GetName
6) GetNames
7) GetValues
Parse
9) .......
Other questions:
10) How does placing or not placing a "name" into a "Contracts.Specified" type of SORderParameters defined order, impacting a scale-in / scale-out trade execution.
11) What are the complete list of rules of engagement between various order types acting on the same instrument on a timeline ...
12) How do you control Strategy Property -> Position Limits from code
13) How do you allow just the initiating order to scale-in / add to its position?
Yet, these are NOT properly defined anywhere, nor exemplified how to be used.
- Your own example above: { sell_FromEntry.SendFromEntry(Bars.Close[0]-20*Bars.Point,"Buy"); }. makes no sense. Every bar will have a send entry order and a limit order - not clear to exemplify this order type, you basically send 2 orders every bar - it is not realistic. A more realistic would be - say, you send the entry on bar 100, and the limit exit on bar 200. What is the expected outcome?
- Are there any examples on adding 2 times to a position and then removing 2 times from a position, to its total liquidation, and how do you preserve a position "identity" in code ...
- How do you scale in multiple times, and then scale out multiple times from a position, within a strategy, without messing about with Strategy's "Allow up to 10 entry orders ..." setting (leaving this to disabled)?
Would be lovely if you pinged answers to the following:
- OrderExit is a class having info on the exit type. Among other things, it has following members:
1) EExitType
2) FromAll
3) FromEntry
4) FromEntryTotal
5) Total
Yet, the above are not properly defined, or exemplified in terms of usage nowhere.
- EExitType is an Enumeration w/ following properties:
1) All
2) FromOne
3) FromOneTotal
4) Total
5) GetName
6) GetNames
7) GetValues
Parse
9) .......
Other questions:
10) How does placing or not placing a "name" into a "Contracts.Specified" type of SORderParameters defined order, impacting a scale-in / scale-out trade execution.
11) What are the complete list of rules of engagement between various order types acting on the same instrument on a timeline ...
12) How do you control Strategy Property -> Position Limits from code
13) How do you allow just the initiating order to scale-in / add to its position?
Yet, these are NOT properly defined anywhere, nor exemplified how to be used.
- Your own example above: { sell_FromEntry.SendFromEntry(Bars.Close[0]-20*Bars.Point,"Buy"); }. makes no sense. Every bar will have a send entry order and a limit order - not clear to exemplify this order type, you basically send 2 orders every bar - it is not realistic. A more realistic would be - say, you send the entry on bar 100, and the limit exit on bar 200. What is the expected outcome?
- Are there any examples on adding 2 times to a position and then removing 2 times from a position, to its total liquidation, and how do you preserve a position "identity" in code ...
- How do you scale in multiple times, and then scale out multiple times from a position, within a strategy, without messing about with Strategy's "Allow up to 10 entry orders ..." setting (leaving this to disabled)?
Last edited by andrei on 06 Apr 2024, edited 2 times in total.
Re: .SendFromEntry()
Well, I just wanted the syntax, so that example is good enough. But it would definitely be nice to see a well structured guide with some examples to help new coders like myself to learn how to use mc.net. I doubt we will see it any time soon thou, just have to try and see.Hi @Polly,
Would be lovely if you pinged answers to the following:
- OrderExit is a class having info on the exit type. Among other things, it has following members:
1) EExitType
2) FromAll
3) FromEntry
4) FromEntryTotal
5) Total
Yet, the above are not properly defined, or exemplified in terms of usage nowhere.
- EExitType is an Enumeration w/ following properties:
1) All
2) FromOne
3) FromOneTotal
4) Total
5) GetName
6) GetNames
7) GetValues
Parse
9) .......
Yet, these are NOT properly defined anywhere, nor exemplified how to be used.
- Your own example above: { sell_FromEntry.SendFromEntry(Bars.Close[0]-20*Bars.Point,"Buy"); }. makes no sense. Every bar will have a send entry order and a limit order - not clear to exemplify this order type. Say, you send the entry on bar 100, and the limit exit on bar 200. What is the expected outcome?
- Are there any examples on adding 2 times to a position and then removing 2 times from a position, to its total liquidation, and how do you preserve a position "identity" in code ...
- How do you scale in multiple times, and then scale out multiple times from a position, within a strategy, without messing about with Strategy's "Allow up to 10 entry orders ..." setting (leaving this to disabled)?
Re: .SendFromEntry()
Yeah ... but then there's others catching up big time in this space ... so you stay idle, you become idle. the other killer is being limited to .NET Framework 4.0 - let's not go thereWell, I just wanted the syntax, so that example is good enough. But it would definitely be nice to see a well structured guide with some examples to help new coders like myself to learn how to use mc.net. I doubt we will see it any time soon thou, just have to try and see.Hi @Polly,
Would be lovely if you pinged answers to the following:
- OrderExit is a class having info on the exit type. Among other things, it has following members:
1) EExitType
2) FromAll
3) FromEntry
4) FromEntryTotal
5) Total
Yet, the above are not properly defined, or exemplified in terms of usage nowhere.
- EExitType is an Enumeration w/ following properties:
1) All
2) FromOne
3) FromOneTotal
4) Total
5) GetName
6) GetNames
7) GetValues
Parse
9) .......
Yet, these are NOT properly defined anywhere, nor exemplified how to be used.
- Your own example above: { sell_FromEntry.SendFromEntry(Bars.Close[0]-20*Bars.Point,"Buy"); }. makes no sense. Every bar will have a send entry order and a limit order - not clear to exemplify this order type. Say, you send the entry on bar 100, and the limit exit on bar 200. What is the expected outcome?
- Are there any examples on adding 2 times to a position and then removing 2 times from a position, to its total liquidation, and how do you preserve a position "identity" in code ...
- How do you scale in multiple times, and then scale out multiple times from a position, within a strategy, without messing about with Strategy's "Allow up to 10 entry orders ..." setting (leaving this to disabled)?
Re: .SendFromEntry()
It's true. hope they are aware and have a plan.Yeah ... but then there's others catching up big time in this space ... so you stay idle, you become idle. the other killer is being limited to .NET Framework 4.0 - let's not go thereWell, I just wanted the syntax, so that example is good enough. But it would definitely be nice to see a well structured guide with some examples to help new coders like myself to learn how to use mc.net. I doubt we will see it any time soon thou, just have to try and see.Hi @Polly,
Would be lovely if you pinged answers to the following:
- OrderExit is a class having info on the exit type. Among other things, it has following members:
1) EExitType
2) FromAll
3) FromEntry
4) FromEntryTotal
5) Total
Yet, the above are not properly defined, or exemplified in terms of usage nowhere.
- EExitType is an Enumeration w/ following properties:
1) All
2) FromOne
3) FromOneTotal
4) Total
5) GetName
6) GetNames
7) GetValues
Parse
9) .......
Yet, these are NOT properly defined anywhere, nor exemplified how to be used.
- Your own example above: { sell_FromEntry.SendFromEntry(Bars.Close[0]-20*Bars.Point,"Buy"); }. makes no sense. Every bar will have a send entry order and a limit order - not clear to exemplify this order type. Say, you send the entry on bar 100, and the limit exit on bar 200. What is the expected outcome?
- Are there any examples on adding 2 times to a position and then removing 2 times from a position, to its total liquidation, and how do you preserve a position "identity" in code ...
- How do you scale in multiple times, and then scale out multiple times from a position, within a strategy, without messing about with Strategy's "Allow up to 10 entry orders ..." setting (leaving this to disabled)?
- Polly MultiCharts
- Posts: 210
- Joined: 20 Jul 2022
- Has thanked: 1 time
- Been thanked: 57 times
Re: .SendFromEntry()
Dear users,
Indicators and signals for MultiCharts .NET can be written using C# and VB.NET programming languages. The following information requires that the reader has basic knowledge of any C# or VB.NET programming languages. For more detailed info you can check the following reference.
The script execution logic is described in the EasyLanguage guides from TS. Here are some additional resources.
The names of the methods in our implementation, if possible, repeat the keywords from PowerLanguage.
As for new .NET Framework versions support, our developers are evaluating it, there's no ETA yet.
Indicators and signals for MultiCharts .NET can be written using C# and VB.NET programming languages. The following information requires that the reader has basic knowledge of any C# or VB.NET programming languages. For more detailed info you can check the following reference.
The script execution logic is described in the EasyLanguage guides from TS. Here are some additional resources.
The names of the methods in our implementation, if possible, repeat the keywords from PowerLanguage.
As for new .NET Framework versions support, our developers are evaluating it, there's no ETA yet.