Interesting take on the PLO - page 13

 
Dmitry Fedoseev:

Exhaustive! I can't add more ))

Sarcasm is understandable, but nevertheless - this is a basic difference and all the others are consequences of it. For example, the absence in a pure FP of variables, the values of which can be changed.

 
Dmitry Fedoseev:
And how is this OP fundamentally different from using pointers to functions?

Assignment is forbidden in FP. Objects can only be created and copied.

 
Vasiliy Sokolov:

Assignment is forbidden in FP. Objects can only be created and copied.

well, at least something started to become clear by page 13 of the discussion - watched several video tutorials on youtube, just babbling about some high art in the form of FP))


ZS: If you had written an article, I think it would be useful for "immature minds", the style of presentation in your articles deserves respect (well, I like your articles if not make it up ))). ), of course, need to agree with the admins

 
Vasiliy Sokolov:

Assignment is forbidden in FP. Objects can only be created and copied.

If you can't, but really want to, you can) You just have to deal with monads)

 
Igor Makanu:

SZS: if you wrote an article, I think it would be useful for "immature minds", the style of presentation in your articles deserves respect (well, or I like your articles if you do not make it up ))) ), of course we must agree with the admins.

Unfortunately, I can't. First, I do not know a lot about FP, but just the basics. Secondly, MQL and FP are different universes. There is no justification for disguising FP as a practical material devoted to MQL.

 
Vasiliy Sokolov:

Secondly, MQL and FP are different universes. There is no justification for masquerading FP as practical MQL material.

Write an article on how to connect haskell dll to mt. And explain that fp is safe and what you need for finance.

 
Well, a few more theses about FP:
  • In FP, assignment is forbidden. Objects can only be created and copied.
  • Pure functions. If f(a, b) = c. Then if a and b are the same, the result of f will always be the same. Then we can usememoization: the result of a function is calculated once, and then it is simply retrieved by the key from its arguments.
  • Carrying. If there is a function f(a,b), it can be represented as f(a) -> f(b) (a function taking an argument a and returning another function taking an argument b:
    public static Action<string> GreetingCarry(string g)
    {
        Action<string> pn = (b) => Console.WriteLine(g + " " + b);
        return pn;
    }
    
    var printGreetingAndName = GreetingCarry("Hello");
    printGreetingAndName("Ivan");
    printGreetingAndName("Sergey");
    
    >> Hello Ivan
    >> Hello Sergey
  • Stack operations. If assignment is forbidden, there is no reference exchange. Therefore, objects are allocated directly on the stack, hence they are thread-safe. There is no reference exchange of objects in the heap (assignment is forbidden). Therefore, accessing an object on the heap is also performed monopolistically from a single thread. Therefore, object access is thread-safe "out of the box".
 
Rorschach:

Write an article on how to connect haskell dll to mt. And explain that fp is safe and what you need for finance.

Why bother - just put Lisp in MQL :-)

it's cool that there's not much code in the lisp dialect implementation...it's small

only the practical meaning of this action is not addressed. Which hints in principle at the power and relevance of FP in this field
 
Maxim Kuznetsov:

why bother - Lisp to MQL at once :-)

it's cool that there's not much code in the lisp dialect implementation... it's small

only the practical meaning of this action is not seen. Which alludes in principle to the power and relevance of FP in this field

Clojure then

Started looking for languages with more expressiveness, so as to trample the keyboard less. This one turned out to be even shorter than Python. It has a version based on .net, and the non-New bibles are connected in 1 move to mt.
 
On the subject of weird writing styles. I came across my own code with this twist.
// Определение Offset-параметра в ЛК.
int GetOffset()
{
  const double Price = NormalizeDouble(Ask / 2, _Digits);
  const double Lots = SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_MIN);
  
  const TICKET_TYPE Ticket = OrderSend(_Symbol, OP_BUYLIMIT, Lots, Price, 0, 0, 0, "RannForex LimitOffset Detected");
  
  return((Ticket > 0) && OrderSelect(Ticket, SELECT_BY_TICKET) ?
         (int)((OrderOpenPrice() - Price) / _Point + OrderDelete(OrderTicket()) * 0.1) : 0);
}
Reason: