Set variable stop loss

Questions about MultiCharts and user contributed studies.
Erik Pepping
Posts: 74
Joined: 25 Aug 2007
Been thanked: 6 times

Set variable stop loss

Postby Erik Pepping » 19 Nov 2009

I'm trying to set a stop loss based on some criteirum in IOG setting. However only my stop profit get set in IB.

Her is part of my code,

Code: Select all

setstopposition;
setprofittarget(ProfittargetInEuros);
If marketposition=0 and SomCondition then
begin
setstoploss((LastTop + 3 - Close) * 25);
SellShort ("se") this bar;
end;

The setstoploss is never translated into a limited buy order ? The stop profit is When i move the SetStoploss outside the if it works, but I only know the stop loss calculation based on other settigns.

Return to “MultiCharts”