Hi ,
this is what i have.Try to search on the forum i think there is more adaptiv moving average indicators here.
would you mind to post that system you want to make an EA for please.
i think you can change easy in the code what type of price should be used in calculation of AMA (high,low,close...)
AMA Double Cross
All I can give you are the parameters of the system at this time. It was backtested over 40 months on 15 minute bars on the GBPUSD and got $4.3 million in profit.
MAAXMAA - Price1 Low
MAAXMAA - EffRatioLength1 5
MAAXMAA - FastAvgLength1 17
MAAXMAA - SlowAvgLength1 10
MAAXMAA - Price High
MAAXMAA - EffRatioLength 6
MAAXMAA - FastAvgLength 5
MAAXMAA - SlowAvgLength 45
MAAXMAA - StartBal 20000
MAAXMAA - CommisPerMini Low 0
It was set to Buy and Sell on the crosses with no stops or take profit. Since TradeStation has no hedging within a currency pair, each Buy would close each Sell order and vise versa.
Price
DEEPDRUNK:
How will the following work for Price and does it also need to be written into the indicator separately?
//---- input parameters
extern int Price = 0; //Apply to Price(0-Close;1-Open;2-High;3-Low;4-Median price;5-Typical price;6-Weighted Close)
Thanks, Les
hi,
i don't know mq4 ,just a little but i think you should ask some expirienced coders like Codersguru (he also know tradestation easy lang) or linuxer,cja...
I don't know what are those setings from TS code.
Try to send PM (private message) to Codersguru because they could skip reading this thread.
You can also post the hole code from TS for AMA and they can translate it here.
TS Code for AMA Cross
DEEPDRUNK:
I wonder how you feel about translating TradeStation (EasyLanguage) into MQL4. Below is the TS code that I used.
begin
Inputs:
Price1( Low ),
EffRatioLength1( 5 ),
FastAvgLength1( 17 ),
SlowAvgLength1( 10 ),
Price( High ),
EffRatioLength( 6 ),
FastAvgLength( 5 ),
SlowAvgLength( 45 ),
StartBal( 20000 );
Vars:
MAA1( 0 ),
MAA( 0 ),
CurrentBal ( 20000 ),
NumMiniLots ( 1 );
MAA1 = AdaptiveMovAvg( Price1, EffRatioLength1, FastAvgLength1, SlowAvgLength1 ) ;
MAA = AdaptiveMovAvg( Price, EffRatioLength, FastAvgLength, SlowAvgLength ) ;
If MAA1 Crosses Under MAA Then
Buy NumMiniLots contracts Next Bar at market;
If MAA1 Crosses Over MAA Then
Sell Short NumMiniLots contracts Next Bar at market;
CurrentBal = 20000 + netprofit;
NumMiniLots = 1 + intportion ( CurrentBal/5000);
end
Trades were made on a standard account using full size lots limited to 100. There needs to be Maximum Risk configurable in the EA and the EA also needs to be Take Profit, Hard Stop and Trailing Stop capable. There is also supposed to be code associated with the AMA that allows it to optimize it's numerical values as it is in a live forward trading mode.
Thanks for your help. Les
I have attempted to attach the full report below.
Have noticed in your settings that FastAvgLength1( 17 ) is greater than SlowAvgLength1( 10 ).
I guess that it is not intended to use the indicator like that. Do you know what is the behaviour of the indicator in this case?
Fast Slow
In TradeStation these are often reversed by optimization and seem to be OK like this.
AMA new 30 Min 6 Mo Report
Here is a new TS report that got $768K in 6 months on 30 minute bars. Numbers don't hold up on longer time frames, but can be obtained through optimization.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Does anyone have an Adaptive Moving Average with PRICE input (High, Low, etc.)? Am working on a promising double AMA cross Expert Advisor optimized in TradeStation. Thanks for your help. Les