Hello,

to show exactly what i mean i made some tests.
I build a system which is making only one trade.
This trade is made in a positive market situation for better understanding.
I made a Stop and a trailing stop.
2 modifications of the code are running - the first one with stop (asset is DAX) at 148, the second mod at 200. The trailing stop is at BOTH the same: 50 points.

Normally the stop and the trailing stop should not interact with each other. But this is happening in the test. Both systems are using the trailing stop diffently even if in code it is set to the same: 50 points... .

Here some data:
Code:
bool onetrade = true;

function run()
{
    StartDate = 20160803;
    EndDate = 20160818;
    BarPeriod=1440;
    PlotScale=20;
    
    set(LOGFILE);
    asset("GER30");
    
    
    bool traded = false;
    
    for(open_trades)    // Verify if we're on market
    {
        if(TradeIsOpen)
        {
            traded = true;
            onetrade = false;
        }
    }
    
    if(!traded && onetrade)
        enterLong (0,10200,148,0,50);


The other modification runs the same despite stop at 200:
enterLong (0,10200,148,0,50);

Results are:
for Stop at 148:

Code:
[273: Wed 03.08.16 00:00] (10302.48)
(GER30::L) Long 1@10200.00 Entry stop
(GER30::L) Entry stop 10200.00 hit at 00:00:00
[GER30::L7401] Long 1@10201.19 Risk 15$ t at 00:00:00

[274: Thu 04.08.16 00:00] +0 +1 1/0  (10135.52)
[GER30::L7401] Trail 1@10201.19 Stop 10085.60 at 00:00:00

[275: Fri 05.08.16 00:00] +0 +3 1/0  (10242.02)
[GER30::L7401] Trail 1@10201.19 Stop 10176.50 at 00:00:00

[276: Mon 08.08.16 00:00] +0 +16 1/0  (10245.38)
[GER30::L7401] Trail 1@10201.19 Stop 10281.95 at 00:00:00

[277: Tue 09.08.16 00:00] +0 +23 1/0  (10403.58)
[GER30::L7401] Trail 1@10201.19 Stop 10413.05 at 00:00:00

[278: Wed 10.08.16 00:00] +0 +47 1/0  (10423.05)
[GER30::L7401] Trail 1@10201.19 Stop 10512.95 at 00:00:00

[279: Thu 11.08.16 00:00] +0 +44 1/0  (10687.58)
[GER30::L7401] Trail 1@10201.19 Stop 10544.55 at 00:00:00

[280: Fri 12.08.16 00:00] +0 +53 1/0  (10661.95)
[281: Mon 15.08.16 00:00] +0 +50 1/0  (10728.15)
[GER30::L7401] Trail 1@10201.19 Stop 10609.15 at 00:00:00

[282: Tue 16.08.16 00:00] +0 +53 1/0  (10722.45)
[283: Wed 17.08.16 00:00] +0 +46 1/0  (10712.25)
[GER30::L7401] Stop 1@10609.44: +40.60 at 00:00:00



for stop at 200:

Code:
[273: Wed 03.08.16 00:00] (10302.48)
(GER30::L) Long 1@10200.00 Entry stop
(GER30::L) Entry stop 10200.00 hit at 00:00:00
[GER30::L7401] Long 1@10201.19 Risk 20$ t at 00:00:00

[274: Thu 04.08.16 00:00] +0 +1 1/0  (10135.52)
[GER30::L7401] Trail 1@10201.19 Stop 10033.60 at 00:00:00

[275: Fri 05.08.16 00:00] +0 +3 1/0  (10242.02)
[GER30::L7401] Trail 1@10201.19 Stop 10124.50 at 00:00:00

[276: Mon 08.08.16 00:00] +0 +16 1/0  (10245.38)
[GER30::L7401] Trail 1@10201.19 Stop 10229.95 at 00:00:00

[277: Tue 09.08.16 00:00] +0 +23 1/0  (10403.58)
[GER30::L7401] Trail 1@10201.19 Stop 10413.05 at 00:00:00

[278: Wed 10.08.16 00:00] +0 +47 1/0  (10423.05)
[GER30::L7401] Trail 1@10201.19 Stop 10460.95 at 00:00:00

[279: Thu 11.08.16 00:00] +0 +44 1/0  (10687.58)
[GER30::L7401] Trail 1@10201.19 Stop 10492.55 at 00:00:00

[280: Fri 12.08.16 00:00] +0 +53 1/0  (10661.95)
[281: Mon 15.08.16 00:00] +0 +50 1/0  (10728.15)
[GER30::L7401] Trail 1@10201.19 Stop 10557.15 at 00:00:00

[282: Tue 16.08.16 00:00] +0 +53 1/0  (10722.45)
[283: Wed 17.08.16 00:00] +0 +46 1/0  (10712.25)
[GER30::L7401] Stop 1@10557.44: +35.40 at 00:00:00



It shows that the trailing stop is handled differently even if the trailing stop in the code is set to the same.

Can somebody tell me why the trailing stop is handled differently?

Attached Files Example.png