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


Array size of each candle/bar in amibroker ? with working C code
Started: by fxtraders Views / Replies:170 / 0
Last Reply: 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

  #1 (permalink)
Trading Apprentice
connaught, DL
 
Futures Experience: Intermediate
Platform: Ninjatrader,amibroker
Favorite Futures: future,currency
 
Posts: 11 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 > > > > 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: Tips and Tricks (part 2)

Mar 2
 

An Afternoon With FIO member @michaelleemoore

Elite only
 

Jigsaw Trading: Keys to successfully trading the open

Mar 9

Macro view: Trump Market Risk w/Piers Curran @ Amplify Trading

Elite only

Reading the Psychology of the Market w/Brett Steenbarger & Trading Technologies

Elite only

Hybrid Machine Learning (R and TradeStation) w/Murray Ruggiero

Elite only

Spring Grains Outlook w/Sean Lusk @ Walsh Trading

Elite only
     

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 03:45 PM.

no new posts
Page generated 2017-02-24 in 0.05 seconds with 19 queries on phoenix via your IP 54.146.184.210