2 registered members (dr_panther, 7th_zorro),
1,203
guests, and 2
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Super Signal
#418359
02/24/13 04:19
02/24/13 04:19
|
Joined: Nov 2012
Posts: 209
SFF
OP
Member
|
OP
Member
Joined: Nov 2012
Posts: 209
|
Hi, I have no idea how to code it in Zorro. Could you help me?
hhb = iHighest(NULL, 0, MODE_HIGH, dist, i - dist / 2);
llb = iLowest(NULL, 0, MODE_LOW, dist, i - dist / 2);
The origianal code is found here. http://hot-fx.blogspot.com
|
|
|
Re: Super Signal
[Re: TankWolf]
#418362
02/24/13 04:46
02/24/13 04:46
|
Joined: Nov 2012
Posts: 209
SFF
OP
Member
|
OP
Member
Joined: Nov 2012
Posts: 209
|
You can download it here. http://hot-fx.blogspot.jp/2012/03/ufs-forex.html
//+------------------------------------------------------------------+
//| super-signals.mq4 |
//| Copyright ゥ 2006, Nick Bilak, beluck[AT]gmail.com |
//|------------------------------------------------------------------|
//|Added sound,if signal direction changes SuperSignalsHotFxMOD.mq4 |
//|2012.03.20, HotFx, http://hot-fx.blogspot.com http://hotfx.0pk.ru |
//+------------------------------------------------------------------+
#property copyright "Copyright ゥ 2006, Nick Bilak"
#property link "http://www.forex-tsd.com/"
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_width1 2
#property indicator_color2 Blue
#property indicator_width2 2
extern int dist = 24;
extern int SignalGap = 4;
extern string SoundEntry = "news.wav";
double b1[], b2[], cur = 0;
int init()
{
SetIndexStyle(0, DRAW_ARROW, STYLE_SOLID, 1); SetIndexArrow(0, 234); SetIndexBuffer(0, b1);
SetIndexStyle(1, DRAW_ARROW, STYLE_SOLID, 1); SetIndexArrow(1, 233); SetIndexBuffer(1, b2);
}
int start()
{
int i, hhb, llb, counted_bars = IndicatorCounted();
if (counted_bars > 0) counted_bars--;
for (i = Bars - 1 - counted_bars; i >= 0; i--)
{
hhb = iHighest(NULL, 0, MODE_HIGH, dist, i - dist / 2);
llb = iLowest(NULL, 0, MODE_LOW, dist, i - dist / 2);
if (i == hhb)
{
if (SoundEntry != "" && cur != -1 && i <= dist) PlaySound(SoundEntry);
b1[i] = High[hhb] + SignalGap * Point; cur = -1;
}
if (i == llb)
{
if (SoundEntry != "" && cur != 1 && i <= dist) PlaySound(SoundEntry);
b2[i] = Low[llb] - SignalGap * Point; cur = 1;
}
}
}
Last edited by SFF; 02/27/13 11:33.
|
|
|
Re: Super Signal
[Re: jcl]
#418605
02/27/13 10:28
02/27/13 10:28
|
Joined: Nov 2012
Posts: 209
SFF
OP
Member
|
OP
Member
Joined: Nov 2012
Posts: 209
|
HH and LL only takes one parameter. Where to insert this line? i - dist / 2 Is this indentical to the above code?
vars hhb = series(HH(dist));
vars llb = series(LL(dist));
var newh = hhb + i - dist / 2;
var newl = llb + i - dist / 2;
Last edited by SFF; 02/27/13 10:33.
|
|
|
Re: Super Signal
[Re: jcl]
#418610
02/27/13 11:31
02/27/13 11:31
|
Joined: Nov 2012
Posts: 209
SFF
OP
Member
|
OP
Member
Joined: Nov 2012
Posts: 209
|
Thanks. I just wrote this code and it looks fine and is identical to the original. What do you think?
int i, dist;
vars high = series(priceHigh(i - dist / 2));
MaxVal(high,dist);
vars low = series(priceLow(i - dist / 2));
MinVal(low,dist);
|
|
|
Re: Super Signal
[Re: SFF]
#418611
02/27/13 11:42
02/27/13 11:42
|
Joined: Nov 2012
Posts: 209
SFF
OP
Member
|
OP
Member
Joined: Nov 2012
Posts: 209
|
I codeed this but it says Error 045: Negative price offset at bar 1. What do it mean?
function run(){
int dist = 24;
vars high = series(priceHigh(0 - dist / 2));
var lasthigh = MaxVal(high,dist);
vars low = series(priceLow(0 - dist / 2));
var lastlow = MinVal(low,dist);
if(priceHigh(0) == lasthigh)
enterShort();
if(priceLow(0) == lastlow)
enterLong();
}
|
|
|
|