Which weekday is Sunday – can code measure bid offer spread?

Forums ProRealTime English forum ProOrder support Which weekday is Sunday – can code measure bid offer spread?

Viewing 2 posts - 1 through 2 (of 2 total)
  • #219030

    Hi

    I had code running from the beginning of this week and it had the following filter.

    If Dayofweek = 7 then

    TradeOK =0

    else

    Tradeok =1

    endif

    The code proceeded to execute a trade at market open around 10:03pm (Berlin time)

    So my filter did not stop it.

    If I change it to

    If Dayofweek >= 1 then

    TradeOK =1

    else

    Tradeok =0

    endif

    Then it did prevent the trade. But it will create other problems for my code and if Sunday is regarded as 7 then it may still place a trade.

    I do not want to let the algos trade so early at the start of the week as bid offer spreads are too wide and unpredictable.

    Is there maybe another solution where one can create code that measures the current bid offer spread to create a better filter?

    #219031

    There is no way to get the spread by code.

    In order to limit orders during the day, you can add conditions based on TIME:

     

Viewing 2 posts - 1 through 2 (of 2 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login