|
|||||||
| Register in Forex TSD! | |
|
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time). Click here to register and get more information |
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Buff MA - help to code(translate) it
Hi,
as I'm not well-versed in MT4 coding I need help with a simple formula called Buff MA; I've the corresponding formula in Metastock language as the following one: BUFF:=Sum(V*C, 32) / (Cum(V) - Ref( Cum(V), -32)); BUFF If someone could compile it for MT4 I'd be glad. Buff MA helps in determining the most probable side to trade... when price is above Buff and aligned with it* only long positions are allowed... viceversa for short ones. *(that's if Buff and price both are upward it's OK to be long... viceversa for shorting) Thanks a lot ontherun ps: I've been looking for the Sum() and Cum() corresponding functions in the MetaEditor but I've not found anything related to those functions... |
|
|||
|
Ralph,
thanks for taking time to answer me. Your understanding of the formula I've posted is right and actually it could be written simpler, that's: BUFF:= Sum(V*C, 32) / Sum(V,32); Anyway I've created a new indicator with your code but even if it compiled without errors it didn't plot anything. below is the whole script I've written for the Buff MA: PHP Code:
Last edited by ontherun : 09-11-2007 at 08:34 AM. |
|
||||
|
no, right; it will need to compute the value relative to prior bars, and assign BUFF with the values.... like
PHP Code:
Last edited by ralph.ronnquist : 09-11-2007 at 09:53 AM. |
|
|||
|
Michel,
thanks for answering. The Buff formula with your modification plots correct as for the calculated values (I compare them to those plotted by the Buff in Metastock) but it doesn't update... that's it stops plotting just at the bar developing the moment I attach it to the chart. ontherun |
|
|||
|
You are right, so please try this code which should be the right way to code this kind of indic (I am not able to check it myself now):
PHP Code:
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| translate easyLanguage in MT3 or MT4 | gbolla | Metatrader 3 | 30 | 07-03-2008 08:21 PM |
| What does this code mean? | matrixebiz | Expert Advisors - Metatrader 4 | 3 | 09-01-2007 10:38 AM |
| How to code this? | iscuba11 | Metatrader 4 mql 4 - Development course | 1 | 08-03-2007 04:22 PM |
| Please translate my idea Indonesian to english version | harryhid | Expert Advisors - Metatrader 4 | 4 | 10-18-2006 09:59 AM |