PlaceMarketOrder - Usage ?  [SOLVED]

Questions about MultiCharts and user contributed studies.
maxmax68
Posts: 163
Joined: 20 Nov 2012
Has thanked: 55 times
Been thanked: 48 times

PlaceMarketOrder - Usage ?

Postby maxmax68 » 07 Feb 2017

PlaceMarketOrder
Places market order at the broker without position changing on the chart.

Usage
PlaceMarketOrder(IsBuy, IsEntry, Contracts)
Where:

IsBuy - indicates whether order is buy or sell;
IsEntry - indicates whether order is entry or exit;
Contracts - indicates the number of contracts/shares of the order.
Please, could you explain the correct setting of the parameters for the following six possibilities:

Long +2 to Flat 0

Long +2 to Short -1

Short -2 to Flat 0

Short -2 to Long +1

Flat 0 to Long +2

Flat 0 to Short -2

Thanks
Best regards
Massimo

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: PlaceMarketOrder - Usage ?

Postby TJ » 08 Feb 2017

PlaceMarketOrder
Places market order at the broker without position changing on the chart.

Usage
PlaceMarketOrder(IsBuy, IsEntry, Contracts)
Where:

IsBuy - indicates whether order is buy or sell;
IsEntry - indicates whether order is entry or exit;
Contracts - indicates the number of contracts/shares of the order.
Please, could you explain the correct setting of the parameters for the following six possibilities:
Long +2 to Flat 0
Long +2 to Short -1
Short -2 to Flat 0
Short -2 to Long +1
Flat 0 to Long +2
Flat 0 to Short -2
Thanks
Best regards
Massimo

On your quote above,
why don't you include the usage example?
It is part of the help file.

maxmax68
Posts: 163
Joined: 20 Nov 2012
Has thanked: 55 times
Been thanked: 48 times

Re: PlaceMarketOrder - Usage ?

Postby maxmax68 » 08 Feb 2017

Hello TJ,
excuse me if I will be rude,
please sometimes give an answer,
do not replay always with a question.
If you know please give your answer for all users.

Best regards
Massimo

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: PlaceMarketOrder - Usage ?

Postby TJ » 08 Feb 2017

Hello TJ,
excuse me if I will be rude,
please sometimes give an answer,
do not replay always with a question.
If you know please give your answer for all users.

Best regards
Massimo

The answer is in the usage example that you intentionally omitted.
Excuse me I wasn't trying to make you look stupid, I was only pointing out the obvious.

maxmax68
Posts: 163
Joined: 20 Nov 2012
Has thanked: 55 times
Been thanked: 48 times

Re: PlaceMarketOrder - Usage ?

Postby maxmax68 » 08 Feb 2017

Example

If MarketPosition = 2 then
PlaceMarketOrder(true, true, 2);

Will place buy market order for 2 contracts if current MarketPosition = 2.
Unfortunately, the example is not exhaustive,
as well as it is not complete the description of the keyword "PlaceMarketOrder".
In fact there is no hint that this function returns a true / false value, and how to use this thing.

If Long +2 to go short -1, certainly IsBuy is False, IsEntry should be True, Contracs is my doubt. 3 for the total from +2 to -1, or directly 1 for the entered short position ?
The example is not enough, and I can not do tests at the expense of my money !

The answer to MC Support.

Best regards
Massimo

User avatar
Angelina MultiСharts
Posts: 260
Joined: 28 Dec 2016
Has thanked: 28 times
Been thanked: 66 times

Re: PlaceMarketOrder - Usage ?  [SOLVED]

Postby Angelina MultiСharts » 09 Feb 2017

Hello Massimo,

Here are the samples:

Code: Select all

input: test(0);
var: mp(0);

if(not LastBarOnChart_s ) then #return;

mp = MarketPosition_at_Broker;

if(mp = 2 and test = 1) then PlaceMarketOrder(false, false, 2); // Long +2 to Flat 0

if(mp = 2 and test = 2) then PlaceMarketOrder(false, true, 3); // Long +2 to Short -1

if(mp = -2 and test = 3) then PlaceMarketOrder(true, false, 2); // Short -2 to Flat 0

if(mp = -2 and test = 4) then PlaceMarketOrder(true, true, 3); // Short -2 to Long +1

if(mp = 0 and test = 5) then PlaceMarketOrder(true, true, 2); // Flat 0 to Long +2

if(mp = 0 and test = 6) then PlaceMarketOrder(false, true, 2); // Flat 0 to Long -2


Return to “MultiCharts”