Simple Coding Help - No Promise.

Raj232

Well-Known Member
Dear Friends & coders,

Please help with code to place and order into NEST trader using Excel.
A colleague has done this in my office but will not share with anyone.
Both NEST and Excel program needs to be open, excel macros need to be enabled. Also it seems that NEST folder must be trusted in Excel macros location (trust /security).

Here there is NO need to activate NEST PLUS. it places BUY and SELL orders directly into NEST program as per macros calculating the BUY/SELL.

Thanks in advance !
If one of my colleagues have it, it is definitely possible. :):):)
 

cloudTrader

Well-Known Member
Take a look at PlotOHLC() and styleCloud. Examples are provided in the Users Guide.
I tried forming the code but as basically I have not been into coding at all, the result which came was not good. Can't really reach the destination. :eek:
Please have a look at the code and modify it to work.

Thanks.

Code as I was able to generate

Code:
_SECTION_BEGIN("ADX");
GraphXSpace=20;
range = Param("Periods", 8, 2, 200, 1 );
Color = IIf(ROC(ADX(range),1) > 0, colorCustom11,colorBlue);
Plot( ADX(range), _DEFAULT_NAME(), Color , ParamStyle("ADX style", styleThick ) );
Plot( PDI(range), "+DI", ParamColor( "+DI color", colorBrightGreen), styleLine );
Plot( MDI(range), "-DI", ParamColor( "-DI color", colorRed ), styleLine  );
DIHigh = PDI(range);
DILow =  MDI(range);
IIf(DIHigh > DILow,PlotOHLC( Open,DIHigh,DILow,Close,"",colorBrightGreen,styleCloud),
PlotOHLC(Open,DILow,DIHigh,Close,"",colorRed,styleCloud));

_SECTION_END();

Image attached underneath to depict the resultant

 

HappyLife

Well-Known Member
I tried forming the code but as basically I have not been into coding at all, the result which came was not good. Can't really reach the destination. :eek:
Please have a look at the code and modify it to work.

Thanks.

Code as I was able to generate

Code:
_SECTION_BEGIN("ADX");
GraphXSpace=20;
range = Param("Periods", 8, 2, 200, 1 );
Color = IIf(ROC(ADX(range),1) > 0, colorCustom11,colorBlue);
Plot( ADX(range), _DEFAULT_NAME(), Color , ParamStyle("ADX style", styleThick ) );
Plot( PDI(range), "+DI", ParamColor( "+DI color", colorBrightGreen), styleLine );
Plot( MDI(range), "-DI", ParamColor( "-DI color", colorRed ), styleLine  );
DIHigh = PDI(range);
DILow =  MDI(range);
IIf(DIHigh > DILow,PlotOHLC( Open,DIHigh,DILow,Close,"",colorBrightGreen,styleCloud),
PlotOHLC(Open,DILow,DIHigh,Close,"",colorRed,styleCloud));

_SECTION_END();

Image attached underneath to depict the resultant

open Ichimoku from ami copy last 2 line …… add & edit (Sp1 & sp2 with Pdi & Mdi) as per your need.

now simple query why you need this cloud style plotting …… what extra help it will provide.
 
Last edited:

cloudTrader

Well-Known Member
open Ichimoku from ami copy last 2 line …… add & edit (Sp1 & sp2 with Pdi & Mdi) as per your need.

now simple query why you need this cloud style plotting …… what extra help it will provide.
First of all thanks HappyLife .. for the important clue.

Actually I saw this kind of ADX plotting in a chart example which I liked from visual point of view. I wanted to incorporate it in the same way in Amibroker. I look at ADX for just assisting my price action decision making.

Thanks.
 
I tried forming the code but as basically I have not been into coding at all, the result which came was not good. Can't really reach the destination. :eek:
Please have a look at the code and modify it to work.

Thanks.

Code as I was able to generate

Code:
_SECTION_BEGIN("ADX");
GraphXSpace=20;
range = Param("Periods", 8, 2, 200, 1 );
Color = IIf(ROC(ADX(range),1) > 0, colorCustom11,colorBlue);
Plot( ADX(range), _DEFAULT_NAME(), Color , ParamStyle("ADX style", styleThick ) );
Plot( PDI(range), "+DI", ParamColor( "+DI color", colorBrightGreen), styleLine );
Plot( MDI(range), "-DI", ParamColor( "-DI color", colorRed ), styleLine  );
DIHigh = PDI(range);
DILow =  MDI(range);
IIf(DIHigh > DILow,PlotOHLC( Open,DIHigh,DILow,Close,"",colorBrightGreen,styleCloud),
PlotOHLC(Open,DILow,DIHigh,Close,"",colorRed,styleCloud));

_SECTION_END();

Image attached underneath to depict the resultant

You have some coding errors including not using IIF() right (check Help: Common coding mistakes in AFL). Here is a code that does what I think you want:

_SECTION_BEGIN( "ADX" );
GraphXSpace = 20;
range = Param( "Periods", 8, 2, 200, 1 );
Color = IIf( ROC( ADX( range ), 1 ) > 0, colorCustom11, colorBlue );

Plot( ADX( range ), _DEFAULT_NAME(), Color , ParamStyle( "ADX style", styleThick ) );
Plot( PDI( range ), "+DI", ParamColor( "+DI color", colorBrightGreen ), styleLine );
Plot( MDI( range ), "-DI", ParamColor( "-DI color", colorRed ), styleLine );

DIHigh = PDI( range );
DILow = MDI( range );

PlotOHLC( DIHigh, DIHigh, DILow, DILow, "", IIf( DIHigh >= DILow, colorBrightGreen, colorRed ), styleCloud );
_SECTION_END();
 

Attachments

cloudTrader

Well-Known Member
You have some coding errors including not using IIF() right (check Help: Common coding mistakes in AFL). Here is a code that does what I think you want:

_SECTION_BEGIN( "ADX" );
GraphXSpace = 20;
range = Param( "Periods", 8, 2, 200, 1 );
Color = IIf( ROC( ADX( range ), 1 ) > 0, colorCustom11, colorBlue );

Plot( ADX( range ), _DEFAULT_NAME(), Color , ParamStyle( "ADX style", styleThick ) );
Plot( PDI( range ), "+DI", ParamColor( "+DI color", colorBrightGreen ), styleLine );
Plot( MDI( range ), "-DI", ParamColor( "-DI color", colorRed ), styleLine );

DIHigh = PDI( range );
DILow = MDI( range );

PlotOHLC( DIHigh, DIHigh, DILow, DILow, "", IIf( DIHigh >= DILow, colorBrightGreen, colorRed ), styleCloud );
_SECTION_END();
Thanks a ton Colion for your humble gesture. :clapping:

No background of technical or coding aspects in my stream of education indeed hinders me a lot in trying new ideas even if they come into effect in my thought process.

Regards.
 
Hello
Is it possible to add an average 50 (TriangularMA)
To the index Accumulation Swing Index
With explor OR SCAN (BUY-SELL)
If the Indicator (ASI) breached average (TriangularMA 50)
Or breakage
thank you


AFL

_SECTION_BEGIN("asi+ma50");
function SwingIndex( Limit )
{
Hy = Ref( H, -1 );
Cy = Ref( C, -1 );
Ly = Ref( L, -1 );
Oy = Ref( O, -1 );

r1 = abs( H - Cy );
r2 = abs( L - Cy );
r3 = abs( H - L );
r4 = abs( Cy - Oy );

k = Max( r1, r2 );

r = IIf( r1 >= Max( r2, r3 ), r1 - r2 / 2 + r4 / 4,
IIf( r2 >= Max( r1, r3 ), r2 - r1 / 2 + r4 / 4,
r3 + r4 / 4 ) );

return IIf( r == 0, 0, 50 * ( ( C - Cy + 0.5 * ( C - O ) + 0.25 * ( Cy - Oy ) ) / r ) * k / Limit );
}

function AccumulationSwingIndex( Limit )
{
return Cum( SwingIndex( Limit ) );
}

index = AccumulationSwingIndex( Param( "Limit", 100, 1, 1000 ) );
Plot( index, _DEFAULT_NAME(), ParamColor( "Color", colorRed ) );
Plot( MA( index, 50), "MA-50", colorWhite );
_SECTION_END();
 

Similar threads