NexusFi: Find Your Edge


Home Menu

 





Running two strategies on one chart; Has anyone done it successfully?


Discussion in MultiCharts

Updated
    1. trending_up 3,029 views
    2. thumb_up 0 thanks given
    3. group 4 followers
    1. forum 3 posts
    2. attach_file 1 attachments




 
 

Running two strategies on one chart; Has anyone done it successfully?

 
 
Sinatra Fan's Avatar
 Sinatra Fan 
Orlando FL
 
Experience: Intermediate
Platform: MultiCharts, Ninja
Trading: Emini ES
Posts: 66 since May 2019
Thanks Given: 7
Thanks Received: 9

I've run into a huge problem with my FLEX-RENKO strat. That being that for some reason, MC doesn't seem to like my program when running on a tick by tick or IOBG basis. And because of that, I'm running into an end of day problem when the bar doesn't complete before the session ends.

So, I'm thinking of creating a second strat that will run on a tick by tick basis but only close out open positions at the end of the session. Has anyone successfully ran 2 strats on a chart at the same time? If so, is there anything I should be mindful of? Thanks

Started this thread

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Trade idea based off three indicators.
Traders Hideout
ZombieSqueeze
Platforms and Indicators
How to apply profiles
Traders Hideout
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
48 thanks
Just another trading journal: PA, Wyckoff & Trends
32 thanks
Bigger Wins or Fewer Losses?
24 thanks
Tao te Trade: way of the WLD
24 thanks
GFIs1 1 DAX trade per day journal
22 thanks
 
 BrianBacchus 
Las Vegas
 
Experience: Intermediate
Platform: MultiCharts .NET
Trading: CL
Posts: 26 since Oct 2015
Thanks Given: 7
Thanks Received: 37

You could turn on your existing strategy as being Intrabar (tick by tick) but then wrap your coding logic to only trade and record values when the bar state changes to close. You could also specify a time to exit positions if they still exist. However, in order to ensure you strategy doesn't try to trade again during the last few minutes before closing you'll have to create a "time to trade" window.

I don't know if you're using MC or MC.NET. Since I don't know PL and only use .NET here's an example of what I mean:

protected override void CalcBar(){

if(StrategyInfo.MarketPosition > 0){
SellPosition;
}

if (StrategyInfo.MarketPosition < 0){
BuyToCoverPosition
}

if (Bars.Status == EbarState.Close && TimeToTrade() == true){
Your Logic Here
}


}
private bool TimeToTrade()
{
TimeSpan barTime = Bars.TimeValue.TimeOfDay;

// If the range is on the same day, both expressions must be true
if (startTime < endTime)
return (barTime >= startTime) && (barTime <= endTime);

// Otherwise the range crosses midnight, and only one of
// the expressions need to be true
return (barTime > startTime) || (barTime < endTime);
}

I'm getting the TimeToTrade code from the link below which describes exactly how that portion works:
https://www.tradingcode.net/multicharts-net/trading-strategies/trade-certain-times-trading-strategy/

There's a downside to this approach, and it may not matter much depending on how large your trading bars are. Since it calls your strategy on EVERY tick it's working a lot harder than normal.

If you're using time-based bars (5min, 10 mins, etc) you could simply add a clause at the end of your script to close out any position the last bar you know will occur BEFORE the final bar of market close. For example, if you're trading 10min bars, and crude oil it would look something like this:

if (Bars.Time[0] >= 1649)
{
if (StrategyInfo.MarketPosition > 0){
sell;
}
if (StrategyInof.MarketPosition < 0){
buytocover;
}
}

 
 
Sinatra Fan's Avatar
 Sinatra Fan 
Orlando FL
 
Experience: Intermediate
Platform: MultiCharts, Ninja
Trading: Emini ES
Posts: 66 since May 2019
Thanks Given: 7
Thanks Received: 9


I tried tick by tick and for some reason, it stops closing out my layered positions. I'm in the middle of adding an additional filter to my current strat. When I do, I may try the two strat deal with the second strat working on a tick by tick basis to close out at end of day. I'm also considering running two data series on the chart with the first being a 1-tick chart and the second being my Flex Renko chart. since multi data strats trade on data1, then I should be good to go.

Started this thread
 
 BrianBacchus 
Las Vegas
 
Experience: Intermediate
Platform: MultiCharts .NET
Trading: CL
Posts: 26 since Oct 2015
Thanks Given: 7
Thanks Received: 37

Check your IOG Settings for Exits, that might be why it's not exiting out of all positions.



Doing tick by tick in Data1 with your trading signals based on Data2 would probably work, it just adds lots of bars to the chart that would massively slow down things like optimization. If you're not using that it probably isn't an issue.

With that setup if you're using stops or limit orders they may only be persistent for a tick when the entry criteria is met. If you're using market orders or generate stop loss/profit target it should be fine as they automatically persist.


 



Last Updated on October 27, 2021


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts