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)
I’m TRYING to go live with my strategy with multicharts but I already had problems with sending my orders.
Yesterday My orders were rejected for missing TIF… then I found the solution on MC forum and I made the correct broker lookup setting.
The problem comes TODAY when my strategy tryed to send a limit order on the DAX and it has been canceled, then the strategy tryed again many time and always with the same results then I stopped the automatic trading…
Do you have any Idea on what is the problem
I made all the setup. The symbol settings is ok. I have an order number so the order is sent to the broker and AMP confirmed that on their side there are no problems so it must be the strategy?? But why?? With simulation it works fine and it proceed the order.
Any help would be appreciated.
Just to know. Today and yesterday operation would have been a good gain and I’m so disappointed to lost them ( It coud have been a good start).
Thanks.
Can you help answer these questions from other members on NexusFi?
does this also happen in simulated forwarded testing with the strategy automation enabled? If it does, it's likely a coding problem and without seeing the code that generates the orders it would be hard to tell more.
Debugging the real time behavior could be the next step - check the bar status for the data streams that your code gets computed on and track down if the orders could be cancelled by the bar status being negative for example.
BTW: This is just an example of the entry order code in my strategy (Multicharts):
and the exit is also very simple, if a condition is met then
and I also have IOG enabled.
About the "simulated forwarded testing with the strategy automation enabled" I'm honestly not sure about what this is.
To test it I usually leave the strategy on the chart without the "SA" ( automation disabled ) and it performs trades in real time and during past months they all match the backtest on historical data.
I know that it's hard to tell without see the strategy but what other pieces of part of it should I post here (without post all the strategy logic?)?
you can use the strategy automation on the Paper Trading account that is built-in within Multicharts.
I am afraid without seeing the code one could only guess, but you might get more help from the futures.io community if you post full working code (and a workspace using your settings) that can demonstrates the exact behavior and can be used to reproduce the issue. This does not mean revealing your entire logic, as you can replace parts of the code with something else of course, as long as the code exhibits the same behavior.
Ok I removed the code entry logic and some other parts BUT the case entry that you can see here is the case of this morning and after the code you can see the trade that SHOULD HAVE BEEN DONE:
This is the trade that gave me the error in REAL automated trading:
Is it enough the piece of code posted?
As you can see the trade is in the 9:05 bar of 5minutes chart... just 3 tick after that orange level on there should have been a limit short at 12268. I was wondering how much time does an order stay in the market before MC cancel it...
Any idea would be appreciated I really need to have this strategy live after so much work and study ...
Hi Dvdkite, there's no set time amount. Multicharts submits limit orders as long as your conditions are met, and cancels them immediately when your condition is no longer met.
As @ABCTG wrote, the built-in paper trading broker is the way to go -- it will actually use MC's full internal order logic.
We can't tell anything by the order you showed us on the chart. That is the same as a regular backtest that approximates and obscures many real execution issues.
You have debugging statements in your code -- great -- but none of them are in the entry logic section (when marketposition = 0). And that is where I think you need some to solve this. Print out on each bar the if the entry limit should be effective in the market or not. Maybe this will show that you have the conditions but they are false on the next bar, and then set on then following bar, and so on.
Simplify your entry conditions -- see if you can get any limit orders at all to remain in the market under your control.
Lastly, definitely use the "paper trading" broker mode with automation enabled. Verify your strategy thoroughly with it.
IMO you just can't know for real if the strategy would have been profitable yesterday. In fact it might be great news that these orders were cancelled -- What if you had dozens filled in under one minute? Imagine having to scramble with the MC DOM to cancel them all quickly.
As you probably know there is awesome advice on FIO on the process of developing a live strategy. If the strategy performs, you won't care that you waited extra time to deploy it.
@ocpb posts is giving you some great advice. Since you are dealing with intrabar order generation keep in mind that the next tick could potentially invalidate your entry conditions again and in turn the strategy engine will cancel the order again. Besides that any of the other points that Henry mentioned here can also lead to orders getting cancelled: https://www.multicharts.com/discussion/viewtopic.php?t=51981
Hi ocpb and thanks for your suggestions.
Ok so my entry conditions are based on the OHLC values of the previous 6 bars (from [1] to [6] and those are in the past so they CAN'T change my conditions as the past can't change eheh ) and then in the BAR [0] (so now during the last bar on chart formation) I'm checking if the price is under a level (it's a price calculated at the begininning of the day with some Gann formulas) and if the difference from that level and if the actual price is under 10... in that case I place an order limit simply 3 tick over that level for a short (under for a long).
The part of code that generate the entry is:
So the *** line is the only line that can change the conditions during EVERY tick because with IOG true the code is recalculated intrabar on every tick. So looking at those 2 simple conditions do you think that is there no time for a limit order to be filled before any of those 2 conditions are denied?
I'm carefully examinating all of your suggestions and also the suggestions of Henry multicharts in the MC forum and I'm starting with this.
So what do you think about the code above?
If you look ad the image of the missed trade (posted yesterday) you can see that the short limit order was at 11268 short and the bar where the order should have been executed had a HIGH of 12269,5 and it means 3 tick higher (you cannot see exaclty from the image, I checked now the exact value) so it would have been executed for sure and also I saw that in real time in front of my eyes.
By examinating this behaviour there was enough time to send the order and execute it BEFORE any condition change... or am I missing something?
Thanks @ABCTG to tell me about this feature. I honestly missed it and it is now live trading with the paper trading broker to check next days entries.
About this I have a question: is there a way to let the order LIVE till the end of the bar when the conditions are met for the first time?
I mean.. is there a way to send the order at first time that conditions are met and then DO NOT CANCEL IT before the end of the bar? (Leaving IOG true of course)....
This could potentially solve the issue....
As I said above to ABCTG thanks for bringing my attention to this. Unfortunately (but it is a good thing eh eh ) my strategy usually do an average of 15 operations per month so it would not so quick to see how orders will be processed live on paper trading broker....This morning in front of my eyes I saw another positive operations of the system just 5 minutes before I setted up a new workspace for the paper trading...
Of course I'll never know for SURE. But yesterday and today I was on the screen and I can assure that the limit orders would have been filled because the price goes over my limit order conditions as specified above.
How it is possible to have dozen of orders filled if the order is sent only when market position = 0? Is such an issue possible?
about this purpose I'm really trying to investigate if is there any possible case where my conditions are invalidated in the next click. So if you look at my answer to @ocpb above you can see that this piece of code
has only one line where conditions can change and it is the *** line. Basically when it met all PAST conditions (and they cannot be responsible for a sudden change in conditions) the strategy is going to send the limit order when the price is ABOVE the oYesterdaysTPOVALow Level and the difference between price and the level is below 10 pts.
So when the price goes over the level the strategy is sending an order and as long as I'll be in the "level + 3 limit" condition I can assume that it should have been filled...
Do you think that when the price is breaking the level by going over and below it for some time could cause the change of the triggering conditions? Is there a way to send an order ONCE the conditions are met and then wait for the close of the bar to RECHECK conditions and eventually REVOKE it ?