Skip to content

Instantly share code, notes, and snippets.

@SyncHack
Created April 25, 2017 11:41
Show Gist options
  • Save SyncHack/9c8c26a6e024d219b6550a8338abd4f3 to your computer and use it in GitHub Desktop.
Save SyncHack/9c8c26a6e024d219b6550a8338abd4f3 to your computer and use it in GitHub Desktop.
窓開け・窓閉めインジケーター (※レーダースクリーン専用)
{
窓開け・窓閉めインジケーター (※レーダースクリーン専用)
v 0.1.0
Makoto NARA (Mc.N)
}
vars:
int base_color(0),
string base_str(""),
double gap_winp(0),
double gap_par(0),
double open_par(0);
consts:
string STR_GAPWIN("ギャップ窓"),
string STR_GAPWINP("ギャップ窓%"),
string STR_GWUP("↑窓"),
string STR_GWDW("↓窓"),
string STR_GAPP("ギャップ%"),
string STR_OPENP("始値%");
// PLOT1
if High[1] < Low[0] then begin
base_color = UpColorDefault;
base_str = STR_GWUP;
gap_winp = (Low[0]-High[1])/High[1];
end else if Low[1] > High[0] then begin
base_color = DownColorDefault;
base_str = STR_GWDW;
gap_winp = (High[0]-Low[1])/Low[1];
end else begin
base_color = UpColorDefault;
base_str = "";
gap_winp = 0;
end;
Plot1(base_str, STR_GAPWIN, base_color);
// PLOT2
if gap_winp<>0 then begin
Plot2(gap_winp,STR_GAPWINP,base_color);
end else begin
NoPlot(2);
end;
gap_par = ( Open[0] - Close[1] ) / Close[1];
open_par = ( Close[0] - Open[0] ) / Open[0];
Plot3( gap_par, STR_GAPP, IFF(gap_par<0, DownColorDefault, UpColorDefault) );
Plot4( open_par, STR_OPENP, IFF(open_par<0, DownColorDefault, UpColorDefault) );
{
Copyright (c) 2017, Makoto NARA (Mc.N)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment