Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 32 additions & 8 deletions Ichi Moku.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ true==function()
[ih][1].history=true;
}

function ichi_moku(tenkan_period, kijun_period)
function ichi_moku(tenkan_period, kijun_period, span_B_period)
{
let len = [ih].length-1;
if ( len <= kijun_period) return;
for ( let i=0 ; i<len-kijun_period ; i++ )
if ( len <= span_B_period) return;
for ( let i=0 ; i<len-span_B_period ; i++ )
{
let highest = 0;
let lowest = 1000000;
Expand All @@ -60,19 +60,43 @@ true==function()
{
highest = [ih][j].PriceMax;
highest_candle = j ;
}
}
}
[ih][i].kijun = (highest + lowest)/2;
[ih][i].highest_candle = highest_candle;
[ih][i].lowest_candle = lowest_candle;
highest = 0;
lowest = 1000000;
highest_candle = 0;
lowest_candle = 0;
for ( let j=i ; j<i+span_B_period ; j++)
{
if (lowest > [ih][j].PriceMin)
{
lowest = [ih][j].PriceMin;
lowest_candle = j;
}
if ( highest < [ih][j].PriceMax)
{
highest = [ih][j].PriceMax;
highest_candle = j ;
}
[ih][i].span_B = (highest + lowest)/2;
[ih][i].span_A = ([ih][i].tenkan + [ih][i].kijun)/2;
[ih][i].highest_candle = highest_candle;
[ih][i].lowest_candle = lowest_candle;

}
}
}
ichi_moku(9, 26);

ichi_moku(9, 26, 52);

if ( (l18)=="فولاد")
{
(cfield1)="Tenkan = "+String([ih][0].tenkan);
(cfield2)="Kijun = "+ String([ih][0].kijun);
return true;
}

}()

}()