NexusFi: Find Your Edge


Home Menu

 





code with Chaikin oscillator


Discussion in MultiCharts

Updated
    1. trending_up 1,623 views
    2. thumb_up 0 thanks given
    3. group 1 followers
    1. forum 0 posts
    2. attach_file 0 attachments




 
Search this Thread

code with Chaikin oscillator

  #1 (permalink)
streghetta
Venice + Italy
 
Posts: 2 since Sep 2015
Thanks Given: 0
Thanks Received: 0

Hello!
i'm a female student and i'm preparing my thesis for the university. The professor asked me to write a code in multicharts. The purpose is to create a system with management technique of opening and closing operations, and in particular I have to study the divergences and therefore I need:
- an array in which, for the bearish position, there are 2 maximum and 1 minimum respectively surrounded by two lower maximum and two minimum respectively;
- the condition that if the max2> max1 and (max2 indicator)<(max1 indicator )
* then i go short if last price is below the minimum
* and I have a stop loss above the max2, once opened the position;
- the indicator i have to use is Chaikin Oscillator

I tryed to write this code but i need a correction of it. i attack it here if someone can help me:
// ARRAY
[IntrabarOrderGeneration = true]

variables: m(1), j(0), n(0), dati[m,2] ;

array: int A_MAX[m][n];

while m <> number_row(dati) begin

while j = 0
m=m+1;
if (dati[m,2]> dati[(m-1),2] AND dati[(m-1),2)> dati[(m-2),2] AND dati[m,2]> dati[(m+1),2]
AND dati[(m+1),2]> dati[(m+2),2]) then begin
n = n+1;
A_MAX[1][n] = dati[m;2];
j = 1;
end;

while j = 0
m=m+1;
if (dati[m,2]< dati[(m-1),2] AND dati[(m-1),2]< dati[(m-2),2] AND dati[m,2]< dati[(m+1),2]
AND dati[(m+1),2]< dati[(m+2),2]) then begin
n = n+1;
A_MAX[2][n] = dati[m;2];
j = 1;
end;

while j = 0
m=m+1;
if (dati(m,2]> dati[(m-1),2] AND dati[(m-1),2]> dati[(m-2),2] AND dati[m,2]> dati[(m+1),2]
AND dati[(m+1),2]> dati[(m+2),2]) then begin
n = n+1;
A_MAX[3][n] = dati[m;2];
j = 1;
end;
end




// CODE
INPUTS: MYVOL(VOLUME), FAST(3), SLOW(10);

PLOT1(CHAIKINOSC(MYVOL, FAST, SLOW) , "CHAIKIN" );

PLOT2(0 ,"ZERO");



{ALERT CRITERIA}

IF A_MAX[3][n]>A_MAX[1][n] AND CHAIKINOSC(A_MAX[1][n])>CHAIKINOSC(A_MAX[3][n]) THEN BEGIN

SELLSHORT NEXT BAR AT CLOSE(A_MAX[2][n]);

ALERT("A BEARISH DIVERGENCE HAS BEEN DETECTED");

END;

ELSE

IF A_MIN[3][n]>A_MIN[1][n] AND CHAIKINOSC(A_MIN[1][n])>CHAIKINOSC(A_MIN[3][n]) THEN BEGIN

BUY NEXT BAR AT CLOSE(A_MIN[2][n]);

ALERT("A BULLISH DIVERGENCE HAS BEEN DETECTED");

END

Many many thanks to all can help me!

Reply With Quote




Last Updated on September 28, 2015


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts