Plotshapes in C++ dll - AmiBroker | futures io social day trading
futures io futures trading


Plotshapes in C++ dll
Updated: Views / Replies:1,560 / 10
Created: by raghavan 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
 

Plotshapes in C++ dll

  #1 (permalink)
Trading Apprentice
Bangalore + India
 
Futures Experience: Beginner
Platform: NinjaTrader, MetaTrader
Favorite Futures: Futures
 
Posts: 13 since Jan 2015
Thanks: 3 given, 2 received

Plotshapes in C++ dll

I am trying to call PlotShapes in C++ file. Here's the code.

AmiVar argPS[6];
argPS[0].type = VAR_FLOAT;
argPS[0].val = (float)1;
argPS[1].type = VAR_FLOAT;
argPS[1].val = (float)55;
argPS[2].val = EMPTY_VAL;
argPS[3].val = EMPTY_VAL;
argPS[4].val = EMPTY_VAL;
argPS[5].val = EMPTY_VAL;
gSite.CallFunction("PlotShapes", 6, argPS);

But, I dont see anny shapes being plotted in chart. May I know what I am missing here.

Reply With Quote
 
  #2 (permalink)
Trading for Fun
Hungary
 
Futures Experience: Beginner
Platform: Sierra
Favorite Futures: ES
 
Posts: 72 since Nov 2014
Thanks: 118 given, 46 received


raghavan View Post
I am trying to call PlotShapes in C++ file. Here's the code.

AmiVar argPS[6];
argPS[0].type = VAR_FLOAT;
argPS[0].val = (float)1;
argPS[1].type = VAR_FLOAT;
argPS[1].val = (float)55;
argPS[2].val = EMPTY_VAL;
argPS[3].val = EMPTY_VAL;
argPS[4].val = EMPTY_VAL;
argPS[5].val = EMPTY_VAL;
gSite.CallFunction("PlotShapes", 6, argPS);

But, I dont see anny shapes being plotted in chart. May I know what I am missing here.

just a quess: try to set the unused params .type as well to VAR_FLOAT.

Reply With Quote
The following user says Thank You to JohniFx for this post:
 
  #3 (permalink)
Membership Temporarily Revoked
Zurich/Switzerland
 
Futures Experience: Advanced
Platform: -
Favorite Futures: -
 
Posts: 79 since Oct 2014
Thanks: 0 given, 33 received


Yes, you are missing something. You are passing float where you should be passing array as some arguments.

If you are a beginner then first read a book about C programming. AmiBroker's C/C++ development kit is rather recommended for advanced programmers.

Reply With Quote
 
  #4 (permalink)
Trading Apprentice
Bangalore + India
 
Futures Experience: Beginner
Platform: NinjaTrader, MetaTrader
Favorite Futures: Futures
 
Posts: 13 since Jan 2015
Thanks: 3 given, 2 received

By changing above code to, I got the shapes as required.

AmiVar argPS[6];
argPS[0].type = VAR_FLOAT;
argPS[0].val = (float)1;
argPS[1].type = VAR_FLOAT;
argPS[1].val = (float)55;
argPS[2].val = 0;
argPS[3].type = VAR_ARRAY;
argPS[3].array = gSite.GetStockArray(3);
argPS[4].val = EMPTY_VAL;
argPS[5].val = EMPTY_VAL;
gSite.CallFunction("PlotShapes", 6, argPS);


Last edited by raghavan; September 20th, 2015 at 12:18 PM.
Reply With Quote
The following user says Thank You to raghavan for this post:
 
  #5 (permalink)
Trading Apprentice
Bangalore + India
 
Futures Experience: Beginner
Platform: NinjaTrader, MetaTrader
Favorite Futures: Futures
 
Posts: 13 since Jan 2015
Thanks: 3 given, 2 received


prouser View Post
Yes, you are missing something. You are passing float where you should be passing array to some parameters.

If you are a beginner then first read a book about C programming. AmiBroker's C/C++ development kit is rather recommended for advanced programmers.

Passing float was not a problem. When scalar variable passed as argument to array variable, Amibroker internally converts scalar variables to array with scalar values set to all the array elements. Setting 3rd/4th argument helped printing shapes. Thanks though.!

Reply With Quote
The following user says Thank You to raghavan for this post:
 
  #6 (permalink)
Membership Temporarily Revoked
Zurich/Switzerland
 
Futures Experience: Advanced
Platform: -
Favorite Futures: -
 
Posts: 79 since Oct 2014
Thanks: 0 given, 33 received


raghavan View Post
By changing above code to, I got the shapes as required.

AmiVar argPS[6];
argPS[0].type = VAR_FLOAT;
argPS[0].val = (float)1;
argPS[1].type = VAR_FLOAT;
argPS[1].val = (float)55;
argPS[2].val = 0;
argPS[3].type = VAR_ARRAY;
argPS[3].val = gSite.GetStockArray(3);
argPS[4].val = EMPTY_VAL;
argPS[5].val = EMPTY_VAL;
gSite.CallFunction("PlotShapes", 6, argPS);

argPS[3].type = VAR_ARRAY;
argPS[3].val = gSite.GetStockArray(3);

This is wrong.

Reply With Quote
 
  #7 (permalink)
Trading Apprentice
Bangalore + India
 
Futures Experience: Beginner
Platform: NinjaTrader, MetaTrader
Favorite Futures: Futures
 
Posts: 13 since Jan 2015
Thanks: 3 given, 2 received


prouser View Post
argPS[3].type = VAR_ARRAY;
argPS[3].val = gSite.GetStockArray(3);

This is wrong.

Thanks for the correction. Edited code.

Reply With Quote
 
  #8 (permalink)
Membership Temporarily Revoked
Zurich/Switzerland
 
Futures Experience: Advanced
Platform: -
Favorite Futures: -
 
Posts: 79 since Oct 2014
Thanks: 0 given, 33 received


raghavan View Post
Passing float was not a problem. When scalar variable passed as argument to array variable, Amibroker internally converts scalar variables to array with scalar values set to all the array elements. Setting 3rd/4th argument helped printing shapes. Thanks though.!

So why has it not worked before then and why you have passed array in second try (as mentioned in post 3)?

Reply With Quote
 
  #9 (permalink)
Trading Apprentice
Bangalore + India
 
Futures Experience: Beginner
Platform: NinjaTrader, MetaTrader
Favorite Futures: Futures
 
Posts: 13 since Jan 2015
Thanks: 3 given, 2 received


prouser View Post
So why has it not worked before then and why you have passed array in second try (as mentioned in post 3)?

My Guess: Sometime setting EMPTY_VAL to default arguments is enough. Sometimes, it's required that we set some value to these arguments though they are optional arguments. I am also looking for clarity on this. Someone else here can throw some light

Reply With Quote
 
  #10 (permalink)
Membership Temporarily Revoked
Zurich/Switzerland
 
Futures Experience: Advanced
Platform: -
Favorite Futures: -
 
Posts: 79 since Oct 2014
Thanks: 0 given, 33 received


My question was a rhetorical one.

It's pretty obvious that you are a beginner. Get a programing book first & reading docs (if you haven't done so yet) otherwise your guesses will end up in disasters.

Reply With Quote

Reply



futures io > > > > Plotshapes in C++ dll

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
afl to dll sr114 AmiBroker 14 August 14th, 2016 05:07 AM
ELEXCEL.dll: Where to download arjfca EasyLanguage Programming 4 July 1st, 2015 08:13 AM
use dll with char flow12 TradeStation 0 August 7th, 2014 06:25 AM
Calling a C# dll in MultiCharts gomad MultiCharts 7 April 5th, 2013 11:43 AM


All times are GMT -4. The time now is 10:24 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-12 in 0.14 seconds with 19 queries on phoenix via your IP 54.90.92.204