過去50バーの最高値
7件の返信
how would i go about coding “highest close in the past 50 days” ?
0
You will need to use a little “hack” here. Try 関数 → Indicator Highest Value and set period = 50 -> select Simple Moving Average, set period = 1 and Apply To = 閉じる
0
like this ??
i have applied the “lookback” variable so i can change it but its set to 50 now
0
On the right side set period to 1 instead of Lookback
0
Hi, this is very good idea, but I can’t set SMA period to 1. EA Wizard don’t allow to set period number in moving avarages smaller than 2. Could you check that?
0
yes, you are right, it won’t accept 1 as a MA period
you will probably need to add a new function into CustomFunctions.mq4 placed in /code/ folder. The code could be:
double getHighestClose(int period) { // name of the function with parameter
double highest = 0; // init variable to store highest value
for (int i = 1; i highest) highest = Close[i]; // check if currect bar close is greater than highest stored in "highest" variable
}
return(highest); // function will return calculated value
}
Then you can use this function in Wizard like it’s shown on screenshot attached
0
Thank you, I’m going to test that.
0
こんにちは、,
to run a moving averages smaller than 2,,,
1. set “MA_Var” int = 1
2, use “MA_Var” as the period of the moving averages instead
yes.. if you tries to use “2”, EA Wizard will not accept.. this is a workaround.
0
7件の返信を表示中 - 1 - 7件目 (全7件中)