Now when the order occurs i get a spread of 20 points between my profit and loss limit. That makes sense, since i set those to 10 points each. The problem is that i expected this to be set on entryprice. And it does not correspond, examples:
Entry price 69, TP75 * SL55. I would expect entryprice in the middle of TP-SL @ 65.
Entry price 77, TP83 * SL63. I would expect entryprice in the middle of TP-SL @ 73.
Entry price 83, TP97 * SL77. I would expect entryprice in the middle of TP-SL @ 87.
Entry price 80, TP94 * SL74. I would expect entryprice in the middle of TP-SL @ 84.
Entry price 56, TP42 * SL62. I would expect entryprice in the middle of TP-SL @ 52.
Entry price 38, TP24 * SL44. I would expect entryprice in the middle of TP-SL @ 34.
... etc ... There is allways that same 4 points sqew between the figures. Also, this 4 points sqew bring my stoploss 4 points closer and my takeprofit 4 points further. Can someone explain why ?
Code: Select all
variables:
TP(10) , {Points to Take Profit }
SL(10) {Points to Stop Loss }
;
[IntrabarOrderGeneration = True];
////////////////////////////////////
{entry Long }
if (marketposition = 0) and (high >= high[1]) and (high[1] >= high[2]) and (high[2] >= high[3])
and (low >= low[1]) and (low[1] >= low[2]) and (low[2] >= low[3]) then
begin
buy ("tiers1L") 1 contract next bar at market ;
end;
if (marketposition > 0) then
begin
// SetStopContract;
setstoploss(SL) ;
setprofittarget(TP) ;
end;
//////////////////////////////////////
{short }
if (marketposition = 0) and (low <= low[1]) and (low[1] <= low[2])and (low[2] <= low[3])
and (high <= high[1]) and (high[1] <= high[2]) and (high[2] <= high[3]) then
begin
sellshort ("tiers1C") 1 contract next bar at market;
end;
if marketposition < 0 then
begin
// setstopposition;
setstoploss(SL) ;
setprofittarget(TP) ;
end;
print(time," Entry: ", AvgEntryPrice_at_Broker_for_The_Strategy," ",entryprice," TP: ", TP," SL: ", SL);