MC / TS : Using Subcharts in studies - EasyLanguage Programming | futures io social day trading
futures io futures trading


MC / TS : Using Subcharts in studies
Updated: Views / Replies:3,605 / 15
Created: by NW27 Attachments:0

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 
Thread Tools Search this Thread
 

MC / TS : Using Subcharts in studies

  #1 (permalink)
Elite Member
Newcastle, Australia
 
Futures Experience: Intermediate
Platform: Multicharts 8 - Full Version
Broker/Data: IB
Favorite Futures: SPI,FTSE100, 6E, 6A
 
Posts: 285 since Oct 2010
Thanks: 108 given, 177 received

MC / TS : Using Subcharts in studies

Hi,
How do I use a function that I have coded to work on a Hourly bar in a 5min study?
The issue is that Daily bars do not limit themselves to the session times applied to them.
If I create a chart using hourly bars and set the period to 24hrs and apply the session, I get the bars OHLC that I'm looking for. A daily bar using sessions.
I then want to use this daily OHLC in a function. All good so far. When I do plots on this 24hr chart using my function it gives me the correct signals.
Now I want to use these pseudo daily signals in a 5min chart.

Can I reference a function that is being applied to subchart2 against a study in subchart1?
Or something similar?

Neil.

Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,651 since Mar 2010
Thanks: 4,226 given, 25,600 received
Forum Reputation: Legendary



NW27 View Post
Hi,
How do I use a function that I have coded to work on a Hourly bar in a 5min study?
The issue is that Daily bars do not limit themselves to the session times applied to them.
If I create a chart using hourly bars and set the period to 24hrs and apply the session, I get the bars OHLC that I'm looking for. A daily bar using sessions.
I then want to use this daily OHLC in a function. All good so far. When I do plots on this 24hr chart using my function it gives me the correct signals.
Now I want to use these pseudo daily signals in a 5min chart.

Can I reference a function that is being applied to subchart2 against a study in subchart1?
Or something similar?

Neil.

I think you can create your daily OHLC values easily from your 5 minute chart directly. There is no need taking them from the hourly chart.

By the way, it is not clear, what you are trying to achieve and what use you want to make of your daily signals. If you tell us, we might find a solution.

Reply With Quote
 
  #4 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,238 since Jun 2009
Thanks: 29,350 given, 83,218 received

It is unclear: Are you asking about TradeStation (you are in the TradeStation section), but your platform in your profile says NinjaTrader.

Can you post your ELD or PLA code?

In general, you simply use data1 to submit orders and data2 (and more, as needed) to hold the dataseries values for the particular timeframe you want (5m, daily, whatever).

Mike

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
The following user says Thank You to Big Mike for this post:
 
  #5 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,651 since Mar 2010
Thanks: 4,226 given, 25,600 received
Forum Reputation: Legendary


Big Mike View Post
It is unclear: Are you asking about TradeStation (you are in the TradeStation section), but your platform in your profile says NinjaTrader.

Can you post your ELD or PLA code?

In general, you simply use data1 to submit orders and data2 (and more, as needed) to hold the dataseries values for the particular timeframe you want (5m, daily, whatever).

Mike

Thanks, did not check the thread, just saw NinjaTrader as personal preference for the platform.

Reply With Quote
 
  #6 (permalink)
Elite Member
Newcastle, Australia
 
Futures Experience: Intermediate
Platform: Multicharts 8 - Full Version
Broker/Data: IB
Favorite Futures: SPI,FTSE100, 6E, 6A
 
Posts: 285 since Oct 2010
Thanks: 108 given, 177 received

Hi,
On Christmas day I bought MultiCharts. Did I get the Two for One. No :-( Separate story.

In Australia the predominant futures contract is the SPI that trades from 9:50AM to 4:30PM (Day Session) and ~5:30PM to 7:30AM (Night Session)
My first problem is creating Daily bars using the Day Session that I can use in a function and apply to my intraday strategie.
Basically, if the last few days setup in an appropriate manner, then I would go Long the next day.
Sort of using a mix of LBR and Taylor.
So the daily bars give me a direction to trade my 5min bars the next day.

The below code generates a 1=Buy next day at open, -1=sell next day at open, 0=Stand aside.

 
Code
{
    Type - Function
    Name - SW_System1
    Desc - SPI - RSI & ROC 
             This Function is intended for Daily use only
        Returns a Long,Short signal
          Written by Neil Wrightson 

    Version     Date         Reason 
    1        03/01/2011    Start 
}

Variables: YCol(0), XCol(0), ZCol(0), TwopROC(0), LBR_RSI(0), LongTrade(0), ShortTrade(0); 


// External Functions
// ==============================
//
//YCol = return(Max(Ref(Close,-1)-Close,0));
if close[1]-close > 0 then
    YCol = close[1]-close
else
    Ycol = 0 ;
    

//XCol =    return(Max(Close-Ref(Close,-1),0));
if Close-close[1] > 0 then
    XCol = Close-close[1]
else
    Xcol = 0 ;


//ZCol =    return(IIf(Sum(ycol(),3)>0,100-(100/(1+(MA(xcol(),3)/MA(ycol(),3)))),100));
if Summation(YCol,3)>0 then
    zcol = 100-(100/(1+(average(xcol,3)/Average(ycol,3))))
Else
    zcol = 100;



//TwopROC =    return(IIf(Close-Ref(Close,-2)>Max(Ref(Close,-1)-Ref(Close,-3),Ref(Close,-2)-Ref(Close,-4)),1,IIf(Close-Ref(Close,-2)<Min(Ref(Close,-1)-Ref(Close,-3),Ref(Close,-2)-Ref(Close,-4)),-1,0)));
If((Close-Close[2])>iff((Close[1]-Close[3])>(Close[2]-Close[4]),(Close[1]-Close[3]),(Close[2]-Close[4]))) then begin
        TwopROC = 1;
        end
Else begin
    if ((Close-Close[2])<IFF((Close[1]-Close[3])<(Close[2]-Close[4]),(Close[1]-Close[3]),(Close[2]-Close[4]))) then begin
        TwopROC = -1 ;
        end
    Else begin
        TwopROC = 0 ;
    end;
end;

// LBR_RSI =    return(IIf(ZCol()>70,-1,IIf(ZCol()<30,1,0)));
LBR_RSI = IFF(ZCol>70,-1,IFF(ZCol<30,1,0));

// LongTrade =    return(IIf((Ref(LBR_RSI(),-1)>0) AND (Ref(TwopROC(),-1)<1),1,0));
LongTrade =    IFF((LBR_RSI[1]>0) AND (TwopROC[1]<1),1,0);

//ShortTrade = return(IIf((Ref(LBR_RSI(),-1)<0) AND (Ref(TwopROC(),-1)<1) ,1,0));
ShortTrade = IFF((LBR_RSI[1]<0) AND (TwopROC[1]<1) ,1,0);

if Longtrade = 1 then
    SW_System1 = 1 
Else
    if ShortTrade = 1 then
        SW_System1 = -1 
Else
    SW_System1 = 0;
Value1 = GVSetNamedFloat("Setup",SW_System1);
    
    
//print(date:8:0,lbr_rsi,twoproc,xcol,YCol,zcol,SW_System1)
//print(File("C:\SW_System1.TXT"),date:8:0,lbr_rsi,twoproc,xcol,YCol,zcol,SW_System1)
Neil.

Reply With Quote
 
  #7 (permalink)
Elite Member
Newcastle, Australia
 
Futures Experience: Intermediate
Platform: Multicharts 8 - Full Version
Broker/Data: IB
Favorite Futures: SPI,FTSE100, 6E, 6A
 
Posts: 285 since Oct 2010
Thanks: 108 given, 177 received

Sample chart.
The Top chart is a 5min chart of the SPI only showing the Day session.

The bottom chart is a 24 Hour chart showing Daily bars that represent the Day Session.

Using the function I created, I have plotted Dots at the beginning of the day. Showing Red for Short the day and Green for Long for the day.
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

Reply With Quote
 
  #8 (permalink)
Trading Apprentice
St. Petersburg, Russia
 
Futures Experience: Advanced
Platform: Multicharts
Favorite Futures: spot fx, currency futures, GC, ES
 
Posts: 30 since Nov 2010
Thanks: 6 given, 17 received

Neil, not sure I have got you properly enough, but have you checked the settings for your instruments in QuoteManager? There are plenty of settings for defining custom trading hours. Then I think you should use not 24h but some other time cycle relevant to the trading hours of your exchange. In this case you will have N-minutes and daily bars exactly corresponding to each other.
Sorry if this sounds dubious, honestly I didn't quite catch the essence of your issue.

Reply With Quote
The following user says Thank You to Doctor Leo for this post:
 
  #9 (permalink)
Elite Member
Newcastle, Australia
 
Futures Experience: Intermediate
Platform: Multicharts 8 - Full Version
Broker/Data: IB
Favorite Futures: SPI,FTSE100, 6E, 6A
 
Posts: 285 since Oct 2010
Thanks: 108 given, 177 received

Thanks for responding.
My data feed is via Interactive brokers. From IB you can get the usual tick,minute data and "Daily" bars.
These Daily bars from IB are for a full 24Hr period. IB does not have sessions.

With both NinjaTrader and Multicharts. When you select a "Daily" chart using either NinjaTrader or Multicharts, they use the Daily bars they have down loaded from IB.
Even though they both have Session parameters that can be applied to the Daily chart, they don't use them.
This would mean the application (NinjaTrader and Multicharts) programmers would have to work a little bit harder by looking at the chart and the way the user has set their parameters then
a) See if a session has been applied to it
b) See if the chart is a daily chart
c) if it is a daily chart, build the Daily bars from minute data using the applied session template, not from the daily bars downloaded from IB.

Neil.


Last edited by NW27; January 5th, 2011 at 04:04 PM.
Reply With Quote
 
  #10 (permalink)
Elite Member
Newcastle, Australia
 
Futures Experience: Intermediate
Platform: Multicharts 8 - Full Version
Broker/Data: IB
Favorite Futures: SPI,FTSE100, 6E, 6A
 
Posts: 285 since Oct 2010
Thanks: 108 given, 177 received


No Ideas ???

Reply With Quote

Reply



futures io > > > > > MC / TS : Using Subcharts in studies

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
TS/MC: VWAP with standard deviation indicator. marcovth TradeStation 9 July 7th, 2017 11:02 AM
TS/MC DoubleMA indicator ptcm EasyLanguage Programming 10 October 6th, 2016 06:07 PM
TS / MC : Basic Indicator Help? Micardo EasyLanguage Programming 2 February 27th, 2011 12:30 PM
MC/TS : Better screen plot shapes NW27 EasyLanguage Programming 1 January 7th, 2011 12:46 AM
Different results for the same codes running in ts and mc? yoyo2000 NinjaTrader 3 July 16th, 2010 05:14 AM


All times are GMT -4. The time now is 12:49 AM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts
Page generated 2017-12-11 in 0.13 seconds with 19 queries on phoenix via your IP 107.20.115.174