stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

An unhijacked helper for Evaluator's SAFT trading system
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=768
Page 3 of 6
Author:  fx800 [ Mon Aug 27, 2012 9:06 am ]
Post subject:  Re: An unhijacked helper for Evaluator's SAFT trading system

Today is BANK HOLIDAY in the UK. So no proper testing till tomorrow.
Author:  MickyMouse [ Mon Aug 27, 2012 10:09 am ]
Post subject:  Re: An unhijacked helper for Evaluator's SAFT trading system

fx8000 wrote:Hi MickyMouse

Your OBV_MA indi draws only part of 21 LWMA (top)

The bottom indi is produced by dragging moving average onto the obv window.

Cheers,
Peter
you are right, sorry about that , i made it and compiled while on chart , and it was showing for me .
Anyways, use the attached one, will update the ma as well.
Author:  fx800 [ Mon Aug 27, 2012 10:12 am ]
Post subject:  Re: An unhijacked helper for Evaluator's SAFT trading system

MickyMouse wrote:
fx8000 wrote:Hi MickyMouse

Your OBV_MA indi draws only part of 21 LWMA (top)

The bottom indi is produced by dragging moving average onto the obv window.

Cheers,
Peter
you are right, sorry about that , i made it and compiled while on chart , and it was showing for me .
Anyways, use the attached one, will update the ma as well.

Many thanks. Will try out the new indi.

Cheers,
Peter
Author:  NeoTrader [ Mon Aug 27, 2012 11:37 am ]
Post subject:  Re: An unhijacked helper for Evaluator's SAFT trading system

hi fx8000,
fx8000 wrote:Your OBV_MA indi draws only part of 21 LWMA (top)

The bottom indi is produced by dragging moving average onto the obv window.
I experience the same Problem.

I Think this is a Empty4 Problem...it seems it does not like to use the iMAOnArray on any Indicator Buffer.
I experienced the same Problem when I developed the TMA & MA cross Rule for my Indicator.
Thats why I use a separate array in my code snippet above...

See attachment for a working version...
have also added maxBar Feature and MAMode to select the Mode you want (Default is LWMA)


happy trading,

NeoTrader

---
Author:  fx800 [ Mon Aug 27, 2012 11:48 am ]
Post subject:  Re: An unhijacked helper for Evaluator's SAFT trading system

NeoTrader wrote:hi fx8000,
fx8000 wrote:Your OBV_MA indi draws only part of 21 LWMA (top)

The bottom indi is produced by dragging moving average onto the obv window.
I experience the same Problem.

I Think this is a Empty4 Problem...it seems it does not like to use the iMAOnArray on any Indicator Buffer.
I experienced the same Problem when I developed the TMA & MA cross Rule for my Indicator.
Thats why I use a separate array in my code snippet above...

See attachment for a working version...
have also added maxBar Feature and MAMode to select the Mode you want (Default is LWMA)


happy trading,

NeoTrader

---
Hi NeoTrader

Thanks. The OBV_MA_2 works for me.

Cheers,
Peter
Author:  SteveHopwood [ Mon Aug 27, 2012 2:13 pm ]
Post subject:  Re: An unhijacked helper for Evaluator's SAFT trading system

NeoTrader wrote:hi Steve,
SteveHopwood wrote:I have replaced the OBV trendline with the moving average. There is a problem with this, in that I have not found a way to code calls to the Moving Average indi in such a way that it will return the MA of the OBV indi. Instead, I have replaced the lwma on my OBV with a simple ma, and hand-coded the mo calculation. The result of this calculation appears to be out by a few points, so anybody with more accurate code, please sing out.
The following is not a tested code...i just put it together...to show you the concept...this should work...to combine your obv with an MA.

If you have any question feel free to ask here or via PM.

Code: Select all

double obvArray[];
double maCurrent;

ArrayResize(obvArray, MAPeriod + 1);
ArraySetAsSeries(obvArray, true );

for ( j = 0; j <= MAPeriod + 1; j++ ) {
obvArray[j] = iCustom (your call to get the obv, use j for the shift )

// will give you the current MA value for the obv
maCurrent = iMAOnArray( obvArray, 0, MAPeriod, 0, MAMode, 0 ); 
}

hope this helps.

happy trading,

NeoTrader
Thanks NT. It works beautifully. I have linked your indi in post 1.

V 1e is in post 1, with NT's code for calculating the lwma of obv.

I have added code to make the ea change the trend line colour to TradedLineColour once it has sent a trade. This is to allow us to leave the ea in charge without worrying that it might close/find a trade has closed, then trade again if conditions are right. If you want this, then change it to the same colour as that of the trading trendline.

I am not sure that the tp/sl calculations are correct yet.

:D
Author:  fx800 [ Mon Aug 27, 2012 2:44 pm ]
Post subject:  Re: An unhijacked helper for Evaluator's SAFT trading system

SteveHopwood wrote:
NeoTrader wrote:hi Steve,
SteveHopwood wrote:I have replaced the OBV trendline with the moving average. There is a problem with this, in that I have not found a way to code calls to the Moving Average indi in such a way that it will return the MA of the OBV indi. Instead, I have replaced the lwma on my OBV with a simple ma, and hand-coded the mo calculation. The result of this calculation appears to be out by a few points, so anybody with more accurate code, please sing out.
The following is not a tested code...i just put it together...to show you the concept...this should work...to combine your obv with an MA.

If you have any question feel free to ask here or via PM.

Code: Select all

double obvArray[];
double maCurrent;

ArrayResize(obvArray, MAPeriod + 1);
ArraySetAsSeries(obvArray, true );

for ( j = 0; j <= MAPeriod + 1; j++ ) {
obvArray[j] = iCustom (your call to get the obv, use j for the shift )

// will give you the current MA value for the obv
maCurrent = iMAOnArray( obvArray, 0, MAPeriod, 0, MAMode, 0 ); 
}

hope this helps.

happy trading,

NeoTrader
Thanks NT. It works beautifully. I have linked your indi in post 1.

V 1e is in post 1, with NT's code for calculating the lwma of obv.

I have added code to make the ea change the trend line colour to TradedLineColour once it has sent a trade. This is to allow us to leave the ea in charge without worrying that it might close/find a trade has closed, then trade again if conditions are right. If you want this, then change it to the same colour as that of the trading trendline.

I am not sure that the tp/sl calculations are correct yet.

:D
Thank you, Steve. Will start testing tomorrow.

Peter
Author:  fx800 [ Mon Aug 27, 2012 3:29 pm ]
Post subject:  Re: An unhijacked helper for Evaluator's SAFT trading system

Hi Steve

Shouldn't the AvObv in the following code be replaced by ObvMa ?

//Long trade
//Trendline colour
if (!TradeLong) SendLong = false;
//OBV
if (ObvVal <= AvObv) SendLong = false;

Cheers,
Peter
Author:  SteveHopwood [ Mon Aug 27, 2012 3:48 pm ]
Post subject:  Re: An unhijacked helper for Evaluator's SAFT trading system

fx8000 wrote:Hi Steve

Shouldn't the AvObv in the following code be replaced by ObvMa ?

//Long trade
//Trendline colour
if (!TradeLong) SendLong = false;
//OBV
if (ObvVal <= AvObv) SendLong = false;

Cheers,
Peter
Nope.

:D
Author:  fx800 [ Mon Aug 27, 2012 3:54 pm ]
Post subject:  Re: An unhijacked helper for Evaluator's SAFT trading system

SteveHopwood wrote:
fx8000 wrote:Hi Steve

Shouldn't the AvObv in the following code be replaced by ObvMa ?

//Long trade
//Trendline colour
if (!TradeLong) SendLong = false;
//OBV
if (ObvVal <= AvObv) SendLong = false;

Cheers,
Peter
Nope.

:D
My sincere apologies.

Peter
All times are UTC Page 3 of 6