Time conditioned trading

Viewing 15 posts - 1 through 15 (of 21 total)
  • Author
    Posts
  • #170904 quote
    hanshs
    Participant
    New

    I would like to have a time conditioned forex system.

    Example buy 100 contracts each 1 hour in 2 days.

    How can I do this, please?

    Thanks

    #170910 quote
    robertogozzi
    Moderator
    Master

    There you go:

    DEFPARAM CumulateOrders = True
    //
    Timeframe(Daily,UpdateOnClose)
    IF Not OnMarket THEN
       TradeON = 1
       Count   = 0
    ELSE
       Count = Count  + 1
       IF Count > 2 THEN
          TradeON = 0
       ENDIF
    ENDIF
    //
    Timeframe(1h,UpdateOnClose)
    IF TradeON THEN               //you may want to add  other entry conditions
       BUY 100 CONTRACTS AT MARKET
    ENDIF

    bear in mind that 48 hours * 100 is 4800 contracts, which could be way more than allowed (ProOrder allows no more than 999 contracts, but IG could allow less than that).

    hanshs and Midlanddave thanked this post
    #170912 quote
    hanshs
    Participant
    New

    Thank you so much, Robert.

    Is there any other codes or methods regarding this that you would recommend, please? Similar threads regarding this (I was not able to find similar posts, however this should be something that is frequently requested?)?

    Regarding

    #170913 quote
    robertogozzi
    Moderator
    Master

    I have no memory of other posts on this topic.

    Another way could be to count how many 1-hour have passed since a trade was entered and stop countind (and entering) when 48 is reached.

    Doing date and time math calculations is a bit more complicated because there’s no built-in functions, this could be an alternative way:

    DEFPARAM CumulateOrders = True
    //
    Timeframe(1h,UpdateOnClose)
    IF Not OnMarket THEN
       TradeON  = 1
       DayCount = 0
       MyTime   = 0
    ELSE
       IF MyTime = 0 THEN
          MyTime = OpenTime
       ENDIF
       IF IntraDayBarIndex = 0 THEN
          DayCount = DayCount + 1
       ENDIF
    ENDIF
    IF OnMarket AND (DayCount = 2) AND (OpenTime = MyTime) THEN
       TradeON = 0
    ENDIF
    IF TradeON THEN               //you may want to add  other entry conditions
       BUY 100 CONTRACTS AT MARKET
    ENDIF
    #170914 quote
    hanshs
    Participant
    New

    The contracts regarding forex are just so huge having one contract equalling approx. a value of 10k USD.

    Is there some way to have less value on the contracts?

    #170920 quote
    robertogozzi
    Moderator
    Master

    You can use Mini contracts worth €1 each (EURUSD Mini, etc…, which is ten times less.

    #170924 quote
    hanshs
    Participant
    New

    Here is the mini EURUSD, however it has a min value of $12k USD. Is there something I don’t catch here?

    Thanks, Robert.

    EURUSD-mini.jpg EURUSD-mini.jpg
    #170932 quote
    GraHal
    Participant
    Master

    The EURUSD mini is 1$ per point increase in price.

    What value you wanting to trade?

    Try US500, 1 Contract at 4200 ish?

    I’m smiling because in your original post you mentioned buying 100 Contracts every hour!  I thought … WOW the big boys are joining us little fishers!!!!! 🙂

    #170937 quote
    hanshs
    Participant
    New

    Dear, Gra.

    I think I might have the definitions wrong here. Having 500 contracts meaning 500 USD example. I have used another broker where I sold of 500 contracts of USD versus NOK for example.

    How come it is not like this here?

    #170940 quote
    PeterSt
    Participant
    Master

    As far as I can tell, one contract of EUR/USD = 100.000 euros, hence ~ USD 120.000. The Mini is 1/10th of that indeed. However, you can buy fractions of a contract like 0.1 Mini contract.
    I don’t know about a minimum.

    Do notice that this is IG. For IBKR there is a hard minimum of USD 20.000. I recall vaguely that even that can be less by means of using special Exchanges. But you can’t address those via PRT (you can via Trader Workstation). Don’t pin me down on this.

    #170941 quote
    hanshs
    Participant
    New

    Dear, Peter

    I didn’t know about the fraction. I am so happy about this information. Seeing now that 0.01 is possible.

    Do you guys have any recommendations regarding the code, please? Any inputs on the method

    I would like to arrange for multiple orders regarding a currency hedge. This is seems reasonable, guys?

    #170942 quote
    hanshs
    Participant
    New

    It seems i cannot do fraction and that 1 contract is minimum?

    #170946 quote
    GraHal
    Participant
    Master

    Are you talking CFD?

    On DJI I think 0.5 is minimum on CFD.

    In the UK we use SB – Spread bet and the min on DJI is 0.2.

    Easiest way to find min (for any instrument) is to enter what you would like to trade in the manual trading positions size box and when it turns red you know you have gone too low.

    #170953 quote
    nonetheless
    Participant
    Master

    How come it is not like this here?

    CFD = Contracts for Difference, so 1 contract = the value of the price change per point (or pip). I think perhaps you are confusing this with the underlying nominal value – which is still an important consideration, but because it is a leveraged product, each contract costs only a fraction of that, probably 5%. That is the margin, ie how much capital it costs you to make the trade.

    As for the strategy, it seems to be lacking any theoretical basis, or at least some technical measure of the overall price movement (trend). To buy repeatedly on the hour, either you assume the instrument is in a persistent up-trend – in which case I want to know why you would assume that? or if it’s falling, you want to continually average your position down for when it turns the corner … in which case I’m thinking, why not just wait for it to turn up and then buy?

    You might at least try adding a moving average filter … and then you would probably want a stoploss and a target, maybe a trailing stop. Lots of things to play around with, see what works.

    #171149 quote
    hanshs
    Participant
    New

    Could i connect this code to CMC markets guys were i can sell contracts lower value, please?

    If not is there any other system to CMC, please?

    Thanks

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

Time conditioned trading


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
hanshs @hanshs Participant
Summary

This topic contains 20 replies,
has 7 voices, and was last updated by GraHal
4 years, 8 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 06/01/2021
Status: Active
Attachments: 4 files
Logo Logo
Loading...