Array size of each candle/bar in amibroker ? with working C code - AmiBroker | futures.io
futures.io futures trading
 

Go Back   futures.io

> Futures Trading, News, Charts and Platforms > Platforms and Indicators > AmiBroker


Array size of each candle/bar in amibroker ? with working C code
Started:October 24th, 2016 (08:03 AM) by fxtraders Views / Replies:102 / 0
Last Reply:October 24th, 2016 (08:03 AM) Attachments:0

Welcome to futures.io.

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • 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, and we will never resell your private information.

-- Big Mike
     

Reply
 
Thread Tools Search this Thread

Array size of each candle/bar in amibroker ? with working C code

Old October 24th, 2016, 08:03 AM   #1 (permalink)
Trading Apprentice
connaught, DL
 
Futures Experience: Intermediate
Platform: Ninjatrader,amibroker
Favorite Futures: future,currency
 
Posts: 9 since Sep 2016
Thanks: 1 given, 0 received

Array size of each candle/bar in amibroker ? with working C code

As you might know, amibroker is similar to C .. that's what I've been told ..

Below C code count number of digits.
C program that count size of array. 2 to <10 . .array size: 8
I've no idea , how to do it in amibroker ?even though it's similar to C , belowcode
is C program

 
Code
#include <stdio.h>
    int main(){
    long n;
    int count = 0;
    int m[10],i;

    for( i = 2; i < 10 ; i++ )
    {
        n /= 10;
        ++count;
        m[i]=i+1;
        printf("m[%d]= %d\n",i+1,m[i]);

    }

    printf("Counting number of digits: %d", count);
    }

Output(click on link): https://ideone.com/fP2boO

Below code need to get correct:
Solution suggested by X person:
You have to sum via VarSet/VarGet. That one is done in the nested loop. Then the result is called in second loop
or
you store the increment calculation to a table (either via varset/varget or matrix).
Then that table can be called from outside your nested loop.


 
Code

SetBarsRequired(-2,-2);
Plot( C, ""+Interval(2), styleCandle );
for( i = 1; i <4 ; i++ )
{
   TimeFrameSet(i*in1Minute );
   rs = RSI(14);
   TimeFrameRestore();
   VarSet( "M"+ i, TimeFrameExpand( rs, i*in1Minute , expandPoint ) );
M = VarGet( "M" + i );

   for( b = 0; b < BarCount; b++ )
    {
if(M[b] )   PlotText(" "+(i), b, L[b]-1-(i), colorAqua);
}
}
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );SetBarsRequired(-2,-2);


/*
shape2 = 0;
shape3 = 0;
for( b = 0; b < BarCount; b++) {// visible chart area loop
  
getvar = ....;
    switch( getvar  ) {
        case 2: ....
  
        case 3: ....

            default: break;
    }                  
}      

PlotShapes( shape2 * shapeSmallCircle, colorWhite, 0, L, n*-35 );
PlotShapes( shape3 * shapeSmallCircle, colorYellow, 0, L, n*-35 );
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


NEED OUTPUT LIKE UPPER PICTURE..

3x means 3 times ..
2x means 2 times ..
Yes , i haven't written all 2x and 3x ..

What do i need to add to make it work like upper picture?


Last edited by fxtraders; October 24th, 2016 at 08:13 AM.
Reply With Quote
     

Reply



futures.io > Futures Trading, News, Charts and Platforms > Platforms and Indicators > AmiBroker > Array size of each candle/bar in amibroker ? with working C code

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

NinjaTrader 8: Features and Enhancements, Tips and Tricks

Dec 6
 

Al Brooks: Stop Losing when a Good Trade goes Bad, Correcting Mistakes

Elite only
 

Trading Technologies: Algo Design Lab hands-on

Dec 13
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Does Anyone Code Both Amibroker and TOS? Zephyr ThinkOrSwim Programming 5 December 7th, 2015 11:48 AM
Metastock to Amibroker Code rshor AmiBroker 2 July 16th, 2014 01:43 PM
Bar Score Over N Bars; Array Question aventeren NinjaTrader Programming 8 June 21st, 2013 02:40 PM
How do I determine what size range bar is comparable to a daily bar? Trankuility Traders Hideout 14 January 15th, 2012 11:46 AM
Candle size indicator PedroMAN NinjaTrader 4 August 14th, 2011 06:27 PM


All times are GMT -4. The time now is 06:07 AM.

Copyright © 2016 by 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 2016-12-06 in 0.06 seconds with 19 queries on phoenix via your IP 54.158.157.24