limit order life cycle

Questions about MultiCharts and user contributed studies.
giuliocorbelli
Posts: 1
Joined: Feb 12 2024

May 23 2024

In this PowerLanguage code, are the limit entry orders active just for the time the conditions are true and then they get cancelled when the conditions become false?
Or are they submitted and never canceled till one of them gets executed?

//if entriestoday(date) = 0 and marketposition = 0 then begin
//
// if timewindow
// then buy ("Long") 1 contract next bar at mylow limit;
// if timewindow
// then sellshort ("Short") 1 contract next bar at myhigh limit;
//
//end;

User avatar
Polly MultiCharts
Posts: 264
Joined: Jul 20 2022
Has thanked: 1 time
Been thanked: 67 times

May 28 2024

Hello giuliocorbelli,

Orders are supposed to be canceled automatically if the conditions for sending an order specified in your script are not met.
When the bar closes, orders are canceled, but when the new bar opens, they are sent again if the conditions are met. The same procedure is repeated each bar.