Filled same price

Questions about MultiCharts and user contributed studies.
tradingest
Posts: 283
Joined: 05 Dec 2014
Location: Italy
Has thanked: 53 times
Been thanked: 3 times

Filled same price

Postby tradingest » 03 Nov 2016

Hi all,

I have a big problem and I hope to resolve it.
Like show in the picture below when the target is reach in the same bar the code below is not taken into account

Image

Code: Select all

If MP = 1
Then Begin
value10 = 99999;
End;
Somebody have the solution for this problem?

thanks in advance
Attachments
SamePrice.JPG
(82.96 KiB) Downloaded 428 times

wilkinsw
Posts: 662
Joined: 21 Apr 2013
Has thanked: 154 times
Been thanked: 104 times

Re: Filled same price

Postby wilkinsw » 04 Nov 2016

Name your entry.

Then code exits that reference that name and that aren't sitting in a marketposition condition. Change in marketposition is only detected when the first tick of the next bar is received (using normal, non IOG, settings).

E.g.

Code: Select all

Buy ("entry1") 1 shares next bar at var1 limit;
Then, perhaps at very end......

Code: Select all

sell ("longexit1") from entry ("entry1") next bar at targetvar1 limit;
Because you've named and then referenced that name.... as soon as you're filled, MC will work you exit order IF it related to the entry name.

tradingest
Posts: 283
Joined: 05 Dec 2014
Location: Italy
Has thanked: 53 times
Been thanked: 3 times

Re: Filled same price

Postby tradingest » 04 Nov 2016

Name your entry.

Then code exits that reference that name and that aren't sitting in a marketposition condition. Change in marketposition is only detected when the first tick of the next bar is received (using normal, non IOG, settings).

E.g.

Code: Select all

Buy ("entry1") 1 shares next bar at var1 limit;
Then, perhaps at very end......

Code: Select all

sell ("longexit1") from entry ("entry1") next bar at targetvar1 limit;
Because you've named and then referenced that name.... as soon as you're filled, MC will work you exit order IF it related to the entry name.
Thanks so much wilkinsw,

so, I can assign the name in my orders and this is perfect.
Then, when I write the code below can you help me to write the entry name to recall my orders?

Code: Select all

If MP = 1 and <code to recall order>
Then Begin
value10 = 99999;
End;


Thanks very very much


Return to “MultiCharts”