![]() |
|
| Discuss AmiBroker formula Language at the AmiBroker within the Traderji.com - Discussion forum for Stocks Commodities & Forex; Hi to all! I'm new in this forum and I'll would to greetings to you! ... |
|
|||||||
| Notices |
![]() |
|
|
Thread Tools |
| Sponsored Links |
|
#131
|
|||
|
|||
|
Hi to all! I'm new in this forum and I'll would to greetings to you!
I have a problem with a spunky indicator... I got already some advice but i feel that I can't do it by myself... ![]() So I want to make a so simple thing...I want to put a fixed 30 min timeframe pricechart below two different timeframe stochastic indicator.... a 4 hour and a 1 day stoch...so the price chart have to stay in 30 min timeframe... so thank your help...bye pikk-pak ---------------- I made it... So the 4 hourly looks like --- TimeFrameSet(4*inHourly); lassu= StochD(5,3,3); gyors=StochK(5,3); Plot (gyors, "Stoch 5,3,", colorBlue); Plot (lassu, "Stoch 5,3,3", colorRed); ------------------ now i have another question the 4 hourly scrolling faster than the daily...and it is not too good for me...I want that how so will be as the attachment...the bottom stock nice flat.. yesss...I made it ![]() TimeFrameSet(4*inHourly); _SECTION_BEGIN("stochastic 4 oras"); lassu= StochD(5,3,3); gyors=StochK(5,3); Plot(TimeFrameExpand(lassu, 4*inHourly),"Stoch 5,3,3", colorRed); Plot(TimeFrameExpand(gyors, 4*inHourly), "Stoch 5,3", colorBlue); _SECTION_END();
Last edited by pikk-pak; 20th May 2007 at 08:49 PM. |
| Sponsored Links |
|
#132
|
|||
|
|||
|
hello all,
i know nothing about programming and i'm trying to code a simple AFL system by modifying an existing one. but it does not work, i dont know why. will very much appreciate if you can help me figure out the coding mistakes, thanks! ![]() The function of this simple afl-script is simply to simultaneously place 2 set of orders (1 buy and 1 sell Bracket Orders) according to "previousclose", "inputvalue", "profittarget" and "trailstop" when initiated. it send order through InteractiveBrokers TWS. SCRIPT: InputValue1 = 50; InputValue2 = 50; profitTarget = 50; trailStop = 50; PreviousClose = 17000; TodaysOpen = 17500; OpenTime = 94500; //hhmmss (hh-hour, mm-minute, ss-sec->always00) //param trigger button to reset status resetStatus = ParamTrigger("resetStatus","resetStatus"); //START DateNumNow = Now(3); DN = DateNum(); TN = TimeNum(); /* //TodaysOpen = StaticVarGet("TodaysOpen"); //if(IsEmpty(TodaysOpen)) { for( i = 0; i < BarCount; i++ ) { if(DN[i]==DateNumNow AND TN[i]==OpenTime) { StaticVarSet("TodaysOpen",Open[i]); } } } TodaysOpen = StaticVarGet("TodaysOpen"); */ //check if order placed OrderPlaced = StaticVarGet("OrderPlaced"); if(resetStatus) { StaticVarSet("OrderPlaced",0); } OrderPlaced = StaticVarGet("OrderPlaced"); //display info Title = WriteIf(NOT IsEmpty(TodaysOpen), "Today's Open is"+NumToStr(TodaysOpen,1.0), "") +" PreviousClose is"+NumToStr(PreviousClose) +"\n\nCurrentSetting:\nprofitTarget is "+NumToStr(profitTarget) +" trailStop is"+NumToStr(trailStop) +"\n\n"+WriteIf( (IsEmpty(OrderPlaced) OR OrderPlaced==0),"Order Not Created", "Order Created"); //check if order is triggered, place order if condition fullfiled if( (IsEmpty(OrderPlaced) OR OrderPlaced==0) ) { //Long side, place order ibc = GetTradingInterface("IB"); IBcStatus = ibc.IsConnected(); if( IBcStatus ) { StaticVarSet("OrderPlaced",1); LimitBuy = PreviousClose+inputvalue1; parentID = ibc.PlaceOrder(Name(), "BUY", 1, "LMT", LimitBuy, 0, "DAY", False ); ibc.PlaceOrder(Name(), "SELL", 1, "LMT", LimitBuy+profitTarget, 0, "DAY", False, 1, "", parentID ); ibc.PlaceOrder(Name(), "SELL", 1, "TRAIL", trailStop, trailStop, "DAY", True, 1, "", parentID ); } //short side, place order ibc = GetTradingInterface("IB"); IBcStatus = ibc.IsConnected(); if( IBcStatus ) { StaticVarSet("OrderPlaced",-1); LimitSell = PreviousClose+inputvalue2; parentID = ibc.PlaceOrder(Name(), "SELL", 1, "LMT", LimitSell, 0, "DAY", False ); ibc.PlaceOrder(Name(), "BUY", 1, "LMT", LimitSell-profitTarget, 0, "DAY", False, 1, "", parentID ); ibc.PlaceOrder(Name(), "BUY", 1, "TRAIL", trailStop, trailStop, "DAY", True, 1, "", parentID ); } } |
|
#133
|
|||
|
|||
|
Quote:
Sorry just read your post. Had such an afl completed just two days ago. The afl code for conventional (floor type) pivot/support/resistance points is as follows: Code:
/*Pivot Points (floor type)*/
/*Graph section*/
pp=((H+L+C)/3);
r1=((2*pp)-L);
r2=(pp+(H-L));
r3=(H+(2*(pp-L)));
s1=((2*pp)-H);
s2=((pp-H)+L);
s3=(L-(2*(H-pp)));
Plot(pp,"Pivot point",ParamColor("Pivot Point",colorGold),styleNoLine);
Plot(r1,"R1",ParamColor("R1",colorRed),styleDots+styleNoLine);
Plot(r2,"R2",ParamColor("R2",colorRed),styleDots+styleNoLine);
Plot(r3,"R3",ParamColor("R3",colorRed),styleDots+styleNoLine);
Plot(s1,"S1",ParamColor("S1",colorLime),styleDots+styleNoLine);
Plot(s2,"S2",ParamColor("S2",colorLime),styleDots+styleNoLine);
Plot(s2,"S2",ParamColor("S3",colorLime),styleDots+styleNoLine);
/*Exploration section*/
Filter=V>0;
AddColumn(r3,"R3",1.2,colorBlack,colorGold);
AddColumn(r2,"R2",1.2,colorBlack,colorGold);
AddColumn(r1,"R1",1.2,colorBlack,colorGold);
AddColumn(pp,"Pivot",1.2,colorBlack,colorLavender);
AddColumn(s1,"S1",1.2,colorBlack,colorLime);
AddColumn(s2,"S2",1.2,colorBlack,colorLime);
AddColumn(s3,"S3",1.2,colorBlack,colorLime);
/*
Usage Notes:
1. To overlay the pivot point and support/resistance levels over price chart, just drag and drop.
2. To calculate pivot point and support/resistance levels in a tabulated form, just run an exploration.
*/
|
|
#134
|
||||
|
||||
|
Quote:
Quote:
Quote:
As far as I know there are no 2-D arrays in Amibroker. Quote:
Praveen. |
|
#135
|
|||||
|
|||||
|
Quote:
Quote:
Quote:
Quote:
Quote:
Regards, Kalyan. |
|
#136
|
|||
|
|||
|
Its again 1-D array. Linearray takes four 1-D array. There are no 2-D arrays, as far as I know.
|
|
#137
|
|||
|
|||
|
Although its off-topic, its ok.
We can simulate 2-D arrays in Amibroker(AFL) using the following method, posted somewhere in Amibroker Yahoo groups. Quote:
Quote:
|
|
#138
|
|||
|
|||
|
Quote:
The only difference in the 2 cases is that in the case of predefined arrays (like C, H) the BarIndices are implicit while in the case of Linearray it's explicitly passed, the basic format for the parameter in both cases being (BarIndex, Y-Value). Anyway these are just academic musings Doesn't solve BAVs problem. Regards, Kalyan. Last edited by kkseal; 29th July 2007 at 10:14 PM. |
|
#139
|
|||
|
|||
|
Quote:
It's also useless for our purpose as the 2 'array' elements are tied to a string and (above all) not being a true 2-D array will be unacceptable to PLOT. Regards, Kalyan. |
|
#140
|
|||
|
|||
|
Great work, Praveen
|
| Sponsored Links |
|
|
![]() |
| Bookmarks |
| Thread Tools | |
|
|
Similar Threads for: AmiBroker formula Language
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| need help on formula | cmlee | MetaStock | 23 | 8th October 2007 07:55 PM |
| Metastock ,Metatrader & Amibroker indicator formula | saji oommen | MetaStock | 0 | 4th June 2006 06:35 PM |
| Metastock language help | Ropewalker | MetaStock | 4 | 1st November 2005 09:16 PM |
| TradeStation & MetaStock Formula Language | bikertrader | MetaStock | 4 | 10th December 2004 01:50 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.