"Ghost operations" with low TF robots

Viewing 15 posts - 1 through 15 (of 37 total)
  • Author
    Posts
  • #137886 quote
    TempusFugit
    Participant
    Veteran

    Hi,

    Recently I have discovered that several of my systems produce strange “ghost operations”. This operations OPEN AND CLOSE IN THE SAME SECOND and always with losses than can go from a few euros to 61€ in one case. See image attached for examples.

    It seems to happen only in robots with a low TimeFrame, from 2m to 5m. And it doesn´t happen in backtest. I don´t think is a problem with the code because it happens with very different systems and only with the low TF. Until recently all my systems were 10m or higher TF and with these it never happen before.

    I have put a ticket in PRT but I needed several mails only to get them to understand the problem and from my past experience I don´t expect  much from them.

    I´ve been trying to discover the cause from the code and it hasn´t any sense to me. Furthermore as I said before I use the same “style of code” with higher TF and it doens´t happen there. I can only think is a problem with the plataform

    Does this happen to anyone else? Any idea what could be the cause?

    #137892 quote
    GraHal
    Participant
    Master

    I’ve had it in the past and it was where my code was flawed and it was buying and selling / vice versa instantly due to mmmm … sorry can’t remember! 🙁

    What a thing to say, but least you know you are not on your own.

    By far the best is to post your code on here and I’m sure a coding wizard will spot the reason?

    PS

    You not got stops inside the spread have you?

    #137906 quote
    Nicolas
    Keymaster
    Master

    Live or demo account?

    I have put a ticket in PRT but I needed several mails only to get them to understand the problem and from my past experience I don´t expect  much from them.

    I think that you are talking about your broker’s assistance desk? Which is IG?

    #137965 quote
    TempusFugit
    Participant
    Veteran

    Thanks Grahal for the support! 🙂 At the begining I thought the same, that it should be a problem with the code but I´ve been programming with PRT for several years now, I am used to find errors in the code and here  I can´t see the problem. As it happen in different systems but only with low TF, and the higher TF systems have similar code for entries and exits and doesn´t happen  made think that it could be something else, not the code. Also it doesn´t happen in backtest only in Live.

    Nicholas, it happened in Live. Now I have put these systems in Demo to see if it happens also there.

    It´s also interesting that I shared these systems with a mate and he had also “ghost operations” but not the same as me,  in different days.

    Anybody is running systems in the <5m TF? If nobody else is happenning it should be my code. You can check just looking for the operations with only 1 or 2 candles duration in the report. As I said before these operations open and close in the same second

    Captura.png Captura.png
    #137977 quote
    GraHal
    Participant
    Master

    Anybody is running systems in the <5m TF?

    I just checked 3 of my 1 min TF Systems on Demo Forward Test none of them show any ghost bars like yours.
    One of the Systems has been running since 3 Feb 20 and has done 140 trades.

    I also checked 5 Systems running in Real Live, 3 on 1 min TF and 2 on 3 second TF … no ghost bars there either, but they have only been running for a few weeks.

    TempusFugit thanked this post
    #137993 quote
    TempusFugit
    Participant
    Veteran

    Thanks Grahal, so it looks like the problem is in my code. I will keep looking for the cause…

    #138009 quote
    GraHal
    Participant
    Master

    You sure that spikes did not hit your stops?

    I did try earlier to locate the 1 second bar on that 61.51 loss.

    I have done it in the past down to each tick, but you need to be determined and dedicated! 🙂

    #138010 quote
    TempusFugit
    Participant
    Veteran

    I just realized something really really weird about these ghost operations…

    As I said before these “1 second” operations doesn´t appear in backtest but nevertheless their loss seems to be included in other normal operation in the backtest. For example the same day in backtest there is only one operation with a 100€ loss but in real there is 2 operations: one with a 90€ loss and another one “ghost operation” (open and close in the same second) with a 10€ loss.

    The amounts are not exact for backtest and real but aproximately for all the operations I checked it seems that is happening. The images attached are a real case

    Now I really don´t understand NOTHING

    Captura2.png Captura2.png
    #138012 quote
    TempusFugit
    Participant
    Veteran

    The backtest operation

    Captura.jpg Captura.jpg
    #138022 quote
    GraHal
    Participant
    Master

    Now I really don´t understand NOTHING

    Now you / we have to find out what is going on!?

    Weirder and weirder!?

    #138065 quote
    TempusFugit
    Participant
    Veteran

    I know is really weird but for me to know that backtest match with live even in so strange way is kind of relive.

    I don´t know what else to do or check about it. If there is something new about it I will post it

    #138073 quote
    GraHal
    Participant
    Master

    in real there is 2 operations: one with a 90€ loss and another one “ghost operation” (open and close in the same second) with a 10€ loss.

    It seems like an IG money balancing transaction due to exchange rates or some other weird thing??

    However above assumes that backtest has the correct exchange rate and Real Live does not

    I think we have reached the stage where we need to ask IG … keep it simple with minimum words and one screen shot?

    You could just say / email to IG …

    Please could you explain what is the – 1 second bar – transaction at the red arrow on attached 2 min Timeframe Order List? 

    Note that there is another transaction at the exact same time -see blow arrow.   

    Temp.png Temp.png
    #138080 quote
    Dow Jones
    Participant
    Veteran

    This operations OPEN AND CLOSE IN THE SAME SECOND and always with losses than can go from a few euros to 61€ in one case. See image attached for examples.

    @TempusFugit, looking at your picture, I highlight the link (for 22-Mar 12:50, there is also another link I didn’t draw it), it seems like maybe your condition is not protected by IF NOT ONMARKET or IF NOT LONGONMARKET, etc…

    I had it before when not protecting the condition, I think the code run from top to down, so the code could have fulfill both long and short conditions thus both get executed.

    A dummy example like below, the trade can close at the same second sometimes

    M1RSI = AverageTrueRange[14](close)
    
    C1 = RANGE > 2 AND M1RSI > 5
    C2 = RANGE > 3 AND M1RSI > 5
    
    // Conditions to enter long positions
    IF C1 THEN
    BUY 1 CONTRACTS AT MARKET
    ENDIF
    
    
    // Conditions to enter short positions
    IF C2 THEN
    SELLSHORT 1 CONTRACTS AT MARKET
    ENDIF
    
    Capture.jpg Capture.jpg
    #138120 quote
    TempusFugit
    Participant
    Veteran

    Grahal,

    I will try to ask IG as you said. My guess is that they will refer me to PRT.  I will tell

    GraHal thanked this post
    #138124 quote
    TempusFugit
    Participant
    Veteran

    Dow Jones,

    You are rigth, the operations are not protected by “NOT ON MARKET” because I want the system to change direction if conditions are met.

    My execution code is like:

    IF LONGENTRY THEN
    BUY AT MARKET
    ELSIF SHORTENTRY THEN
    SELLSHORT AT MARKET
    ENDIF

    This way I think it can´t make both long and short entries at the same time. Is that right?

    Anyway because of the conditions of entries in this system I don´t think is possible to have both long and short entry at the same candle. But just came to me that I can check that in backtest with the DRAW function just in case

Viewing 15 posts - 1 through 15 (of 37 total)
  • You must be logged in to reply to this topic.

"Ghost operations" with low TF robots


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 36 replies,
has 5 voices, and was last updated by GraHal
5 years, 7 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 07/01/2020
Status: Active
Attachments: 13 files
Logo Logo
Loading...