Program Types, script not associated with Symbol

 

Hi guys,

I'm a newbie (but have programmed before) so you will have to forgive me, I understand the concepts of the program types (EA, CI and Script) and their scope of operation (Every Tick, Every Tick, Attach to Symbol Window).

Is there not a Program Type that can execute on say "Button Click" and execute against all the windows I want?

For example I would like to read a CSV and execute orders. Simple enough I would have thought but reading the documentation I find not as easy as originally considered.

And just working through this question I think I may have a partial answer. Now I'm lookin for validation.

If I consider my platform open as follows, MT4 platform open with only one "odd not to be used" chart window

Attach Script to chart (start to execute)

Open CSV

for EACH readline

if CSV indicated symbol window !open then

create new object (Window) with CSV line symbol

make trade

update CSV with result

close object (Symbol Window)

end if

next readline

Close CSV

end script

Is this the correct way of thinking as from what I can tell CreateObject doesn't allow me to create new Charts on the fly. Or do I simply have to have all windows open and hen cycle hrough the? Or do I have to do something more radical and use MT5 hich I believe has full objec orietation?

I'm not trying to much am I?

thanks and regards

 
You don't need to open a chart of a particular Symbol to place a trade on that Symbol . . . just go ahead and place your trade.
 
RaptorUK:
You don't need to open a chart of a particular Symbol to place a trade on that Symbol . . . just go ahead and place your trade.

First let's agree with Raptor to add confidence to his statement :-)

The part I didn't like was updating the CSV with the result. Are you talking about appending the result at the end or annotating the line with the symbol on it? Frankly both methods sound unpleasant as you are reading and writing from different points in the file. I think I would prefer to write the results to a different file to make it easier to code.

Reason: