Couple of SC (C++) programming questions - Sierra Chart Programming | futures io social day trading
futures io futures trading


Couple of SC (C++) programming questions
Updated: Views / Replies:2,703 / 9
Created: by vegasfoster Attachments:1

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
 

Couple of SC (C++) programming questions

  #1 (permalink)
Elite Member
las vegas
 
Futures Experience: Intermediate
Platform: Sierra Chart
Broker/Data: Velocity/IB
Favorite Futures: 6E
 
Posts: 1,147 since Feb 2010
Thanks: 304 given, 836 received

Couple of SC (C++) programming questions

Hi, I want to be able to create simple functions that I can use within the same DLL, so I have been studying arrays and have looked at other peoples' code, but I am still not understanding how to pull it all together.

As an example I would like to create a function for a ZLMA that I can reuse over and over again like so:

sc.MovingAverage(INPUTDATA , ZLEma1, MOVAVGTYPE_EXPONENTIAL,sc.Index, LENGTH);
sc.MovingAverage(ZLEma1, ZLEma2, MOVAVGTYPE_EXPONENTIAL, sc.Index, LENGTH);
ZLDifference[sc.Index] = ZLEma1[sc.Index] - ZLEma2[sc.Index];
ZLMA[sc.Index] = ZLEma1[sc.Index] + ZLDifference[sc.Index];

with the resulting function being

ZLMA(INPUTDATA, LENGTH)[sc.Index] or whatever the equivalent should be.

Then I would also like to be able to feed the function into itself, e.g. to calculate a double ZLMA, but whenever I have tried to feed other peoples functions into themselves, e.g. ZLMA(ZLMA(INPUTDATA, LENGTH), LENGTH), it looks like it creates some type of loop where on each bar it feeds the new calculation into the next resulting a super smoothed average that gets smoothed for as many times as there are bars on the chart so at the beginning of the chart I have a double ZLMA, but the next bar I have a triple ZLMA, etc.

Any help or references would be appreciated, thank you.

Reply With Quote
 
  #2 (permalink)
Market Wizard
virginia
 
Futures Experience: Intermediate
Platform: ninja
Favorite Futures: ES
 
cory's Avatar
 
Posts: 5,220 since Jun 2009
Thanks: 628 given, 6,318 received
Forum Reputation: Legendary

did you look at example of average of average?

Attached Files
Register to download File Type: cpp averageofaverage.cpp (1.2 KB, 30 views)
Reply With Quote
 
  #3 (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,240 since Jun 2009
Thanks: 29,353 given, 83,234 received


Moderator Note


Thread moved to Sierra Chart Programming




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
 
  #4 (permalink)
Elite Member
las vegas
 
Futures Experience: Intermediate
Platform: Sierra Chart
Broker/Data: Velocity/IB
Favorite Futures: 6E
 
Posts: 1,147 since Feb 2010
Thanks: 304 given, 836 received

Thanks Cory, I have looked at that, but the moving average is a built-in system function. Correct me if I am wrong, but if it's not a built-in system function then there is other stuff you have to do to make it work. I am trying to simplify things by only accessing them from within the same DLL file and not creating a function call to be able to access it from a separate DLL file (I think that would be simplifying it anyway). Right now I have to duplicate each calculation, which I don't mind doing, except it is frequently resulting in too many subgraphs for the code to work. I know how to do it in Ninjascript, but the SC way is eluding me.

Reply With Quote
 
  #5 (permalink)
Elite Member
las vegas
 
Futures Experience: Intermediate
Platform: Sierra Chart
Broker/Data: Velocity/IB
Favorite Futures: 6E
 
Posts: 1,147 since Feb 2010
Thanks: 304 given, 836 received

So I figured out how to build a function, if anyone ever needs help with it then feel free to message me.

I still can't run a function through another function though, the output is not correct. It over smooths the output and the problem is worse when longer periods are used. If anyone could help me with this I would appreciate it, thanks.

Reply With Quote
 
  #6 (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,240 since Jun 2009
Thanks: 29,353 given, 83,234 received

Maybe post some example code?

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
 
  #7 (permalink)
Elite Member
las vegas
 
Futures Experience: Intermediate
Platform: Sierra Chart
Broker/Data: Velocity/IB
Favorite Futures: 6E
 
Posts: 1,147 since Feb 2010
Thanks: 304 given, 836 received


Big Mike View Post
Maybe post some example code?

Mike

Sorry, didn't see your post before, I'm thinking I will make a little tutorial on studies and functions.

Reply With Quote
 
  #8 (permalink)
Elite Member
las vegas
 
Futures Experience: Intermediate
Platform: Sierra Chart
Broker/Data: Velocity/IB
Favorite Futures: 6E
 
Posts: 1,147 since Feb 2010
Thanks: 304 given, 836 received

I have a new c#/c++ question. I am trying to convert this c# code to c++.

 
Code
double value;
value = new double[128];
count = 60
for (i = 0; i <= count; i++) value [i] = -1000000; 
The second line won't compile in sierra. I am reading various tutorials about arrays, etc. but the examples are different and so I don't understand what newdouble[128]; means. Is it giving it an initial value of 128 or declaring an array of size 128 or something else? Thanks for any help.

Reply With Quote
 
  #9 (permalink)
Elite Member
Sydney Australia
 
Futures Experience: Advanced
Platform: SierraCharts, NT
Favorite Futures: ES,TF,CL, SPI,
 
Posts: 78 since Nov 2010
Thanks: 6 given, 23 received

Answer
This post has been selected as an answer to the original posters question Answer


vegasfoster View Post
I have a new c#/c++ question. I am trying to convert this c# code to c++.

 
Code
double value;
value = new double[128];
count = 60
for (i = 0; i <= count; i++) value [i] = -1000000; 
The second line won't compile in sierra. I am reading various tutorials about arrays, etc. but the examples are different and so I don't understand what newdouble[128]; means. Is it giving it an initial value of 128 or declaring an array of size 128 or something else? Thanks for any help.

Not sure what you want to do but it is a declaration of an array, but I do not think you initilise it.
Type Name elements - general formula.
So:
double value[128];
should be enough.
In the context of SC you can use Type SCSubgraphRef which will give you all properties of that type and you can output to a screen.
cplusplus.com - The C++ Resources Network is a good site
Thanks

Reply With Quote
The following user says Thank You to dlatbm for this post:
 
  #10 (permalink)
Elite Member
las vegas
 
Futures Experience: Intermediate
Platform: Sierra Chart
Broker/Data: Velocity/IB
Favorite Futures: 6E
 
Posts: 1,147 since Feb 2010
Thanks: 304 given, 836 received


Thanks a bunch @dlatbm, that solved 90% of my errors!

DLATBM!
DLATBM!
DLATBM!
DLATBM!
DLATBM!
DLATBM!
DLATBM!
DLATBM!
DLATBM!
DLATBM!
DLATBM!
DLATBM!

Reply With Quote

Reply



futures io > > > > > Couple of SC (C++) programming questions

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
Visual Programming (programming without coding) LukeGeniol Platforms and Indicators 11 September 16th, 2016 01:49 PM
Chart Comparison NT & SC itrade2win Tech Support 3 March 14th, 2011 09:36 PM
D9 Conversion from NT to SC vegasfoster The Elite Circle 9 March 1st, 2011 10:41 PM
For One Couple, A Mortgage Nightmare Has a Happy Ending Quick Summary News and Current Events 1 December 25th, 2010 09:22 PM
Couple of small VIP changes Big Mike The Elite Circle 0 October 10th, 2009 12:33 AM


All times are GMT -4. The time now is 03:34 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-16 in 0.16 seconds with 40 queries on phoenix via your IP 54.196.201.241