Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Issuing Trade Entry Orders at Defined Spread Limits
I have started using MultiCharts 11 (not the .net C# version), looking to automate some of my existing intraday trading strategies for spot forex CFDs. OANDA is the CFD broker.
The plan is to allow the automated trading systems to be running 24 hours per day. However, one of the issues to overcome is the period of 'zombie' hours between approximately the closing of the US session and the opening of the Asian session. During this time, the spreads on the CFDs blow out due to the very low liquidity levels. For example, where the GBPUSD spread may typically be 0.6 pips during liquid periods, it can blow out to say 3 or 4 pips during the illiquid periods, which is very expensive and simply not viable for some intraday trading systems. Therefore, I don't wish to enter a trade at that spread. Note, this is a 'spread-only' account, therefore there is no commission on trade entry or exit.
Unfortunately, it is not simply a case of coding the strategies to operate within defined times of the day. Sometimes the liquidity comes on early, and at other times you are sitting at the screens thinking, "come on guys, where is everyone?". And of course, news announcements or other events can temporarily blow out the spreads as well.
Therefore, I would like to have the MultiCharts PowerLanguage coded in a way so as to disallow any trade entries during these high spreads. The OANDA plugin with MultiCharts does not advise MultiCharts what the spread is at any given time. It would have to be along the lines of MultiCharts sending the trade entry order to OANDA but when the broker receives it, if the spread is greater than say 1.8 pips, then the order is not executed by the broker.
Does such a function exist?
Can anyone share the code which will achieve this?
Also, within the MultiCharts Signal, where should the code be placed?
Your input would be appreciated. Thank you.
Can you help answer these questions from other members on NexusFi?
once Multicharts issues the order, you can only cancel it again (unless it's filled of course), I am not aware of an additional feature within MC that would allow the order to be only filled at your broker when the spread is less than X.
In realtime you can check the spread before you issue the order and try to cancel placed orders when the spread is greater than X. Take a look at the build in Bid & Ask indicator to see if it correctly displays the bid and ask prices of your broker.
OANDA has a plugin for integrated Chart Trading on each chart screen of MultiCharts. Can anything be automated at this level?
For example, if buying: bid price minus the ask price = x pips. Then x must be less than 2.0 pips for the trade entry order to be issued to OANDA.
the Chart Trader is for manual trading only and you can't access it with code.
However as I wrote in my previous code, you can check the bid ask spread from the code level and only issue the order when the spread matches your criteria.