MouseClick order entry question  [SOLVED]

Questions about MultiCharts and user contributed studies.
maxflight
Posts: 5
Joined: 12 Oct 2011
Has thanked: 1 time
Been thanked: 1 time

MouseClick order entry question

Postby maxflight » 13 Sep 2012

Hello, I am trying to see if I can minimize the amount of clicks for an order entry so I decided to try out the MouseClick functions.

I'm testing it out on HSI futures (so no decimals on the price). However, no orders get generated with my code and I'm not too sure where the error is. I used the print line to see that all the variables seem to be what I was expecting. My guess is either my order entry lines of code is incorrect or I'm doing something that's not allowed.

Any help would be appreciated, thanks in advance!

Code: Select all

[IntrabarOrderGeneration = false]
[ProcessMouseEvents = true]

if MouseClickCtrlPressed = true
and MouseClickShiftPressed = false then
begin
if MouseClickPrice > Close then
Buy ( "MCLongStop" ) 1 contract next bar at Round(MouseClickPrice,0) stop;

if MouseClickPrice <= Close then
Buy ( "MCLongLimit" ) 1 contract next bar at Round(MouseClickPrice,0) limit;
end;
print(MouseClickCtrlPressed, " ", MouseClickShiftPressed, " ", MouseClickPrice, " ", Round(MouseClickPrice,0), " ", Close);

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

Re: MouseClick order entry question  [SOLVED]

Postby TJ » 14 Sep 2012

Hello, I am trying to see if I can minimize the amount of clicks for an order entry so I decided to try out the MouseClick functions.

I'm testing it out on HSI futures (so no decimals on the price). However, no orders get generated with my code and I'm not too sure where the error is. I used the print line to see that all the variables seem to be what I was expecting. My guess is either my order entry lines of code is incorrect or I'm doing something that's not allowed.

Any help would be appreciated, thanks in advance!

Code: Select all

[IntrabarOrderGeneration = false]
[ProcessMouseEvents = true]

if MouseClickCtrlPressed = true
and MouseClickShiftPressed = false then
begin
if MouseClickPrice > Close then
Buy ( "MCLongStop" ) 1 contract next bar at Round(MouseClickPrice,0) stop;

if MouseClickPrice <= Close then
Buy ( "MCLongLimit" ) 1 contract next bar at Round(MouseClickPrice,0) limit;
end;
print(MouseClickCtrlPressed, " ", MouseClickShiftPressed, " ", MouseClickPrice, " ", Round(MouseClickPrice,0), " ", Close);
It worked for me.

Did you arm the chart?

The button is located at the top left corner of the chart. It should read either [SA] or [AA].

maxflight
Posts: 5
Joined: 12 Oct 2011
Has thanked: 1 time
Been thanked: 1 time

Re: MouseClick order entry question

Postby maxflight » 14 Sep 2012

Hello, I am trying to see if I can minimize the amount of clicks for an order entry so I decided to try out the MouseClick functions.

I'm testing it out on HSI futures (so no decimals on the price). However, no orders get generated with my code and I'm not too sure where the error is. I used the print line to see that all the variables seem to be what I was expecting. My guess is either my order entry lines of code is incorrect or I'm doing something that's not allowed.

Any help would be appreciated, thanks in advance!

Code: Select all

[IntrabarOrderGeneration = false]
[ProcessMouseEvents = true]

if MouseClickCtrlPressed = true
and MouseClickShiftPressed = false then
begin
if MouseClickPrice > Close then
Buy ( "MCLongStop" ) 1 contract next bar at Round(MouseClickPrice,0) stop;

if MouseClickPrice <= Close then
Buy ( "MCLongLimit" ) 1 contract next bar at Round(MouseClickPrice,0) limit;
end;
print(MouseClickCtrlPressed, " ", MouseClickShiftPressed, " ", MouseClickPrice, " ", Round(MouseClickPrice,0), " ", Close);
It worked for me.

Did you arm the chart?

The button is located at the top left corner of the chart. It should read either [SA] or [AA].
Thank you, TJ. Not arming the chart was the reason. It was my first time testing out strategy stuff on Multicharts.

However, now it looks like my orders are being rejected:
"Instrument: CLV2; Order: Buy Stop 1; Status: Rejected"

Not exactly the most informative log detail. Is there anyway i can find out why it was rejected?

When I manually enter an order with right click and then choose type of order, it works just fine.

Is there an alternative way for me to try to speed up the order entry process?
I just wanted to right click -> choose order type process to a ctrl or shift click.

maxflight
Posts: 5
Joined: 12 Oct 2011
Has thanked: 1 time
Been thanked: 1 time

Re: MouseClick order entry question

Postby maxflight » 14 Sep 2012

Nevermind, I see that I need to attach a trading account to the strategy.

The alternative question still apply though :)

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

Re: MouseClick order entry question

Postby TJ » 14 Sep 2012

Nevermind, I see that I need to attach a trading account to the strategy.

The alternative question still apply though :)
Look into the settings in Format Signal. There are many options you can choose from.


Return to “MultiCharts”