Exploring a simple script 2

24‏/10‏/2009
OK a few apologies are in order. When the script was posted yesterday, there were a few errors that found their way into the post. So today at the end of this post you will find a link to down load the file. It will be unlocked and fully accessible for changes. Today I want to talk about the use of Global variables versus Local variables. This script uses 5 global variable to pass along information. The difference in the two variables is how long the information is held by the variable anf what has access to that information. Local: Declares a local variable in the chart. These variables remain accessible only within the particular script. These variables can be assigned an initial value. This value is held only as long as the specified condition is true. Global: Declares a global variable in the chart. These variables remain accessible from every IntelliScript that are attached to the same Data Series. These variables can be assigned an initial value. The value can be held as long as you wish. For today’s discussion, I am going to explain the first two global variables, because the concept behind them is detailed enough to fill this post. global int ii global int hh When we initially wanted to set up the script we needed a way to count the process that we were going through. This counting needed to be done for several reasons, none of which are used in the final iteration of the script but we left in so we could test other changes as well. The original reason was to add contract names. Remember that you cannot have more than 1 trade open in one direction at a time. That is unless they have different names. Counting was a way to add a different name. After each addbuyentry/addsellentry you will see the following lines of code hh=hh+1 ii=ii+1 This steps the value up 1 for every time the group is “true” and a new signal is created. We could then add: Contract = “+ii+” or Contract = “+hh+” behind the addbuyentry or addsellentry and new positions in the same direction would be created with a contract name of a number. Now lest you think it’s all that easy, remember you would also have to exit each of those contracts too. For this reason we abandoned this strategy in favor of another but left it there in case we wanted it in the future.

0 التعليقات:

أضف تعليق

أنشر تعليقك

السابق التالى الصفحة الرئيسية
 
 
 

MATAF تحليــلات

التحليلات اليومية والأخبار

 
تحذير المخاطرة | سياسة الخصوصية | من نحن ؟ | اتصل بنا | إعلن معنا | RSS | الرئيسية
...............................................................................................................................................................................................................................................................................
توضيح مخاطرة
المعلومات الواردة في هذا الموقع الإلكتروني هي للإطلاع فقط . ولا تعني حث المطلع عليها للإتجار بأي عملة أو أسهم او سندات أو معادن أو أي ورقة مالية . حيث تعكس المعلومات في هذا الموقع رأي الكاتب نفسه و الذي من المفترض أن تكون دقيقة و لكنها لا تعتبر مضمونة أو دقيقة, ونحن لا نعد ولا نضمن بأن تبني اي من الإستراتيجيات المشار إليها سوف يفضي الى أرباح تجارية . وبالتالي فإن الموقع والعاملون به والشركات التابعة له ليسو مسؤولين بأي شكل من الأشكال عن أية خسائر قد تنتج من الأخذ بالمعلومات الواردة فيه
تحذير مخاطرة
يعتبر الاستثمار في سوق العملات العالمية باستخدام الهامش أو الروافع المالية من المجالات الاستثمارية عالية الخطورة والتي تستلزم وضع العديد من الأسس العلمية الكفيلة بإنجاح العمليات الاستثمارية في هذا السوق وليس بالضرورة أن تكون هذه المتاجرة متوافقة مع كل المستثمرين، و بالتالي فإن الإستثمار في هذه السوق يتطلب قدرا عاليا من الدراية بمخاطره وتوخي الحذر عند اتخاذ قرار الشراء والبيع.
تداول العملات
الأجنبية يمكن أن يكون مربح للمستثمرين ذوي الخبرة ومع ذلك فإنه قبل اتخاذ قرار بالمشاركة في سوق العملات يجب أن تنظر بعناية في أهداف استثمارك ومستوى الخبرات والمخاطر والأهم من ذلك أن لا تستثمر أموالا لا تستطيع تحمل خسارتها حيث أن هناك قدر كبير من التعرض لمخاطر تقلبات أسعار الصرف الأجنبي، فأي صفقة في سوق العملات تنطوي على مخاطر بما في ذلك على سبيل المثال لا الحصر، احتمال تغير سياسي أو الظروف الاقتصادية التي قد تؤثر تأثيرا بشكل كبير في الأسعار أو سيولة العملة مما قد ينتج عنه خسارة بعض اموالك أو لا سمح الله جميع ماتملك في هذا السوق
Copyright © فوركس واى