Assigning Initial Market Position within the script ?  [SOLVED]

Questions about MultiCharts and user contributed studies.
benho
Posts: 48
Joined: 27 Dec 2015
Has thanked: 12 times
Been thanked: 2 times

Assigning Initial Market Position within the script ?

Postby benho » 18 Aug 2016

Hi there,

I usually switch off my trading computer every Sat and re-start on Sunday evening. Is there any way that I can assign initial market position of a symbol/strategy when it starts by reading open position information from a text file instead of synchronizing market position with broker's record ?

Thanks.

User avatar
Kristina MultiCharts
Posts: 63
Joined: 04 Sep 2014
Has thanked: 5 times
Been thanked: 34 times

Re: Assigning Initial Market Position within the script ?

Postby Kristina MultiCharts » 18 Aug 2016

Hi,

You can assign initial market position for the strategy by adding a dll to the script of your signal that would read from a file your position when you turn on auto-trading.

There is a sample DLL with source files: https://drive.google.com/file/d/0B5jd5M ... sp=sharing
Some more information can be found here: http://www.multicharts.com/discussion/v ... lit=IOData

Using the functions InData, OutData, RFile, SFile, ADDStringFile, DelFile, DirCreate this library can write to file, read from file, add a line to file, delete file, create folder.

benho
Posts: 48
Joined: 27 Dec 2015
Has thanked: 12 times
Been thanked: 2 times

Re: Assigning Initial Market Position within the script ?

Postby benho » 18 Aug 2016

Hi Kristina,

I know the DLL you mentioned in the post. My question/problem is, can I assign the open position details within the signal when it is turned on ? That means, can I do this:

1. When a signal is turned on, market position is flat
2. Read in open position details from a text file, then
3. Set/Assign/Initialize the direction (long/short) of current market position, number of open contracts and entry price according to the text file information.

Thanks.

User avatar
Kristina MultiCharts
Posts: 63
Joined: 04 Sep 2014
Has thanked: 5 times
Been thanked: 34 times

Re: Assigning Initial Market Position within the script ?  [SOLVED]

Postby Kristina MultiCharts » 18 Aug 2016

Hi,

1) Before turning on auto-trading, you need to check your market position in the file by using the dll I specified in the previous post.
2) After you turn on auto-trading you will need to check that Auto-Trading was turned on by using the following command GetAppInfo (aiStrategyAuto)
3) Then you will need to change market position for the strategy to the position that you checked in the file by using following command http://www.multicharts.com/trading-soft ... etPosition


Return to “MultiCharts”