CCI ,200 SMA & LinearRegression Slope Pullback Strategy

Posted By: Materz

CCI ,200 SMA & LinearRegression Slope Pullback Strategy - 10/31/18 09:11

Dear All,
I have the following problem with my strategy .
1. I did developed a strategy [ Check below ], the strategy opens only one asset namely USD/CHF for
about three months.

Strategy
enter long trade when the CCI is below -100 , LinearRegression_Slope is greater than 0 , Price is above 200 ZMA & T3 200 ,close when CCI is above //180,reverse is true for Sell .

the strategy opens lot size that are not understandable based on margin computations
Margin = 0.5 * OptimalF * Capital * sqrt(1 + ProfitClosed/Capital)/iNum;

a. sometimes it opens lot size of 0.01 or 0.83 [Need Support from any forum member]
b. the exit strategy is when CCI is greater that +180/-180, this does not happen
i can see from the chart USD/CHF have severally moved beyond +180 and the trade did not close.
2. Trades does not open on any asset , i have about 18 asset.[Need Support from any forum member]
a.MT4 logs does not indicate any problem pertaining to requesting coming from Zorro application.
b. Zorro console does not throw any message or error message.


function run()
{
BarPeriod =60;
LookBack=1234;
StartDate =2013;
EndDate = 2015;

set(LOGFILE);

vars price = series(priceClose());
vars adx= series(ADX(14));
var slope =LinearRegSlope(adx,14);
var iCCI =CCI(14);
var SMASlow = ZMA(price,200);
var iT3 = T3(price,200,0.7);
var Threshold = 100;
var iNum=6;
var iSlopeVal=0;
var ExitEntry=180;
Detrend=16;
Capital = 2000;
assetList("AssetsCurFxPro.csv");

while(asset(loop("SILVEREURO","GOLDEURO","PLATINUM","EUR/GBP","NZD/USD", "BTC/USD","LTC/USD","ETH/USD","BCH/USD","XRP/USD","WTI","GOLD","SILVER","EUR/USD","USD/JPY","GBP/USD","AUD/USD","EUR/JPY","USD/CHF")))

Margin = 0.5 * OptimalF * Capital * sqrt(1 + ProfitClosed/Capital)/iNum;
{
if( iCCI < -Threshold && price[0] > SMASlow && price[0] > iT3 && slope >iSlopeVal)
enterLong();
if(NumOpenLong >0 && iCCI > ExitEntry)
exitLong();
}

{

if(iCCI >Threshold && price[0] < SMASlow && price[0] < iT3 && slope <iSlopeVal)

enterShort();

if(NumOpenShort >0 && iCCI < -ExitEntry)


exitShort();
}
}
Posted By: OptimusPrime

Re: CCI ,200 SMA & LinearRegression Slope Pullback Strategy - 11/02/18 18:59

Hi Materz:

You are assigning price and other values before you loop through any assets. If you look at the Counter Trend Trading System example in Workshop 5, you will see that price and trend values are set after we have started looping through assets.
Posted By: Materz

Re: CCI ,200 SMA & LinearRegression Slope Pullback Strategy - 11/07/18 13:21

Hi OptimusPrime.

I have resolved it. it exactly your solutions . is working now.
© 2024 lite-C Forums