What is Pipsize?

Viewing 15 posts - 16 through 30 (of 30 total)
  • Author
    Posts
  • #176971 quote
    Nicolas56
    Participant
    Junior

    Problem solved.

    Actually, PRT seems to make a distinction between :

    PipSize, which is the “point” as per contract specification

    TickSize, which is the minimal increment in price.

    In the case of EUR/USD and BTC/USD with IG Markets, PipSize = 10 * TickSize.

    Nicolas

    Vicke1990 thanked this post
    A.png A.png
    #177159 quote
    PeterSt
    Participant
    Master

    Problem solved ?
    1st attachment is PRT-IB. 2nd is PRT-IG.

    image_2021-09-09_185844.png image_2021-09-09_185844.png image_2021-09-09_185914.png image_2021-09-09_185914.png
    #177313 quote
    Nicolas56
    Participant
    Junior

    @PeterSt, what is the issue?

    #197080 quote
    Jerome888
    Participant
    Average

    Hi,

    I am lost. How to calcuate then the size of your position with all these pipsize etc… ?

    For stock market, easy

    myPositionSize = ((myInitialCapital + STRATEGYPROFIT) *(myRisk/100))/(myStopFactor*myATR))

    But for the forex ? e.g. EUS/USD, what would be the formula of myPositionSize including these variables ?

    once myTickSize=0.00001
    once myPipSize=PIPSIZE
    once myPipValue= PIPVALUE
    once myLotSize=1000 (1000 ??? mentioned by default in probacktests)

    Thank you

    #197083 quote
    robertogozzi
    Moderator
    Master

    PIPSIZE should be used when you need to deal with both PRICE and PIPS in the same expression. It relieves you of having do do conversions yourself, as the system will take care of it.
    IF you want to exit at, say 20 pips less than current LOW, you will have to convert 20 (which is a numeric value) to a price, writing:

    SELL AT Low - 20*PipSize STOP   //or LIMIT

    because writing:

    SELL AT Low - 20 STOP   //or LIMIT

    would work for all instruments and assets with a price to pip ratio of 1:1, like indeces, but would fail for currencies (it would subract 20 from 1.01 on fx pair EurUsd).

    It should also be used with a division when you have to convert a price into pips:

    StopLossPIPS = (close - low) / PipSize  //in EurUsd this will return 40, instead of 0.0040

    This code works fine with DAX (Daily chart), without using PIPSIZE; you cannot trade the sime size of CONTRACTS as you do with SHARES, though:

    DefParam CumulateOrders = False
    ONCE P                = 100
    ONCE minLots          = 1
    ONCE myInitialCapital = 10000
    ONCE myRisk           = 5
    ONCE myStopFactor     = 1      //what is this ???
    myATR           = averagetruerange[14](close)
    myPositionSize = max(minLots,((myInitialCapital + STRATEGYPROFIT) *(myRisk/100))/(myStopFactor*myATR))
    IF Not OnMarket THEN
       IF close CROSSES OVER average[P,0](close) THEN
          BUY myPositionSize CONTRACTS AT MARKET
       ELSIF close CROSSES UNDER average[P,0](close) THEN
          SELLSHORT myPositionSize CONTRACTS AT MARKET
       ENDIF
    ENDIF
    SET TARGET pPROFIT 500
    SET STOP   pLOSS   200
    graph myPositionSize
    #197084 quote
    Jerome888
    Participant
    Average

    Thanks a lot Roberto I think this is what I am looking for.

    So I assume  that for currencies, I would just need to add /PIPSIZE at the end to get the right position size.

    myPositionSize = max(minLots,((myInitialCapital + STRATEGYPROFIT) *(myRisk/100))/(myStopFactor*myATR)/PIPSIZE)

    #197097 quote
    robertogozzi
    Moderator
    Master

    Yes, that’s correct.

    #197100 quote
    Jerome888
    Participant
    Average

    Thank you Roberto.

     

    Could you please explain me what is this LotSize in yellow (see attached)? is that 1000 for EUR/USD ?

    Should not we consider that LotSize in the formula ?

    myPositionSize = max(minLots,( (myInitialCapital + STRATEGYPROFIT*(myRisk/100))/(myStopFactor*myATR)/PIPSIZE/LotSize)

    or am I completely wrong ? 🙂

    Capture2.png Capture2.png
    #197107 quote
    robertogozzi
    Moderator
    Master

    I don’t know, as I never used it.

    It’s not requested by IG (for CFDs), it is requested by PRT (Futures), instead.

    I have no idea what’s it all about.

    #197152 quote
    Jerome888
    Participant
    Average

    OK Thank you Roberto

     

    BTW I have made some simulations, I think PIPSIZE should be placed here to get the right position size

    myPositionSize = PIPSIZE  * (myInitialCapital + STRATEGYPROFIT*(myRisk/100)/(myStopFactor*myATR)

    #197158 quote
    robertogozzi
    Moderator
    Master

    Multiplying by PipSize is used to convert Pips into Price.

    I can’t spot any value expressed in pips in your code, though.

    #197162 quote
    Jerome888
    Participant
    Average

    If i take a risk of 50 eur

    With a stop at 5 pips

    The initial formula gives

    Positionsize = 50/0.0005 = 100 000

    If the. i do BUY 100 000 he will buy 100 000 K so 100 000 000.

    So i thought to come back to an “acceptable” position size i needed to divide multiply by pipsize which is 0.0001

    Is it a mistake ?

    #197163 quote
    Jerome888
    Participant
    Average

    Again :

     

    If i take a risk of 50 eur

    With a stop at 5 pips

    The initial formula gives

    Positionsize = 50/0.0005 = 100 000

    Then BUY 100 000 would buy 100 000 K so 100 000 000…

    So i thought to come back to an “acceptable” position size i needed to multiply by pipsize which is 0.0001

    Is it a mistake ?

    #197168 quote
    robertogozzi
    Moderator
    Master

    PipSize is NOT meant to make thing “acceptable” of “most favourable” or the like. It’s meant to convert Pips into Price and viceversa.

    Anyway, if your formula yields what you expect, then it must be ok!

    #197189 quote
    Jerome888
    Participant
    Average

    😀

    Sorry,  you know I am french and my English is…frenchy

    I meant “Consistent” instead of “acceptable” 😀

    i.e. the losses are indeed 50 Eur in backtests so consistent withe the risk I defined initially.

    I just hope this formula is then applicable to any forex pair.

    Thank you Roberto for all your support.

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

What is Pipsize?


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 29 replies,
has 4 voices, and was last updated by Jerome888
3 years, 7 months ago.

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