how to change code between FX markets

Forums ProRealTime English forum ProOrder support how to change code between FX markets

Viewing 15 posts - 1 through 15 (of 22 total)
  • #91829

    I created a code for GBP/USD pair that works fine.

    When trying to migrate it to EUR/JPY I encountered a weird problem.

    GBP/USD uses 1.XXXXX format

    EUR/JPY uses 1YY.YYYYY format

    I was able to change all the params by simple multiplying by 100. no big deal.

    But I can’t control the position size, and once it gets below 1 it automatically defaults to the value 1.

    So currently every trade I make risks 30,000 Yuan, for example, instead of just 300 yuan for example.

    Does anyone have similar experience and could help me decipher this

    Thanks,

     

     

    (I tried writing about it yesterday but must of over complicated it. see the thread below:
    https://www.prorealcode.com/topic/using-floating-point-in-fx-markets/
    )

    #91831

    Have you tried using pipsize / pointsize at appropriate places in your code?

    Easiest to understand it might be to check out a few strategies on here using pipsize and / or check out the links below?

    https://www.prorealcode.com/topic/pipsize-confusion/

     

    1 user thanked author for this post.
    #91854

    this seems to be exactly what I need and I know it is right in front of me but I can’t find any code example on how to use it.

    on this forum I could not find a search button, on the web there is no ref and in the documentation is says that a pip size is a pipsize 🙂

    tries this for example:

    BUY stakeSizeLong*pipsize CONTRACTS AT myBuyprice stop

    tried division too, but since I have no clue how to actually use it I am flying blind…

    any code example that uses this would be a great help

    Thanks

    #91856

    to be clear, this:

    BUY stakeSizeLong*pipsize CONTRACTS AT myBuyprice stop

    gives me too much leverage and I am unable to reduce the leverage (would like only 0.01 of it really)

    no matter what number I plug in the stakeSize my position defaults to 1 and the leverage is too big

    #91865

    Mmmm I’ve just spent nearly 15 mins trying to find a simple code snippet on here  or info on the net and I agree it’s not easy! 🙂

    A lot of info is too complex for what it’s worth as once you get the hang of it, we kinda take pips for granted etc.

    Anyway have a scan read of the link below. Babypips is a good easy to follow website generally so you may use it again so not time wasted.

    https://www.babypips.com/learn/forex/pips-and-pipettes

    PS I’ll have a go at getting your code going and post on your other Topic.


    @RobertoGozzi
    could spot the issue in an instant! 🙂

     

     

     

     

     

    1 user thanked author for this post.
    #91870

    thanks GraHal I really appreciate your help and effort put into answering my question!

    I will look into the link you sent me, however looking at it from another angle I am not totally sure that is the issue, as I use the graph command and do see that the buy and sell order are correct and are triggered correctly. the only thing that doesn’t work for me is the stackSize that is ignored when it is lower to 1 and is just defaulted to one no matter if I insert 0.000001 as a stackSize parameter.

    maybe it is somewhere in the settings? or maybe it is pipvalue/pipsize but I am not using it correctly there

    #91871

    You would not use

    But you might use

     

    #91872

    using “*pipsize” converts a price into pips, usually by dividing the price by 10000, since 1 pip=1/10000th of the price (on Dax and other instruments the divisor is 1, not 10000).

    To retain a value > 1 stakeSizeLong should be at least 20000!

    If you change instrument and switch from Eur to Jpy you can only manually adjust your capital to match that required by the FX pair.

    1 user thanked author for this post.
    #91873

    the stackSize that is ignored when it is lower to 1

    What is the minimum lot size on the market you are trading??

    It is probably 1 ? 🙂

    1 user thanked author for this post.
    #91875

    Sorry, I can’t edit my post, the first line should read “using “*pipsize” converts pips into price”.

    Dividing a price by pipsize is the other way round.

    #91879

    Thanks guys for your help.

    I shared parts of my code here, maybe it would make sense:

    https://www.prorealcode.com/topic/using-floating-point-in-fx-markets/

     

    the stackSize I need in a market such as EUR/JPY using 1yy.yyyy is usually 0.1-0.9 – i tried to manually plug 0.5 as a stacksize but still get 1. So I don’t know how to avoid this problem.

    I do NOT have problems with the entry or exit points, everything else seems to work fine with out the pips so I don’t think “BUY stakeSizeLong CONTRACTS AT (myBuyprice+10*pipsize) stop” will help here. the amount of the order price is correct without the pips…

    All this is new to me, so I am a bit confused as the same code worked perfectly well in DJI and also in GBP/USD where the price format is different.

    Thanks again!

    #91881

    I was talking about your example “BUY stakeSizeLong*pipsize CONTRACTS AT myBuyprice stop”.

    #91882

    so I don’t think “BUY stakeSizeLong CONTRACTS AT (myBuyprice+10*pipsize) stop” will help here

    I was providing an example of the use of pipsize, not suggesting that you need / include above in your code.

    tried to manually plug 0.5 as a stacksize but still get 1

    1 is the minimum lot size on my Platform on EUR/JPY.

    #91883

    1 is the minimum lot size on my Platform on EUR/JPY.

    See attached … it shows in red when the Lot size is not allowed!

    #91890

    Thanks again guys, your great!

    I have a feeling we are going in the wrong direction though…

    Here is my problem again, this time with images.

    I am using a working test code that takes a “normal” stack size (1-4 lots in the example in the image) but when I run the code my account of 10K is depleted within days because the value of each pip is huge.

    I tried reducing the stackSize hoping it would work but it doesn’t (can’t go under 1.0)

    as you can see my screen shows a totally different Sell/Buy pair then yours GraHal. you seem to see it in 1xxxx.x format but I see 1xx.xxx which I believe is the cause of the problem. I just searched for EUR/JPY  – should I have looked under a different market name?

     

    I am hoping the images would help you see how 10 trades totally deplete my account (I would want any loss to be less than 500 EUROS in this case)

Viewing 15 posts - 1 through 15 (of 22 total)

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