Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to do this correctly?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to do this correctly?

    Hello,

    I have a List variable which includes all the executions (read from the external application) and I am trying to add Up and Down arrows to the execution points on the chart but I cannot get it to work correctly. Arrows are not shown everytime and they disappear and comes back when I scroll the chart.

    I have checked by printing this "Kaupat" List object to the output window so it really includes all the execution data and everything is in order.

    Here are the key points of the script:

    // This is the structure for the execution information
    public struct Kauppa
    {
    public string symbol;
    public string dir;
    public int position;
    public double price;
    public DateTime dateTime;
    public Kauppa(string sy, string di, int po, double pr, DateTime dt)
    {
    symbol = sy;
    dir = di;
    position = po;
    price = pr;
    dateTime = dt;
    }
    }

    // This list holds the executions. This list is initialized from the disk
    // file elsewhere in the script
    private List<Kauppa> Kaupat;

    // Here I try to update the chart. Is this the correct place for this purpose?
    protected override void OnBarUpdate()
    {
    foreach(Kauppa k in Kaupat)
    {
    if(k.dateTime <= Time[0] && k.dateTime > Time[1])
    if(k.dir.CompareTo("BOT") == 0)
    DrawArrowUp("", true, 0, Low[0]-TickSize*2, Color.Green);
    else
    DrawArrowDown("", true, 0, High[0]+TickSize*2, Color.Red);
    }
    }

    SG

    #2
    ScalpGuy, unfortunately this outside of our supported scope - but for your DrawArrows I would suggest using a unique drawing tag ID if you want multiple arrows displayed instead of only modifying one.

    Comment


      #3
      Sorry I did not know that this kind of questions cannot be asked.

      BUT thank you very much for the support anyway. Now it works!

      Comment


        #4
        Great that did the trick ScalpGuy!

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        574 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        332 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        553 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        551 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X