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)
Inside my strategy I need to set an OCO order with Stoploss and Target immediately after the system has opened a position.
I NEED to set the Stoploss only at the close of the candle where the entry order has been filled, because i need some time for the exact calculation of the stop loss value (in my case the TRADEstopLoss value ).
So I thought to simply put the condition " if barstatus = 2 " before the stop order and this worked just fine in the backtest, but TODAY in realtime (with real money) testing when the system entered a position it was able to set up the target easily but the STOP loss order keeping to be set and then rejected/canceled at the end of every bar.
The system is running over a 100tick chart and really at the end of every bar , when market position is 1 or -1, it continued to set the stop loss and cancel it the second later.
So basically I only had a target on the chart, the stop loss appear for a millisecond and then disappear the second after and by this way I cannot protect myself from sudden movement.
This is the code I'm using ( short position example ):
Do you have any suggestion about how can I make it work? I just need to send the stoploss order at the end of the bar (that's why I used barstatus = 2)....
Thanks
David
Can you help answer these questions from other members on NexusFi?
waiting for a reply I made some tests .... I think I could solve by usind "barssinceentry > 0" instead of "barstatus = 2".... Anyway as this should affect just the timing to set the stop loss over a very fast chart (100tick) I was wondering why the backtest shows a little difference in results by using one condition rather than the other.
I confirm that the solution proposed above is actually working in real money test.
However it is so strange that Multicharts is one of the most used platform for sistemac trading and there only a few person here to discuss about technical details...just my thought of the morning.
I almost solved the problem using " barssinceentry > 0" instead of " barstatus = 2 "... it is actually waiting for the close of the candle to put the stop loss... it is actually acceptable for me ( it is on 100 tick bar so fast enough to be placed in time ).
Anyway the MC section of this forum is so empty..... Don't know why. Mc is still one of the most used platform for sistematic trading....