Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

PLAYBACK AND REAL TIME differences

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    PLAYBACK AND REAL TIME differences

    I created a script that based on some logic it enter long and short, I then decided to add a stoploss at the average price when my profit is 4 ticks so the position doesn't go into loss.
    If i play in the playback connection the strategy, the stop loss moves perfectly, but when i use it in real time it doesn't move. What could be the reason of that?
    the code is like this :
    i added a dataseries of 1 second and this is in the Barupdate=1, so for each seconds:


    if(Position.MarketPosition != MarketPosition.Flat)
    {
    if (Positions[0].GetUnrealizedProfitLoss(PerformanceUnit.Ticks) > 2)
    {
    SetStopLoss(CalculationMode.Ticks, 0);
    }



    }

    #2
    Hello AlessioCianini12,

    From the given details I wouldn't be able to say what may have happened, it would be best to use a Print here to compare how the condition is evaluating between the two tests. If you see that some part of the condition or processing is happening differently that would give clues on a solution.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    90 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    136 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    120 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    69 views
    0 likes
    Last Post PaulMohn  
    Working...
    X