Reverse position from a specified entry

Questions about MultiCharts and user contributed studies.
masber2000
Posts: 29
Joined: 15 Aug 2012
Has thanked: 2 times

Reverse position from a specified entry

Postby masber2000 » 19 Aug 2020

Hello-

Is there a better way to reverse a position from a specific entry than the following?

Code: Select all

if Condition20 then begin buytocover from entry ("Rev-S1") next bar at Market; buy ("XR-L") next bar at Market; end;
I tried using the syntax buy ("XR-L") from entry ("Rev-S1") next bar at market to reverse the position, it gave me the following error code:

syntax error, expecting 'stop', 'limit', 'contracts', or 'shares'. Then, after specifying the number of shares (which I shouldn't have to do), it still gave me an error code.

Thank you in advance for your help.

User avatar
Vlada MultiCharts
Posts: 293
Joined: 22 Apr 2020
Has thanked: 8 times
Been thanked: 76 times

Re: Reverse position from a specified entry

Postby Vlada MultiCharts » 06 Oct 2020

Hello masber2000,

It's not possible to reverse a position from entry.
The reason is that there are two pyramiding entries: Entry1 for 5 contracts and Entry2 for 10 contracts long. Summing up, the position is long +15.

It won't be possible to reverse from Entry2 into the short position because reversal means that the whole old position is closed and a reverse position for a specified number of contracts is opened. It's impossible to reverse only a part of the position.

So that's why the term "from entry" can not be used for reversal and as a result, the script does not compile.

masber2000
Posts: 29
Joined: 15 Aug 2012
Has thanked: 2 times

Re: Reverse position from a specified entry

Postby masber2000 » 03 Jan 2021

"It won't be possible to reverse from Entry2 into the short position because reversal means that the whole old position is closed and a reverse position for a specified number of contracts is opened."

This is exactly what I'm trying to do! I want to close out all contracts if a specified entry is used. Although there are multiple entry setups, there's only 1 entry active at any point in time. I want to close the specified entry (Rev-S1) and reverse. There would be a contract to close the current position out, and a contract to reverse the just-closed position. Thus there's no part position to close out.


Return to “MultiCharts”