Hi,I'm learning MC and EL these days,but don't know how to code the case below:
1. having active auto-trading and made 3 trades,one for base position with signal name "LE" (buy at 3754,position size is 5 contracts),2 pyramiding trades with names "Pyrmd1"(buy at 3772, size is 2 contracts), and "Pyrmd2"(buy at 3780,size is 1 contract).
2. for some reasons,turn the auto-trading mode off.
3. turn mc7's auto-trading mode on again.now how to get the position infomation in step 1. ?
I heard that only average entry price could be set,and none of others could be get in MC7,is it?
Get exist position info when re-active auto-trading
- Andrew MultiCharts
- Posts: 1587
- Joined: 11 Oct 2011
- Has thanked: 931 times
- Been thanked: 559 times
Re: Get exist position info when re-active auto-trading
Hello yoyo2000,
1. Order placement logic should be scripted in your signal. As for pyramiding, it can be enabled here.
2. It is not possible to turn on/off automation right from script. You can create a certain condition for the whole script to start/stop working, but automation should be switched on/off manually.
3. You can assign initial market position for strategy on a particular chart when you turn on automation.
1. Order placement logic should be scripted in your signal. As for pyramiding, it can be enabled here.
2. It is not possible to turn on/off automation right from script. You can create a certain condition for the whole script to start/stop working, but automation should be switched on/off manually.
3. You can assign initial market position for strategy on a particular chart when you turn on automation.
Re: Get exist position info when re-active auto-trading
thanks,Andrew.
maybe i didn't descript my problem clearly,I did mean switch on/off auto-trading manually,my initial operations are:
1. activate the strategy with the N.o 1 parameters group;
2. when market condition changes,I decide to trading with the N.o 2 parameters group,so I switch off the auto-trading mode,modify the parameters' value(or, I modify the parameters' value,auto-trading mode would be switch off by MC itself),and then switch on the auto-trading mode.
3. how to tell mc that there are 3 positions,one for base position and 2 for pyramid position
so it's semi auto-trading,and the parameters' value would be modified manually,and the difficulty is telling mc the infomation of price and size of previously position.(not average price and total size,but detailed price and size of each position)
maybe i didn't descript my problem clearly,I did mean switch on/off auto-trading manually,my initial operations are:
1. activate the strategy with the N.o 1 parameters group;
2. when market condition changes,I decide to trading with the N.o 2 parameters group,so I switch off the auto-trading mode,modify the parameters' value(or, I modify the parameters' value,auto-trading mode would be switch off by MC itself),and then switch on the auto-trading mode.
3. how to tell mc that there are 3 positions,one for base position and 2 for pyramid position
so it's semi auto-trading,and the parameters' value would be modified manually,and the difficulty is telling mc the infomation of price and size of previously position.(not average price and total size,but detailed price and size of each position)
- Andrew MultiCharts
- Posts: 1587
- Joined: 11 Oct 2011
- Has thanked: 931 times
- Been thanked: 559 times
Re: Get exist position info when re-active auto-trading
What are the conditions for switching between 3 sets of inputs for the strategy (i believe parameter = input)?
Re: Get exist position info when re-active auto-trading
yes,parameters = inputs.
and the condition for changing parameters is very subjective.
for example,a strategy of spread trading for 3 commodities,sometime establishing positions when spread is 20 points,but sometime the 20 points spread is too narrow,i'd like to trading with 50 points spread.
and the condition for changing parameters is very subjective.
for example,a strategy of spread trading for 3 commodities,sometime establishing positions when spread is 20 points,but sometime the 20 points spread is too narrow,i'd like to trading with 50 points spread.
- Andrew MultiCharts
- Posts: 1587
- Joined: 11 Oct 2011
- Has thanked: 931 times
- Been thanked: 559 times
Re: Get exist position info when re-active auto-trading
thanks,with this option,only one entry price and total position size could be inputed,if exist position established with 2 or more pyramiding tradings,how to tell MC each position's entry price and entry size?
- Andrew MultiCharts
- Posts: 1587
- Joined: 11 Oct 2011
- Has thanked: 931 times
- Been thanked: 559 times
Re: Get exist position info when re-active auto-trading
MC works with 1 general (net) position always, not with multiple separate entries/positions.
Re: Get exist position info when re-active auto-trading
so,any in-direct way to store and use multiple separate entries/positions data?for example,ELcollection
- Andrew MultiCharts
- Posts: 1587
- Joined: 11 Oct 2011
- Has thanked: 931 times
- Been thanked: 559 times
Re: Get exist position info when re-active auto-trading
In regular MultiCharts you cannot receive price of an executed order from order and Position Tracker window. You can only return Avg Entry Price (for net position), so you can write it down to a file as well as price each generated order to read (by means of a 3rd party .dll) and use this information from the file after turning automation off and on. Depending on the logic of your strategy you can use it for partial exits.
Re: Get exist position info when re-active auto-trading
You may try Global Variable or a text fileso,any in-direct way to store and use multiple separate entries/positions data?for example,ELcollection
Code: Select all
Value1 = GVSetNamedString ("LastStopPrice",NumToStr(StopPrice,4)); // Set the value
BackupStopPrice = NumtoStr(GVGetNamedString("LastStopPrice","9999")); // Retreive the value
Martin