Multiple positions  [SOLVED]

Questions about MultiCharts and user contributed studies.
User avatar
PLB
Posts: 13
Joined: 28 Nov 2019
Has thanked: 6 times

Multiple positions

Postby PLB » 31 Oct 2020

Good evening, I have been having serious difficulties for several days in using multiple positions in the same direction.
Separately, the two buy and sell orders work, but when I try to combine them, only the "Fa" order is executed. I've really tried them all but I can't understand what trivial mistake I make. Can you help me?

Code: Select all

inputs: ... variables: ... SONOLONG = (marketposition = 1 and close < liv_x); if marketposition = 0 then begin ... liv_x = low; meta_candela=(high-low)/2; ... switch (trigger) //INGRESSO A MERCATO begin case "F": buy ("Fa") next bar at open ; buy ("Fb") next bar at meta_candela limit; end; end; switch (StopLossMode) begin case (1): if SONOLONG then begin //STOP LOSS// sell ("SLl1") this bar from entry ("Fa") on close; // sell ("SLl2") this bar from entry ("Fb") on close; // end; if SONOSHORT then .... end;
manual.PNG
(227.69 KiB) Not downloaded yet
Thanks

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

Re: Multiple positions

Postby TJ » 31 Oct 2020

Try this:

Code: Select all

switch (trigger) //INGRESSO A MERCATO begin case "F": BEGIN buy ("Fa") next bar at open ; buy ("Fb") next bar at meta_candela limit; END; end; end;

User avatar
PLB
Posts: 13
Joined: 28 Nov 2019
Has thanked: 6 times

Re: Multiple positions

Postby PLB » 02 Nov 2020

Ciao TJ,

I tried the solution you proposed but I didn't notice any differences. Reading another manual this thing came to my mind: could it be due to this that it was disabled?

TAB STRATEGY PROPERTIES->POSITION LIMITS-> ALLOW UP TO ... ENTRY ORDER IN THE SAME
Cattura.PNG
(28.81 KiB) Not downloaded yet
I hope... :)

User avatar
PLB
Posts: 13
Joined: 28 Nov 2019
Has thanked: 6 times

Re: Multiple positions  [SOLVED]

Postby PLB » 08 Nov 2020

Hello, I update the topic with the hope that it can be of help to someone else in the future.
There was a need to enable that box in the strategy properties.

Problem solved, thank you very much :-)


Return to “MultiCharts”