Breakeven modifivation

Questions about MultiCharts and user contributed studies.
elitetrader
Posts: 18
Joined: 06 Jun 2016

Breakeven modifivation

Postby elitetrader » 08 Jul 2016

[IntrabarOrderGeneration = false]
inputs: PositionBasis( false ), FloorAmt( 50 );

if PositionBasis then
SetStopPosition
else
SetStopShare ;

setbreakeven + 4 points ( FloorAmt ) ;


Trying to get this breakeven to set stop at 2 pips higher than my entry once triggered

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

Re: Breakeven modifivation

Postby TJ » 08 Jul 2016

[IntrabarOrderGeneration = false]
inputs: PositionBasis( false ), FloorAmt( 50 );

if PositionBasis then
SetStopPosition
else
SetStopShare ;

setbreakeven + 4 points ( FloorAmt ) ;


Trying to get this breakeven to set stop at 2 pips higher than my entry once triggered

Please see post #5
viewtopic.php?f=1&t=49891

elitetrader
Posts: 18
Joined: 06 Jun 2016

Re: Breakeven modifivation

Postby elitetrader » 08 Jul 2016

Code: Select all

[IntrabarOrderGeneration = false]
inputs: PositionBasis( false ), FloorAmt( 50 );

if PositionBasis then
SetStopPosition
else
SetStopShare ;

setbreakeven + 4 points ( FloorAmt ) ;

elitetrader
Posts: 18
Joined: 06 Jun 2016

Re: Breakeven modifivation

Postby elitetrader » 08 Jul 2016

Code: Select all

[IntrabarOrderGeneration = false]
inputs: FloorAmt( 1 ), AmounT(.0002), PositionBasis( false ) ;

variables: var0(0),var1(0);

var0 =marketposition;

var1= setbreakeven;

if PositionBasis then
SetStopPosition
else
SetStopShare ;

if var0 = -1 then
var1= entryprice + 4 Ticks ;


i set breakeven to equal the entry price + 4 ticks im getting the following error message when compiling "syntax error, expecting 'bars'
line 15, column 23"

elitetrader
Posts: 18
Joined: 06 Jun 2016

Breakeven modifivation 2

Postby elitetrader » 08 Jul 2016

Code: Select all

[IntrabarOrderGeneration = false]
inputs: FloorAmt( 1 ), AmounT(.0002), PositionBasis( false ) ;

variables: var0(0),var1(0);

var0 =marketposition;

var1= setbreakeven;

if PositionBasis then
SetStopPosition
else
SetStopShare ;

if var0 = -1 then
var1= entryprice + 4 Ticks ;
i am getting the following error message when compiling syntax error, {expecting 'bars'
line 18, column 23}

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

Re: Breakeven modifivation 2

Postby TJ » 08 Jul 2016

Code: Select all

[IntrabarOrderGeneration = false]
inputs: FloorAmt( 1 ), AmounT(.0002), PositionBasis( false ) ;

variables: var0(0),var1(0);

var0 =marketposition;

var1= setbreakeven;

if PositionBasis then
SetStopPosition
else
SetStopShare ;

if var0 = -1 then
var1= entryprice + 4 Ticks ;
i am getting the following error message when compiling syntax error, {expecting 'bars'
line 18, column 23}
Go to your code...

find out the location of the problem at "line 18, column 23".

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

Re: Breakeven modifivation

Postby TJ » 08 Jul 2016

try this:
var1= entryprice + 4 * Ticks ;

note the asterisk (*) between 4 and ticks.

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

Re: Breakeven modifivation

Postby TJ » 08 Jul 2016

before you go further...

look up the keyword

Ticks

tony
Posts: 420
Joined: 14 Jun 2013
Has thanked: 30 times
Been thanked: 81 times
Contact:

Re: Breakeven modifivation 2

Postby tony » 08 Jul 2016

Code: Select all

[IntrabarOrderGeneration = false]
inputs: FloorAmt( 1 ), AmounT(.0002), PositionBasis( false ) ;

variables: var0(0),var1(0);

var0 =marketposition;

var1= setbreakeven;

if PositionBasis then
SetStopPosition
else
SetStopShare ;

if var0 = -1 then
var1= entryprice + 4 Ticks ;
i am getting the following error message when compiling syntax error, {expecting 'bars'
line 18, column 23}
Go to your code...

find out the location of "line 18, column 23".
setbreakeven is a predefined function. And you have var1 = setbreakeven and var1 = entryprice + 4 ticks; So you are defining var1 two times and each time they are different.

As TJ notes, you can't say 4 ticks but 4 * ticksize and you have to define ticksize as ticksize (minmove/pricescale); where you declare variables. So you have a few things going on here.


Return to “MultiCharts”