Gamestudio Links
Zorro Links
Newest Posts
Using ":L" & ":S" causes 2 possible bug(s) or is it bad coding?
by AndrewAMD
8 minutes 26 seconds ago
Help with Data import to T1
by OptimusPrime
Today at 19:44
How to ensamble multiple algos with advise calls?
by laz
Today at 18:53
Correlation -1.#IND00
by AndrewAMD
01/21/19 17:37
Basic thread safety question
by Superku
01/20/19 18:15
Blog Post: Get Historical Data from Darwinex REST API w/ Zorro
by AndrewAMD
01/19/19 22:19
Reseting a static variable - the next day
by OptimusPrime
01/19/19 19:48
AUM Magazine
Latest Screens
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Evonet Beta v1.0 : Online Project Development Template
Lake scene
Who's Online
12 registered (OptimusPrime, AndrewAMD, jacek, Dalla, kvm, Quad, Iglarion, ibne, misiek, 3 invisible), 489 Guests and 7 Spiders online.
Key: Admin, Global Mod, Mod
Newest Members
jthbln, laz, ramonne, SibJac, Evael
18157 Registered Users
Topic Options
Rate This Topic
#474705 - 10/31/18 10:11 CCI ,200 SMA & LinearRegression Slope Pullback Strategy
Materz Offline
Newbie

Registered: 12/05/17
Posts: 19
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();
}
}

Top
#474740 - 11/02/18 19:59 Re: CCI ,200 SMA & LinearRegression Slope Pullback Strategy [Re: Materz]
OptimusPrime Online
Newbie

Registered: 08/09/18
Posts: 49
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.
_________________________
Thanks so much,

OptimusPrime


Top
#474817 - 11/07/18 14:21 Re: CCI ,200 SMA & LinearRegression Slope Pullback Strategy [Re: OptimusPrime]
Materz Offline
Newbie

Registered: 12/05/17
Posts: 19
Hi OptimusPrime.

I have resolved it. it exactly your solutions . is working now.

Top



Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de