Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, VoroneTZ), 831 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
CCI ,200 SMA & LinearRegression Slope Pullback Strategy #474704
10/31/18 08:56
10/31/18 08:56
Joined: Dec 2017
Posts: 19
M
Materz Offline OP
Newbie
Materz  Offline OP
Newbie
M

Joined: Dec 2017
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 Close = series(priceClose());
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();
}
}

Re: CCI ,200 SMA & LinearRegression Slope Pullback Strategy [Re: Materz] #474707
10/31/18 11:04
10/31/18 11:04
Joined: Feb 2015
Posts: 652
Milano, Italy
M
MatPed Offline
User
MatPed  Offline
User
M

Joined: Feb 2015
Posts: 652
Milano, Italy
well, the first improvement I would test is:

var oldMargin= Margin;

Margin = max( oldMargin, 0.5 * OptimalF * Capital * sqrt(1 + ProfitClosed/Capital)/iNum));

ciao

Re: CCI ,200 SMA & LinearRegression Slope Pullback Strategy [Re: MatPed] #474709
10/31/18 11:36
10/31/18 11:36
Joined: Dec 2017
Posts: 19
M
Materz Offline OP
Newbie
Materz  Offline OP
Newbie
M

Joined: Dec 2017
Posts: 19
Hi Ciao,

My exist is not working , when CCI get to +/- 180 level .. do you have workaround ?

Re: CCI ,200 SMA & LinearRegression Slope Pullback Strategy [Re: Materz] #474711
10/31/18 13:33
10/31/18 13:33
Joined: Feb 2015
Posts: 652
Milano, Italy
M
MatPed Offline
User
MatPed  Offline
User
M

Joined: Feb 2015
Posts: 652
Milano, Italy
Why are u calculating outside the while loop the CCI and modt of the other valus? Usually u want to calculate most of that falus for each asset, not once for all...
I guess that the logic is wrong, not the coding


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1