Accessing Bars in Multicharts Easy Language - MultiCharts | futures io social day trading
futures io futures trading


Accessing Bars in Multicharts Easy Language
Updated: Views / Replies:2,231 / 3
Created: by aga17 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
 

Accessing Bars in Multicharts Easy Language

  #1 (permalink)
Trading Apprentice
Vancouver Canada
 
Futures Experience: Intermediate
Platform: MultiCharts
Favorite Futures: Gold
 
Posts: 3 since Jun 2012
Thanks: 0 given, 0 received

Accessing Bars in Multicharts Easy Language

So I'm building a indicator that needs to check whether a lower high or higher was initiated first on a double switched bar. I was able to get this working for real time data but for the historical data (non real time) I am unable to access the individual ticks (from what I understand).

So i have decided to use a second data stream at a higher resolution (more bars) to determine what was triggered first on the double switch. However, when I compile my code it seems to get the barnumber of the first double switch right so I can simply step back resolution2/resolution1 bars back and see how the price changes to determined what was triggered first. However, it seems to show me the wrong barnumbers for the remaining double switches (it is off by 10 bars when using data1=30 days and data2=6 days). Here is the code I'm currently running. Any help would be greatly appreciated thanks.



//------------------------------------------------------------------------------------ //Double Switch statements (Historical)
if (GetAppInfo(aiRealTimeCalc)= 0) then begin
if ((High of Data1 >= (High [1] of Data1 + HigherHigh)) of Data1 and (Low of Data1 <= (Low[1] of Data1 - LowerLow)) of Data1) then begin // Check if a higher high and lower low are hit on the same bar (double switch)
BarTime = Time of Data1;
PrevTime = Time[1] of Data1;

Resolution2 = barinterval Data2;
Resolution1 = barinterval Data1;

BarCount = Resolution1/Resolution2; ;
D2_Bar = (BarNumber* BarCount);

Print ("D2_Bar: ", D2_Bar);
for x=BarCount downto 1 begin
D2_High = High[x] of Data2;
D2_Low = Low[x] of Data2;

Print ("NewBar: :", (D2_Bar - X));

if ((D2_High>= (High[1] + HigherHigh)) and (D2_Low > (Low[1]- LowerLow) and new_High = False and new_Low = False)) then begin //New High
new_High = True;
RefHigh = High;
Print ("New High: ", D2_High:1:5);
end;

if(D2_Low <= (Low[1] - LowerLow)) and (D2_High < (High[1]+ HigherHigh) and new_Low = False and new_High = False) then begin // New Low
new_Low = True;
RefLow = Low;
Print ("New Low: ", D2_Low:1:5);
end;
//------------------------------------------------------------------------------Double Switch
if ((D2_Low <= (Low[1] - LowerLow) and new_High = True) and newLH=False and newHL= False) then begin //New Low after High
newHL = True;
Print (" New HL: ");
end;

if ( ((D2_High >= (High[1] + HigherHigh))and new_Low = True) and newHL=False and newLH=False) then begin //New High after Low
newLH = True;
Print (" New LH: ");
end;

end;
end;
end;


Also, the code seems to run multiple times for the same bar. It seems as if it runs the same thing for the number of bars from data2 between the current bar of data1 and the previous bar on it.

Reply With Quote
 
  #2 (permalink)
Trading Apprentice
Vancouver Canada
 
Futures Experience: Intermediate
Platform: MultiCharts
Favorite Futures: Gold
 
Posts: 3 since Jun 2012
Thanks: 0 given, 0 received

So I have been able to pinpoint the issue to using multiple time frames. I am using a for loop to check the HLC values on the higher resolution chart (data2). I've noticed that the code executes for the number of bars that are between 2 bars on data1 (i.e. for data1 = 30 days and data2= 2 days, the code will be executed 15 times for the one bar). This throws all of the barnumbers off, and hence gives me incorrect values. Any help would be appreciated.

thanks

Reply With Quote
 
  #3 (permalink)
 Vendor: tradingcode.net 
The Netherlands
 
Futures Experience: None
Platform: MultiCharts, TradingView
Favorite Futures: ...
 
Jura's Avatar
 
Posts: 774 since Apr 2010
Thanks: 2,347 given, 661 received



aga17 View Post
So I have been able to pinpoint the issue to using multiple time frames. I am using a for loop to check the HLC values on the higher resolution chart (data2). I've noticed that the code executes for the number of bars that are between 2 bars on data1 (i.e. for data1 = 30 days and data2= 2 days, the code will be executed 15 times for the one bar). This throws all of the barnumbers off, and hence gives me incorrect values. Any help would be appreciated.

I know some PowerLanguage but have no idea what you're talking about. I don't even get your very first line:


aga17 View Post
So I'm building a indicator that needs to check whether a lower high or higher was initiated first on a double switched bar.

What is "initiated first on a double switched bar"? If this is your goal of this indicator, I don't know what you're trying to accomplish.


aga17 View Post
Also, the code seems to run multiple times for the same bar. It seems as if it runs the same thing for the number of bars from data2 between the current bar of data1 and the previous bar on it.

This might be due to your loop?


Can you tell what your goal is?
Also, try using the [ code ] and [ / code ] tags next time when posting code - that makes it a lot better readable (click on the # in the post editor).

Reply With Quote
 
  #4 (permalink)
Trading Apprentice
Vancouver Canada
 
Futures Experience: Intermediate
Platform: MultiCharts
Favorite Futures: Gold
 
Posts: 3 since Jun 2012
Thanks: 0 given, 0 received

I've been able to pinpoint the issue to the For loop. This is a small part of a larger indicator that I am trying to implement. So when I get a new bar that has a higher high and lower low than the previous bar the indicator is triggered in order to determine which event occurred first.

For example, if High[1] = 20 and Low[1] =18, and High=21 and low=17 the indicator is triggered. (Note: this is only for historical data on the chart, not for real time data). Thus i can only see the new higher high and lower low on the bar but can't see which one happened first. To overcome this I am using a second data stream with a higher resolution (i.e. more bars) to determine which event occurred first.

So for example if I use a resolution of 2mins on data2 and 30 mins for data1, I will have 15 bars inbetween the data interval of data1 to trace through the higher resolution bars to determine if a higher high or lower low was triggered on a bar that has both.

Thanks

Reply With Quote

Reply



futures io > > > > Accessing Bars in Multicharts Easy Language

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can MultiCharts Easy Language be programmed to do this? bjschwenzer EasyLanguage Programming 3 August 12th, 2011 01:41 AM
30 Minute Bars, easy Language, Multicharts jimfini EasyLanguage Programming 5 August 9th, 2011 05:42 AM
convert metatrader indicators to easy language for multicharts kdmezz EasyLanguage Programming 1 May 10th, 2011 07:45 PM
First Indicator programing, Text on graph >> Easy language / Multicharts arjfca The Elite Circle 2 September 22nd, 2010 10:05 PM


All times are GMT -4. The time now is 10:50 PM.

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-13 in 0.10 seconds with 19 queries on phoenix via your IP 54.226.113.250