Experts need your attention.

#23
Fahed,

By optimizing are you not curve fitting? So how can you be sure that behavior that you have identified will continue in the future?.

Over which period did you optimize? It is best to optimize over a portion of the data and then use the results that you obtained to test the remaining data.
 

fahed

Active Member
#24
I used 2 years data to optimize, I think the stock would follow the same pattern in future, You are right, But I have done a few trades recently and found this system efficient.

I also believe that there is no proven technique to always win, I have also done some losses using this system, But the majority is on the winning side.

I would also ask people to backtest and really find if this system is easy.

I also want to stick on to this system because it is very easily understandable.

I had an instance where the calls given by "Ananth" were almost same to the calls given by this system, I mean the Stop Loss and Targets, The target is not defined in this AFL, But I use a thumb rule to keep a factor of 1.5 times the difference amount between the SL and LTP.

Also with great respect to Ananth, Since his calls and the calls generated by this system were comparable, I like to follow this system,

No disrespect to Ananth, He is doing a great job, And I need his help now and he seems to be very busy to help me.

Fahed.
 
#25
Fahed,

I don't know how many years of data you have. If you have more that 2 years of data, do optimization on data which you haven't done so far and see if the results are withing the same range as before. That will give you the confidence to use this system.

To quote tushar chande "The primary benefit of optimization may be that
you improve your comfort level with a particular system"
 

asnavale

Well-Known Member
#26
I get a syntax error when I try to insert this formula, Can you tell me what's wrong in it,

if (Name() = (BAJAJHIND.NS))
ATRfactor = 1.9;
ATRperiod = 22;

else
{
ATRfactor = 1;
ATRPERIOD = 1;
}
Hi fahed,

The error is in if (Name() = (BAJAJHIND.NS)).

Error 1: When you are comparing two variables/values for equality use two "=" symbols instead of one.

A single "=" is used to assign values of right hand side to the variable on left hand side. It is called an assignment operator.

A pair of "=" is called equality operator. It tests the equality of the values on left hand side and right hand side and returns TRUE or FALSE.

Error 2: (BAJAJHIND.NS) is a string constant (Text) not a string variable. String constants must be enclosed in quotation marks and not in Brackets.

Therefore the correct syntax is:

if (Name() == "BAJAJHIND.NS")

Also, Be sure to write the name (BAJAJHIND.NS) exactly as it is stored in the database. The comparison is case sensitive. Otherwise, convert everything to upper case. If you covert, then the above corrected syntax will be:

if (StrToUpper(Name()) == StrToUpper("BAJAJHIND.NS"))

Make these changes and test.

-Anant
 

fahed

Active Member
#27
Ananth,

Thanks for all your help, Actually I was missing the quotes"". Now I have reached to this formula,
if (Name() == "BAJAJHIND.NS")
{
ATRfact = 1.9;
period = 22;
}
else
{
ATRfactor = 1;
period = 1;
}

if (Name() == "CIPLA.NS")
{
ATRfact = 2.4;
period = 23;
}
else
{
ATRfactor = 1;
period = 1;
}

Is there a simpler way to include all my 50 stocks together ??
 

fahed

Active Member
#28
Ananth,

Thanks for all the help, I am attaching here the new AFL, People can download and test for themselves if it is useful to them.

I need to add a Green Dashed Line for target, Can some one help me in that, The target will be 1.5 times the difference between LTP and Trailing SL only at the buy time, The same way Ananth has used, After Target has reached a new target of 1.5 times the difference between LTP and Trailing SL.

I also want to add explore to this AFL.

Best Regards,
Fahed
 

Similar threads