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
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).
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
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
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?
You can use Mini contracts worth €1 each (EURUSD Mini, etc…, which is ten times less.
Here is the mini EURUSD, however it has a min value of $12k USD. Is there something I don’t catch here?
Thanks, Robert.
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!!!!! 🙂
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?
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.
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?
It seems i cannot do fraction and that 1 contract is minimum?
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.
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.
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