![]() |
|
| Discuss missing buy/sell variable assignments at the AmiBroker within the Traderji.com - Discussion forum for Stocks Commodities & Forex; missing buy/sell variable assignments could someone help me I have written some basic codes Code: ... |
|
|||||||
| Notices |
![]() |
|
|
Thread Tools |
| Sponsored Links |
|
#1
|
|||
|
|||
|
missing buy/sell variable assignments
could someone help me I have written some basic codes Code:
x="ref(close,0)";
for(i=1;i<5;i++)
{
"ref(close,-i)">x;
x="ref(close,-i)";
}
buy=x;
sell=0;
Pls. don't joke for this light code but this is first afl code Also I have a small doubt whether we have to start with main() like in c or are their any rules like main in c etc THANX IN ADVANCE |
|
#2
|
|||
|
|||
|
Quote:
Please find the attached AFL which does your job exactly. It will display green buy arrow at the 5th bar. It can be used for any periods for lookback, ie 5 in your case. Let me know if anything is wrong or I've misunderstood your requirements. If you want to either just change your code or need to use only Ref(), let me know. I will try it tomorrow. No, we dont' need any C like main(). The AFL is executed from the first line. Hope this helps, Praveen. |
|
#3
|
|||
|
|||
|
thanx but it gives
error 29 [code] lowerCloseForming = True; } shape = Buy * ------------^ Error 29. Variable 'buy' used without having been initialized. } /CODE] Also I am studying Engg. II Yr so I have learnt c as one of my subject so I wanted to make simple easy to read code what are variables to initialise today's close and yesterday's close I din't want to chart but simply put in automatic analysis one of the basic rules of trading is : KISS (KEEP IT SIMPLE, SIR !!!) Thanx for ur reply Last edited by brijwanth; 15th November 2006 at 03:30 PM. |
|
#4
|
||||
|
||||
|
Quote:
Quote:
Quote:
Today close -- Close[barCount] Yesterday's close -- Close[barCount - 1] If you are referring to any other question, please explain it clearly. I will try to answer. Quote:
As usual, if I'd wrong anywhere, please let me know. Hope this helps, Praveen. |
|
#5
|
|||
|
|||
|
I meant to know the stocks which gave lost 10% in the past 5 days.
I want to put that program in automatic Analysis of Amibroker issing buy/sell variable assignments this error repeats if i backtest and runs fine if i press scan Last edited by brijwanth; 17th November 2006 at 05:51 PM. |
|
#6
|
|||
|
|||
|
Quote:
For backtest, you need to specify when to buy and sell using 'Buy' and 'Sell' variables. Backtest wont work without these two variables. The smallest AFL for backtest can be something like: Quote:
Quote:
Praveen. |
|
#7
|
|||
|
|||
|
thanx praveen
|
| Sponsored Links |
|
|
![]() |
| Bookmarks |
| Thread Tools | |
|
|
Similar Threads for: missing buy/sell variable assignments
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| When to Buy? When to Sell? | nkpanjiyar | Equities | 4 | 5th January 2008 05:35 AM |
| Did u buy or sell ?? Why | eskay_raut | Equities | 4 | 4th July 2006 10:09 AM |
| SELL and BUY | irfan | Equities | 8 | 31st October 2005 12:31 PM |
| MIA (Missing in Action) | jaideep | General Chit Chat | 2 | 22nd August 2005 11:00 AM |
| Metastock - missing MACD histogram | cmlee | MetaStock | 3 | 24th February 2005 09:24 PM |
Indemnity, Disclaimer & Disclosure
Notice:
• By visiting Traderji.com you indicate your acceptance of our Forum
Rules Disclaimer & Disclosure and indemnify Traderji.com, its
associates and related parties of all claims howsoever resulting from
the usage of the forum.
• Disclaimer: Trading or investing in stocks & commodities
is a high risk activity. Any action you choose to take in the markets
is totally your own responsibility. Traderji.com will not be liable for
any, direct or indirect, consequential or incidental damages or loss arising out of the use of this information.
• Disclosure: The information in this forum is neither an offer to sell nor solicitation to buy any of the securities mentioned herein.
The writers may or may not be trading in the securities mentioned.
• All names or products mentioned are trademarks or registered trademarks of their respective owners.
General Content Disclaimer Notice:
In light of our policy of encouraging candid, open exchanges of views and the rapid distribution of information originating from many sources, Traderji.com cannot determine the accuracy of information that may be uploaded to the forum. Opinions, advice and all other information expressed by participants in discussions are those of the author. You rely on such information at your own risk. You are urged to seek professional advice for specific, individual situations and not rely solely on advice or opinions given in the discussions. Since Traderji.com is an open and free discussion forum, any comments made by members of this forum in their posts reflect their own views and not of the owner or administrator of Traderji.com. Thus the owner/administrator indemnify themselves of all claims whatsoever and will not be liable or responsible for any members comments/views in this forum Traderji.com. If you find any objectionable or offensive posts made by members of this forum which you would like to bring to our notice for removal then please Contact Us.