Simple Coding Help - No Promise.

For backtesting purpose how to code so that trade is executed as soon as a price is touched instead of trade execution at CLOSE, OPEN,HI,LOW ?
Hello

You can use some thing like

Code:
Buy  = Cross(H, myLevel); //Price touched from  down
Sell = Cross(myLevel, L); //Price touched from up 

//For backtesting config
BuyPrice  = myLevel;
SellPrice = myLevel;
SetTradeDelays(0,0,0,0);
SetPositionsize(1,4);
But as your level is any BRN and not derived out of some logic based on PRICE/Volume/Indicator, it needs to be hard coded or done in a for loop maybe a nested one . . .


:) Happy
 
Last edited:
Hi Happy Singh Brother
Lot of thanks for the code ,this what I am looking for
Sorry I forget say one thing I want this as an indicator
Over bought lv as 100
Over sold lv as -100
Thanks brother
 
hello friends

i am starting this thread for helping anyone who requires small changes in afls or afl coding done for small / simple requirements that can be clearly defined.

What does not go is conversion . . . From amibroker to anything else . . . Or from anything else to amibroker . . .

Debugging requested for copy/paste afls, please don't post huge afls with zillions of lines of code for debugging

i will not be available for any conversions and i am not interested in debugging some-one else's copy/pasted work and lastly . . .
Not interested in hacking/craking any ones work . . .

Only if have a clearly definable task to be coded i maybe able to help . . . No promises but will try within my limitations . . .


As an example, recently one of our friends wanted a motivational message to be included in his charts,
i enjoyed doing that, as i could easily empathize with why he wanted that . . .


Cheers

:) happy
@happy singh
sirji i have sent you some mails please check it and please help me out as early as possible
if you dont get the strategy reply me
 
Hi All,
Could you please someone help me to create the below AFL? Thanks in advance

The AFL should identify the last pivot high and pivot low. If last pivot high is above 15 SMA, it should create buy signal while pivot high is taking out. If last pivot low is below 15 SMA, it should create sell signal while pivot low is taking out. Thanks again for the help
 

ethan hunt

Well-Known Member
Hello

You can use some thing like

Code:
Buy  = Cross(H, myLevel); //Price touched from  down
Sell = Cross(myLevel, L); //Price touched from up 

//For backtesting config
BuyPrice  = myLevel;
SellPrice = myLevel;
SetTradeDelays(0,0,0,0);
SetPositionsize(1,4);
But as your level is any BRN and not derived out of some logic based on PRICE/Volume/Indicator, it needs to be hard coded or done in a for loop maybe a nested one . . .


:) Happy
thanks,
will try
 

dell

Well-Known Member
thanks happy ji , pratap sir with the help of both of u , i am getting more confidence in trading , by ur helping coding hands , i test my different idea's , backtesting it by bar to bar ,after testing different different idea's finally settled to one , now i trade with more confidence , did not get disheartened by loosing trades ,after seeing bar to bar for past 6 yrs bar's again and again while testing idea's , i reliaze it is a part of game , now when loosing steaks r there i now , now a bumper trade is waiting for me ,

my heartly thanks to both of u , for starting this wonderful thread and continuing it ......
this thread is really serving it's purpose ...........for learners , struggler's this thread is really boon .
 
Hi All,
Could you please someone help me to create the below AFL? Thanks in advance

The AFL should identify the last pivot high and pivot low. If last pivot high is above 15 SMA, it should create buy signal while pivot high is taking out. If last pivot low is below 15 SMA, it should create sell signal while pivot low is taking out. Thanks again for the help
Please someone help me on this. Thanks
 

Similar threads