This has been brought up previously, however I'm still struggling to set the leverage for Forex.

I'm using 

SetHoldings(pair1, 1);

to enter and exit trades.

When setting the leverage in AddForex:

AddForex(pair1, Resolution.Hour, Market.FXCM, leverage:10.0M);

or with:

Securities[pair1].SetLeverage(10.0M);

The results seem to be the same.

However, if I use a higher portfolio percentage in SetHoldings my position size is scaled up, but I'm not sure what the interaction is between this and the set leverage.

 

So my two questions are:

  1. Do Forex securities still default to a leverage of 50x ? (This was mentioned in a previous discussion), and if so, in which file in the LEAN code is this set ? (To check if this changes in the future)
  2. How to properly set the leverage for Forex?

Any help would be appreciated :)

(I'm attaching a minimal working example where I'm playing around with this)

 

Author