Exiting multiple contracts dosnt work

Questions about MultiCharts and user contributed studies.
Posts: 69
Joined: 14 Jun 2007

Exiting multiple contracts dosnt work

Postby itai007 » 27 Feb 2008

using this statement to exit positions with intrabar order generation enabled with the first option (enable each order in the signal to one entry and one exit) ...

bidvalue has intrabarpersist...

if marketposition > 0 and BidValue >= ( avgentryprice + (minmove/PriceScale*2)) then begin
sell next bar BidValue limit;

this will sell correctly a fix number of contracts (1 is default I assume) ...

PROBLEM : I have multiple entry and so some times pyramid the position and this exit statement will exit only 1 contract..

how can I make the code exit all currentcontracts??
I was unable to state
sell currentcontracts next bar BidValue limit;

so what do I need to do ?

User avatar
Andrew Kirillov
Posts: 1589
Joined: 28 Jul 2005
Has thanked: 2 times
Been thanked: 31 times

Postby Andrew Kirillov » 29 Feb 2008

You should select the 3d option and it will work.

Return to “MultiCharts”