Question for Target
Posted: 22 Aug 2021 21:40
Hello community,
i have an issue with the setTargetPrice function.
The chart shows the green line of the target but doesn’t fullfill the target order. Is their anything i have to do before i can use a target stop in the future station.
Here is my code its very simple so i think the interface is the problem:
input $TargetLong(1,50,20);
input $TargetShort(1,50,20);
numeric i,zahl,verhaeltnis,verhaeltnis2;
bool Weg;
series Body_S,Candle_S,Body_H,Body_L,Renkofarbe;
series UK_Indi(Sentimentexpress.extraeinstieg2);
// -----------------------------------------------------
Calculation
// --------------------------
if(IsBarCompleted()) then
begin
if(UK_Indi[BarsSinceEntry()+1]>0) then
begin
if(MarketPosition()=1) then
begin
SetTargetPrice(EntryPrice()+($TargetLong/100));
end
if(MarketPosition()=-1) then
begin
SetTargetPrice(EntryPrice()-($TargetShort/100));
end
end
Thanks,
Jonas
i have an issue with the setTargetPrice function.
The chart shows the green line of the target but doesn’t fullfill the target order. Is their anything i have to do before i can use a target stop in the future station.
Here is my code its very simple so i think the interface is the problem:
input $TargetLong(1,50,20);
input $TargetShort(1,50,20);
numeric i,zahl,verhaeltnis,verhaeltnis2;
bool Weg;
series Body_S,Candle_S,Body_H,Body_L,Renkofarbe;
series UK_Indi(Sentimentexpress.extraeinstieg2);
// -----------------------------------------------------
Calculation
// --------------------------
if(IsBarCompleted()) then
begin
if(UK_Indi[BarsSinceEntry()+1]>0) then
begin
if(MarketPosition()=1) then
begin
SetTargetPrice(EntryPrice()+($TargetLong/100));
end
if(MarketPosition()=-1) then
begin
SetTargetPrice(EntryPrice()-($TargetShort/100));
end
end
Thanks,
Jonas