Print [Variable [inside a variable]] Delphi

Examples step by step how to make your own automated strategy or user indicator
Message
Author
conjure123
Posts: 3
Joined: Thu Jun 06, 2019 10:48 am

Print [Variable [inside a variable]] Delphi

#1 Postby conjure123 » Thu Jun 20, 2019 7:50 pm

I am trying to assign a variable inside a variable but i m getting an error
I am trying to output something like that in the journal
founds = Eureka1
founds = Eureka2
founds = Eureka3
founds = Eureka4
...

This is the part of the code where i get error.
Print(format('founds = %.4f',[Eureka [found]]));
Can someone help me?


Code: Select all

procedure GetSingleTick; stdcall;
var

   limitB, limitS, stopB, stopS, stop, limit:double;
   found :integer;
   total, k, l, telos:integer;
   DistanceB, Distances, SL, TP:double;
   Eureka:integer;

begin
      // check our currency
  if Symbol <> string(Currency) then exit;
  // set currency and timeframe
  SetCurrencyAndTimeframe(Symbol, TimeFrame);

     if (Open(0) = Close(0))
     and (Open(0) = High(0))
     and (Open(0) = Low(0))
     and (Close(0) = High(0))
     and (Close(0) = Low(0))
     and (High(0) = Low(0))  then
begin
       total:=0;
       found:=0;

  if (OrdersTotal()<>0) then
       total := OrdersTotal();

       while (total <> -1)  do
       begin
                if OrderSelect(total, SELECT_BY_POS, MODE_TRADES) then
                if (OrderSymbol()=Currency) then
                if OrderProfit() >0 then
                           begin
                   Print(Currency) ;
                    Print(format('Profit = %.4f', [OrderProfit]));
                     Print(format('Open Price = %.4f', [OrderOpenPrice]));
                      Print(format('LIMIT = %.4f', [OrderTakeProfit]));
                       Print(format('STOP = %.4f', [OrderStopLoss]));
                        Print(format('Ticket = %d', [OrderTicket]));
                         found:=found+1;
                          Print(format('founds = %d',[found]));

                             Print(format('founds = %.4f',[Eureka [found]]));
                           end;
       total:=total-1;
       end;

end;




Capture.PNG
Capture.PNG (6.98 KiB) Viewed 12704 times

Return to “Programming lessons”

Who is online

Users browsing this forum: No registered users and 10 guests