[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 623

 
lottamer:


prints zeros... not working... no need to dig in, because it's obvious that the cycles are just substituted one for the other - the volume has clearly not decreased..... and we already have a working variant. In addition, in the first variant - I can compare orders ... and here I can't even see where the second is ... and the first is zero ...

after some minor tinkering...which clearly develops the brain, this code worked too! :))) thanks


Just print the Ticket1 and Ticket2 variables after the function call.
 

rigonich

Can you tell me which file the glob. variables are written to? So that it can be quickly transferred to another terminal.

 
rigonich:

Again 45, in this formOrderSelect(LastClosetPoz (),SELECT_BY_TICKET) by default selects among pending and open orders, and this order is not there. PutOrderSelect(LastClosetPoz (),SELECT_BY_TICKET, MODE_HISTORY).


naa....nii...MODEs...only work withSELECT_BY_POS. And the ticket itself! it is absolutely individual, so you don't even need to specify where it is

(finish the answer there...I was finalising the solution)

-------Parameters:

index - Order index or order ticket depending on the second parameter.
select - Selecting flags. It can be any of the following values:
SELECT_BY_POS - index in the order pool,
SELECT_BY_TICKET - index is order ticket.
pool - Optional order pool index. Used when the selected parameter is SELECT_BY_POS. It can be any of the following values:
MODE_TRADES (default) - order selected from trading pool (opened and pending orders),
MODE_HISTORY - order selected from history pool (closed and canceled orders).
 
lottamer:


naa....niiiii...mods...only work withSELECT_BY_POS. And the ticket itself! it's completely individual, so you don't even need to specify where it is

-------Parameters:

index - Order index or order ticket depending on the second parameter.
select - Selecting flags. It can be any of the following values:
SELECT_BY_POS - index in the order pool,
SELECT_BY_TICKET - index is order ticket.
pool - Optional order pool index. Used when the selected parameter is SELECT_BY_POS. It can be any of the following values:
MODE_TRADES (default)- order selected from trading pool (opened and pending orders),
MODE_HISTORY - order selected from history pool (closed and canceled orders).


Sorry, I messed up, you are right, it is just in your line if (Print("Stop loss", OrderStopLoss());) Print("Stop loss", OrderStopLoss());; there is no condition, an operator is inserted instead.
 
Desead:

I'm not a programmer, but sometimes I write the simplest things myself. You can write a simple robot in any language and it's not a problem at all. I don't want to execute a part of functions as a dll and call them from μl, but to write the whole robot with its own interface without calling Metatrader. I have invented a lot of different visual languages where I can do it without much effort.


I see. In the MT package, there are examples of writing dlls in C2C++.

Catalogue: Catalogue_In_which_MT\experts\samples is located. Take it and edit it to suit your needs. You don't need a deep knowledge of C++ to work with it. Knowledge of C basics and syntax is enough.

Please note: the project must have .def file, otherwise you won't connect the dll. In the example is such a project as it should be.
 
xant:

rigonich

подскажите пожалуйста, в какой файл записываются глоб. переменные? Чтобы можно было быстро перебрасывать на другой терминал. 

I don't know, I haven't found it, but you can probably open service-->global variables in the terminal and copy them from there, try it.

And in general it's related to synchronization of several terminals, try to search in this direction, I think I found something like this on this site or in articles, or in kodobase.

 
rigonich:


terminal\profiles\gvariables.dat
 
r772ra:


terminal\profiles\gvariables.dat

Thanks, that's right, I've looked through most of the folders but I haven't thought to look in the profiles.
 
rigonich:

Sorry, I messed up, you're right, it's just your line if (Print("Stop loss", OrderStopLoss();) Print("Stop loss", OrderStopLoss();); there is no condition, an operator is inserted instead.


I'm stuck again...at the very last step...

The tickets have been pulled out - they are working. now i'm trying to use them - to pull theOrderProfit of the corresponding position.... it prints zeros...(but the ticket prints correctly)

if you remove==true- same thing....

is there any wayOrderSelect can be used WITHOUT if ?

WHEN it works:

if (OrderSelect( Ticket1,SELECT_BY_TICKET)) Print("Stop loss", OrderStopLoss());

prints stop loss level.

---------------------------

I will have to take your version with a common loop.OrderProfit is clearly recognized there!Damn! What's the difference? Everything is the same!?

 LastClosetPoz();SecLastClosetPoz();   Print ( LastClosetPoz(),"___",SecLastClosetPoz()); 

 

if  (OrderSelect( LastClosetPoz(),SELECT_BY_TICKET)==true) X=OrderProfit();



if  (OrderSelect( SecLastClosetPoz(),SELECT_BY_TICKET)==true) Y=OrderProfit(); Print (X,"+",);

 
 
lottamer:


I'm stuck again... at the very last step...

The tickets have been pulled out - they work. now I'm trying to use them - to pull theOrderProfit of the corresponding position.... it prints zeros...(but the tickets print correctly)

if you remove==true- same thing....

is there any wayOrderSelect can be used WITHOUT if ?

WHEN it works:

if (OrderSelect( Ticket1,SELECT_BY_TICKET)) Print("Stop loss", OrderStopLoss());

prints stop loss level.

---------------------------

I will have to take your version with a common loop.OrderProfit is clearly recognized there!Damn! What's the difference? Everything is the same!?

OrderSelect( SecLastClosetPoz(),SELECT_BY_TICKET);
You can also use it this way, if the order with the required ticket exists, the function will select it.
Reason: