spread indicator for strategy

Forums ProRealTime English forum ProBuilder support spread indicator for strategy

Tagged: 

Viewing 15 posts - 1 through 15 (of 19 total)
  • #49454

    Hi!

    You can set the spread in PRT.

    But I wonder.  First create an static indicator based on information of the spread for different trading hours from IG website for i.e. the dax.

    Then use the call function to get the information and code the spread in the strategy manually and have a more accurate backtest when trading 24h.

    Is it worth it or is it not possible to code ?

     

    I tried to get an indicator running for a visual impression.

    What’s wrong with this code. Between 22u and 8u shows 0, which should be 5. Other spreads are displayed correct.

     

    1 user thanked author for this post.
    #49476

    Hi, your tw3 can never be true, because a number can’t be at the same time above 220000 and below 080000, so you need to approach differently the coding of night hours (something like “between 22h and 24h”  or  “between 0h and 8h”).

    Also, please use the <> button (insert PRT code) in the message editor toolbar in order to make PRT code appear in the appropriate format, thanks.

    #49542

    After writing it down, I realised the same as you said. I modified it, it works but the coding doesn’t look good.

     

     

     

    #49543

    another question, can you use 1 indicator and have data stored for multiple symbols i.e. dax and cac40 ?

    So the indicator should have a code that match the symbol displayed, if there’s no match the line should be 0.

     

    #49550

    cleaned up code

     

    #49729
    Leo

    Hi,

    This is the methodology I use in my codes for control the spread. Hope you find it useful as well

     

    2 users thanked author for this post.
    #64248

    Hi, is there any way to measure the actual spread using a prorealcode program? for example, leave it running over 1 week, and then plot a graph (or store data) to record spread at different times of day and different days? thanks

    #64443

    There is no way to know the broker’s spread in real time with codes.

    #76025

    Bonjour, je profite de ce fil pour poser ma question :

    En effet, après avoir rentré mon code pour le backtest, je souhaiterai l’appliquer en auto avec proorder auto trading (jusque là ça va de soit). le problème c’est que j’ai le message suivant :

    “Les changements suivants doivent etre appliquées avant d’envoyer le code à proorder : Remplacer les variables par des valeurs fixes : pour préparer ce système pour le trading automatique, retirer les variables qui sont dans l’onglet “probacktest” et remplacez les par des valeurs fixes dans votre code.”

    Je pense qu’il s’agit du capital et du spread (je n’ai que ça)…?  Et si oui , quel code dois je inclure pour remplacer justement ces valeurs fixe du probacktest?  Quelqu’un peut il m’aider?

    #76028

    vins – Welcome to the forums. There are some simple rules that you will need to follow. Please only use English in the English speaking forums. There is a French speaking forum if you wish to use that language. Also please update your country flag.

    vins – Bienvenue sur les forums. Il y a quelques règles simples que vous devrez suivre. Veuillez n’utiliser que l’anglais dans les forums anglophones. Il y a un forum francophone si vous souhaitez utiliser cette langue. Veuillez également mettre à jour le drapeau de votre pays.

    #76029

    Your problem is not related to spread or capital. You must delete all optimized variables and code them directly in your strategy to run it live.

    Screenshot_1-7

    1 user thanked author for this post.
    #76041

    oh sorry vonasi, i didn’t know and i understand. 🙂

    Ok, just my question is  : What is the code for to put the capital and the propagation in my probacktest code (my strategy)..?  By example i want to put 10000€ (capital) and 1 for the propagation.

    #76047

    Unless you are using some form of money management within your code it is not necessary to have the capital in the code – just put the starting capital in the box shown in this image:

    Screenshot_2-5

    I’m not certain what you mean by propagation. If you mean position size then you can just do the following. Some instruments/brokers might need you to use PIPSIZE to get the correct size.

     

     

    #134808

    Hi All,

    This spread issue is a problem. In PRT, there should be a way to display bid/ask price on the chart. From there it should be possible to build some code to get instantaneous values by calling these price indicators. Since these prices (bid/ask/middle) can be displayed on the chart, they can become an indicator. No?

    For example, a MACD can be calculated on bid/ask/middle price. This can change a bit the result of the indicator, at some point in the day. (due to trading hours, volumes, liquidity, etc…).

    So to begin with:

    1.  Does anyone know how to configure the price line on the charts ? (bid/ask/middle). I just can’t find this setup.
    2.  Did anyone already build a spread indicator? (to detect real live spread widening, not pre-coded static theoretical ones for back testing purpose)

    Thank you.

    Best

    #134852

    there should be a way to display bid/ask price on the chart

    You can use the Bid/Ask Line Indicator … I have it on all the time.

    Just put Bid in the Indicator search on PRT and you will see it.

    If you  use it on forex on low TF’s (1 min etc) you can see the Bid/Ask band flash widen very often. not so much on Indices, but it does happen out of market hours.

    1 user thanked author for this post.
Viewing 15 posts - 1 through 15 (of 19 total)

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