is it possible to place fixed dollar amount of order?

Questions about MultiCharts and user contributed studies.
justmake
Posts: 42
Joined: 21 Dec 2010
Has thanked: 15 times
Been thanked: 1 time

is it possible to place fixed dollar amount of order?

Postby justmake » 05 Jan 2011

From the example of EasyLanguage tutorial, if I want to place certain shares in a order"
I will write:

Buy 2 Shares Next Bar At Market;
(Buy 2 shares at Market price on open of next bar)

What if I am trying to place $1000 dollar fixed amount of money per trade.
How do I do it?

Buy $1000 Next Bar at Market; ?

Can anyone share how you do it?

User avatar
Dave Masalov
Posts: 1712
Joined: 16 Apr 2010
Has thanked: 51 times
Been thanked: 485 times

Re: is it possible to place fixed dollar amount of order?

Postby Dave Masalov » 11 Jan 2011

Dear justmake,

You can specify in the code only the number of contracts to buy. If you want to set dollars per trade value, you can do this in Strategy Properties --> Properties or you can calculate the number of contracts that should be bought for needed amount of money: i.e. divide the dollars per trade value by the current price in the code.

Rommi
Posts: 9
Joined: 15 Sep 2010

Re: is it possible to place fixed dollar amount of order?

Postby Rommi » 13 Jan 2011

justmake wrote:From the example of EasyLanguage tutorial, if I want to place certain shares in a order"
I will write:

Buy 2 Shares Next Bar At Market;
(Buy 2 shares at Market price on open of next bar)

What if I am trying to place $1000 dollar fixed amount of money per trade.
How do I do it?

Buy $1000 Next Bar at Market; ?

Can anyone share how you do it?


Hi,

You could try

Code: Select all

Inputs:Amount$(1000);
Vars:Amount(0);
Amount=Amount$/close;

Buy next bar Amount shares at Market;

 

justmake
Posts: 42
Joined: 21 Dec 2010
Has thanked: 15 times
Been thanked: 1 time

Re: is it possible to place fixed dollar amount of order?

Postby justmake » 16 Jan 2011

Thanks! that should work:)


Return to “MultiCharts”