Close position at bar end / real time

Questions about MultiCharts and user contributed studies.
LMC1
Posts: 50
Joined: 28 Apr 2013
Has thanked: 29 times
Been thanked: 1 time

Close position at bar end / real time

Postby LMC1 » 26 Apr 2014

Hi,

In intra-day auto-trade, the 'default' action is to open and close a position at Open of next bar. Is it possible to close a position right before say e.g., the end of a 5 min bar ?

Thanks.

User avatar
arnie
Posts: 1594
Joined: 11 Feb 2009
Location: Portugal
Has thanked: 481 times
Been thanked: 514 times

Re: Close position at bar end / real time

Postby arnie » 26 Apr 2014

Hi,

In intra-day auto-trade, the 'default' action is to open and close a position at Open of next bar. Is it possible to close a position right before say e.g., the end of a 5 min bar ?

Thanks.
Maybe using a counter?
Using barinterval keyword to know which resolution you're using and build your counter based on that.

Just an idea.

User avatar
Andrew MultiCharts
Posts: 1587
Joined: 11 Oct 2011
Has thanked: 931 times
Been thanked: 559 times

Re: Close position at bar end / real time

Postby Andrew MultiCharts » 28 Apr 2014

Hello LMC1,

You may need to use RecalcLastBarAfter keyword in your code (IOG must be on) to call some artificial script calculation if there is no tick and to place an order before the current bar close.


Return to “MultiCharts”